@@ -4,6 +4,7 @@ import os from 'os'
44import path from 'path'
55import {
66 createVirtualEnvironment ,
7+ openLineageView ,
78 pipInstall ,
89 REPO_ROOT ,
910 startVSCode ,
@@ -72,3 +73,53 @@ test('missing LSP dependencies shows install prompt', async ({}, testInfo) => {
7273 await fs . remove ( tempDir )
7374 }
7475} )
76+
77+ test ( 'lineage, no sqlmesh found' , async ( { } , testInfo ) => {
78+ testInfo . setTimeout ( 120_000 ) // 2 minutes for venv creation and package installation
79+ const tempDir = await fs . mkdtemp (
80+ path . join ( os . tmpdir ( ) , 'vscode-test-tcloud-' ) ,
81+ )
82+ const pythonEnvDir = path . join ( tempDir , '.venv' )
83+ const pythonDetails = await createVirtualEnvironment ( pythonEnvDir )
84+ const custom_materializations = path . join (
85+ REPO_ROOT ,
86+ 'examples' ,
87+ 'custom_materializations' ,
88+ )
89+ const sqlmeshWithExtras = `${ REPO_ROOT } [bigquery]`
90+ await pipInstall ( pythonDetails , [ sqlmeshWithExtras , custom_materializations ] )
91+
92+ try {
93+ // Copy sushi project
94+ await fs . copy ( SUSHI_SOURCE_PATH , tempDir )
95+
96+ // Configure VS Code settings to use our Python environment
97+ const settings = {
98+ 'python.defaultInterpreterPath' : pythonDetails . pythonPath ,
99+ 'sqlmesh.environmentPath' : pythonEnvDir ,
100+ }
101+ await fs . ensureDir ( path . join ( tempDir , '.vscode' ) )
102+ await fs . writeJson (
103+ path . join ( tempDir , '.vscode' , 'settings.json' ) ,
104+ settings ,
105+ { spaces : 2 } ,
106+ )
107+
108+ const { window, close } = await startVSCode ( tempDir )
109+
110+ // Open lineage view
111+ await openLineageView ( window )
112+
113+ await window . waitForTimeout ( 1_000 )
114+
115+ // Assert cannot see the Loading models text
116+ await expect (
117+ window . locator ( 'text=Loading models...' ) ,
118+ ) . not . toBeVisible ( )
119+
120+ await close ( )
121+ } finally {
122+ // Clean up
123+ await fs . remove ( tempDir )
124+ }
125+ } )
0 commit comments