@@ -8,80 +8,83 @@ import {
88import { test , expect } from './fixtures'
99import { createPythonInterpreterSettingsSpecifier } from './utils_code_server'
1010
11- test ( 'noselectstar quickfix' , async ( { page, sharedCodeServer, tempDir } ) => {
12- await fs . copy ( SUSHI_SOURCE_PATH , tempDir )
13- await createPythonInterpreterSettingsSpecifier ( tempDir )
11+ test . fixme (
12+ 'noselectstar quickfix' ,
13+ async ( { page, sharedCodeServer, tempDir } ) => {
14+ await fs . copy ( SUSHI_SOURCE_PATH , tempDir )
15+ await createPythonInterpreterSettingsSpecifier ( tempDir )
1416
15- // Override the settings for the linter
16- const configPath = path . join ( tempDir , 'config.py' )
17- const read = await fs . readFile ( configPath , 'utf8' )
18- // Replace linter to be on
19- const target = 'enabled=True'
20- const replaced = read . replace ( 'enabled=False' , 'enabled=True' )
21- // Assert replaced correctly
22- expect ( replaced ) . toContain ( target )
17+ // Override the settings for the linter
18+ const configPath = path . join ( tempDir , 'config.py' )
19+ const read = await fs . readFile ( configPath , 'utf8' )
20+ // Replace linter to be on
21+ const target = 'enabled=True'
22+ const replaced = read . replace ( 'enabled=False' , 'enabled=True' )
23+ // Assert replaced correctly
24+ expect ( replaced ) . toContain ( target )
2325
24- // Replace the rules to only have noselectstar
25- const targetRules = `rules=[
26+ // Replace the rules to only have noselectstar
27+ const targetRules = `rules=[
2628 "noselectstar",
2729 ],`
28- const replacedTheOtherRules = replaced . replace (
29- `rules=[
30+ const replacedTheOtherRules = replaced . replace (
31+ `rules=[
3032 "ambiguousorinvalidcolumn",
3133 "invalidselectstarexpansion",
3234 "noselectstar",
3335 "nomissingaudits",
3436 "nomissingowner",
3537 "nomissingexternalmodels",
3638 ],` ,
37- targetRules ,
38- )
39- expect ( replacedTheOtherRules ) . toContain ( targetRules )
39+ targetRules ,
40+ )
41+ expect ( replacedTheOtherRules ) . toContain ( targetRules )
4042
41- await fs . writeFile ( configPath , replacedTheOtherRules )
42- // Replace the file to cause the error
43- const modelPath = path . join ( tempDir , 'models' , 'latest_order.sql' )
44- const readModel = await fs . readFile ( modelPath , 'utf8' )
45- // Replace the specific select with the select star
46- const modelReplaced = readModel . replace (
47- 'SELECT id, customer_id, start_ts, end_ts, event_date' ,
48- 'SELECT *' ,
49- )
50- await fs . writeFile ( modelPath , modelReplaced )
43+ await fs . writeFile ( configPath , replacedTheOtherRules )
44+ // Replace the file to cause the error
45+ const modelPath = path . join ( tempDir , 'models' , 'latest_order.sql' )
46+ const readModel = await fs . readFile ( modelPath , 'utf8' )
47+ // Replace the specific select with the select star
48+ const modelReplaced = readModel . replace (
49+ 'SELECT id, customer_id, start_ts, end_ts, event_date' ,
50+ 'SELECT *' ,
51+ )
52+ await fs . writeFile ( modelPath , modelReplaced )
5153
52- // Open the code server with the specified directory
53- await page . goto (
54- `http://127.0.0.1:${ sharedCodeServer . codeServerPort } /?folder=${ tempDir } ` ,
55- )
56- await page . waitForLoadState ( 'networkidle' )
54+ // Open the code server with the specified directory
55+ await page . goto (
56+ `http://127.0.0.1:${ sharedCodeServer . codeServerPort } /?folder=${ tempDir } ` ,
57+ )
58+ await page . waitForLoadState ( 'networkidle' )
5759
58- // Open the file with the linter issue
59- await page
60- . getByRole ( 'treeitem' , { name : 'models' , exact : true } )
61- . locator ( 'a' )
62- . click ( )
63- await page
64- . getByRole ( 'treeitem' , { name : 'latest_order.sql' , exact : true } )
65- . locator ( 'a' )
66- . click ( )
60+ // Open the file with the linter issue
61+ await page
62+ . getByRole ( 'treeitem' , { name : 'models' , exact : true } )
63+ . locator ( 'a' )
64+ . click ( )
65+ await page
66+ . getByRole ( 'treeitem' , { name : 'latest_order.sql' , exact : true } )
67+ . locator ( 'a' )
68+ . click ( )
6769
68- await waitForLoadedSQLMesh ( page )
70+ await waitForLoadedSQLMesh ( page )
6971
70- await openProblemsView ( page )
72+ await openProblemsView ( page )
7173
72- await page . getByRole ( 'button' , { name : 'Show fixes' } ) . click ( )
73- await page
74- . getByRole ( 'menuitem' , { name : 'Replace SELECT * with' } )
75- . first ( )
76- . click ( )
74+ await page . getByRole ( 'button' , { name : 'Show fixes' } ) . click ( )
75+ await page
76+ . getByRole ( 'menuitem' , { name : 'Replace SELECT * with' } )
77+ . first ( )
78+ . click ( )
7779
78- // Wait for the quick fix to be applied
79- await page . waitForTimeout ( 2_000 )
80+ // Wait for the quick fix to be applied
81+ await page . waitForTimeout ( 2_000 )
8082
81- // Assert that the model no longer contains SELECT * but SELECT id, customer_id, waiter_id, start_ts, end_ts, event_date
82- const readUpdatedFile = ( await fs . readFile ( modelPath ) ) . toString ( 'utf8' )
83- expect ( readUpdatedFile ) . not . toContain ( 'SELECT *' )
84- expect ( readUpdatedFile ) . toContain (
85- 'SELECT id, customer_id, waiter_id, start_ts, end_ts, event_date' ,
86- )
87- } )
83+ // Assert that the model no longer contains SELECT * but SELECT id, customer_id, waiter_id, start_ts, end_ts, event_date
84+ const readUpdatedFile = ( await fs . readFile ( modelPath ) ) . toString ( 'utf8' )
85+ expect ( readUpdatedFile ) . not . toContain ( 'SELECT *' )
86+ expect ( readUpdatedFile ) . toContain (
87+ 'SELECT id, customer_id, waiter_id, start_ts, end_ts, event_date' ,
88+ )
89+ } ,
90+ )
0 commit comments