@@ -10,8 +10,8 @@ import yaml from 'yaml'
1010test ( 'Workspace diagnostics show up in the diagnostics panel' , async ( {
1111 page,
1212 sharedCodeServer,
13+ tempDir,
1314} ) => {
14- const tempDir = await fs . mkdtemp ( path . join ( os . tmpdir ( ) , 'vscode-test-sushi-' ) )
1515 await fs . copy ( SUSHI_SOURCE_PATH , tempDir )
1616 await createPythonInterpreterSettingsSpecifier ( tempDir )
1717
@@ -55,10 +55,8 @@ test.describe('Bad config.py/config.yaml file issues', () => {
5555 test ( 'sqlmesh init, then corrupted config.yaml, bad yaml' , async ( {
5656 page,
5757 sharedCodeServer,
58+ tempDir,
5859 } ) => {
59- const tempDir = await fs . mkdtemp (
60- path . join ( os . tmpdir ( ) , 'vscode-test-tcloud-' ) ,
61- )
6260 await setup ( tempDir )
6361 await createPythonInterpreterSettingsSpecifier ( tempDir )
6462
@@ -135,10 +133,8 @@ test.describe('Bad config.py/config.yaml file issues', () => {
135133 test ( 'sushi example, correct python, bad config' , async ( {
136134 page,
137135 sharedCodeServer,
136+ tempDir,
138137 } ) => {
139- const tempDir = await fs . mkdtemp (
140- path . join ( os . tmpdir ( ) , 'vscode-test-tcloud-' ) ,
141- )
142138 await fs . copy ( SUSHI_SOURCE_PATH , tempDir )
143139 await createPythonInterpreterSettingsSpecifier ( tempDir )
144140
@@ -170,10 +166,11 @@ test.describe('Bad config.py/config.yaml file issues', () => {
170166 await expect ( errorElement ) . toBeVisible ( { timeout : 5000 } )
171167 } )
172168
173- test ( 'sushi example, bad config.py' , async ( { page, sharedCodeServer } ) => {
174- const tempDir = await fs . mkdtemp (
175- path . join ( os . tmpdir ( ) , 'vscode-test-tcloud-' ) ,
176- )
169+ test ( 'sushi example, bad config.py' , async ( {
170+ page,
171+ sharedCodeServer,
172+ tempDir,
173+ } ) => {
177174 await fs . copy ( SUSHI_SOURCE_PATH , tempDir )
178175 await createPythonInterpreterSettingsSpecifier ( tempDir )
179176
@@ -205,10 +202,7 @@ test.describe('Bad config.py/config.yaml file issues', () => {
205202} )
206203
207204test . describe ( 'Diagnostics for bad SQLMesh models' , ( ) => {
208- test ( 'duplicate model names' , async ( { page, sharedCodeServer } ) => {
209- const tempDir = await fs . mkdtemp (
210- path . join ( os . tmpdir ( ) , 'vscode-test-tcloud-' ) ,
211- )
205+ test ( 'duplicate model names' , async ( { page, sharedCodeServer, tempDir } ) => {
212206 // Copy over the sushi project
213207 await fs . copy ( SUSHI_SOURCE_PATH , tempDir )
214208 await createPythonInterpreterSettingsSpecifier ( tempDir )
@@ -246,10 +240,7 @@ test.describe('Diagnostics for bad SQLMesh models', () => {
246240 . isVisible ( { timeout : 5_000 } )
247241 } )
248242
249- test ( 'bad model block' , async ( { page, sharedCodeServer } ) => {
250- const tempDir = await fs . mkdtemp (
251- path . join ( os . tmpdir ( ) , 'vscode-test-tcloud-' ) ,
252- )
243+ test ( 'bad model block' , async ( { page, sharedCodeServer, tempDir } ) => {
253244 // Copy over the sushi project
254245 await fs . copy ( SUSHI_SOURCE_PATH , tempDir )
255246 await createPythonInterpreterSettingsSpecifier ( tempDir )
@@ -289,11 +280,11 @@ test.describe('Diagnostics for bad SQLMesh models', () => {
289280} )
290281
291282test . describe ( 'Diagnostics for bad audits' , ( ) => {
292- test ( 'bad audit block in audit' , async ( { page , sharedCodeServer } ) => {
293- const tempDir = await fs . mkdtemp (
294- path . join ( os . tmpdir ( ) , 'vscode-test-tcloud-' ) ,
295- )
296-
283+ test ( 'bad audit block in audit' , async ( {
284+ page ,
285+ sharedCodeServer ,
286+ tempDir ,
287+ } ) => {
297288 // Copy over the sushi project
298289 await fs . copy ( SUSHI_SOURCE_PATH , tempDir )
299290 await createPythonInterpreterSettingsSpecifier ( tempDir )
0 commit comments