@@ -271,6 +271,48 @@ const setup = async (tempDir: string) => {
271271}
272272
273273test . describe ( 'Bad config.py/config.yaml file issues' , ( ) => {
274+ test ( 'sqlmesh init, then corrupted config.yaml, bad yaml' , async ( {
275+ page,
276+ sharedCodeServer,
277+ } ) => {
278+ const tempDir = await fs . mkdtemp (
279+ path . join ( os . tmpdir ( ) , 'vscode-test-tcloud-' ) ,
280+ )
281+ await setup ( tempDir )
282+ await createPythonInterpreterSettingsSpecifier ( tempDir )
283+
284+ const configYamlPath = path . join ( tempDir , 'config.yaml' )
285+ // Write an invalid YAML to config.yaml
286+ await fs . writeFile ( configYamlPath , 'invalid_yaml; asdfasudfy' )
287+
288+ await page . goto (
289+ `http://127.0.0.1:${ sharedCodeServer . codeServerPort } /?folder=${ tempDir } ` ,
290+ )
291+ await page . waitForLoadState ( 'networkidle' )
292+
293+ // Open full_model.sql model
294+ await page
295+ . getByRole ( 'treeitem' , { name : 'models' , exact : true } )
296+ . locator ( 'a' )
297+ . click ( )
298+ await page
299+ . getByRole ( 'treeitem' , { name : 'full_model.sql' , exact : true } )
300+ . locator ( 'a' )
301+ . click ( )
302+
303+ // Wait for the error to appear
304+ await page . waitForSelector ( 'text=Error creating context' )
305+
306+ // Open the problems view
307+ await runCommand ( page , 'View: Focus Problems' )
308+
309+ // Asser that the error is present in the problems view
310+ await page
311+ . getByText ( 'Invalid YAML configuration:' )
312+ . first ( )
313+ . isVisible ( { timeout : 5_000 } )
314+ } )
315+
274316 test ( 'sqlmesh init, then corrupted config.yaml, bad parameters' , async ( {
275317 page,
276318 sharedCodeServer,
0 commit comments