Skip to content

Commit b0fd08d

Browse files
committed
chore(vscode): enabling more tests
1 parent 245e8c9 commit b0fd08d

File tree

1 file changed

+23
-53
lines changed

1 file changed

+23
-53
lines changed

vscode/extension/tests/lineage.spec.ts

Lines changed: 23 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import {
1919
* Helper function to launch VS Code and test lineage with given project path config
2020
*/
2121
async function testLineageWithProjectPath(page: Page): Promise<void> {
22-
await page.waitForLoadState('networkidle')
23-
await page.waitForLoadState('domcontentloaded')
2422
await openLineageView(page)
2523
await waitForLoadedSQLMesh(page)
2624
}
@@ -37,7 +35,7 @@ test('Lineage panel renders correctly - no project path config (default)', async
3735
await testLineageWithProjectPath(page)
3836
})
3937

40-
test.skip('Lineage panel renders correctly - relative project path', async ({
38+
test('Lineage panel renders correctly - relative project path', async ({
4139
page,
4240
sharedCodeServer,
4341
}) => {
@@ -47,13 +45,9 @@ test.skip('Lineage panel renders correctly - relative project path', async ({
4745
const projectDir = path.join(workspaceDir, 'projects', 'sushi')
4846
await fs.copy(SUSHI_SOURCE_PATH, projectDir)
4947

50-
const context = await startCodeServer({
51-
tempDir: workspaceDir,
52-
})
53-
5448
const settings = {
5549
'sqlmesh.projectPath': './projects/sushi',
56-
'python.defaultInterpreterPath': context.defaultPythonInterpreter,
50+
'python.defaultInterpreterPath': sharedCodeServer.defaultPythonInterpreter,
5751
}
5852
await fs.ensureDir(path.join(workspaceDir, '.vscode'))
5953
await fs.writeJson(
@@ -70,87 +64,63 @@ test.skip('Lineage panel renders correctly - relative project path', async ({
7064
}
7165
})
7266

73-
test.skip('Lineage panel renders correctly - absolute project path', async ({
67+
test('Lineage panel renders correctly - absolute project path', async ({
7468
page,
7569
tempDir,
7670
sharedCodeServer,
7771
}) => {
78-
const workspaceDir = await fs.mkdtemp(
79-
path.join(os.tmpdir(), 'vscode-test-workspace-'),
80-
)
81-
const projectDir = path.join(workspaceDir, 'projects', 'sushi')
82-
await fs.ensureDir(path.join(workspaceDir, '.vscode'))
72+
// Copy the sushi project to temporary directory
73+
const projectDir = path.join(tempDir, 'projects', 'sushi')
74+
await fs.ensureDir(path.join(tempDir, '.vscode'))
8375
await fs.copy(SUSHI_SOURCE_PATH, projectDir)
84-
await fs.ensureDir(path.join(workspaceDir, '.vscode'))
85-
const context = await startCodeServer({
86-
tempDir: workspaceDir,
87-
})
76+
await fs.ensureDir(path.join(tempDir, '.vscode'))
8877

8978
const settings = {
9079
'sqlmesh.projectPath': projectDir,
91-
'python.defaultInterpreterPath': context.defaultPythonInterpreter,
80+
'python.defaultInterpreterPath': sharedCodeServer.defaultPythonInterpreter,
9281
}
93-
await fs.writeJson(
94-
path.join(workspaceDir, '.vscode', 'settings.json'),
95-
settings,
96-
{ spaces: 2 },
97-
)
82+
await fs.writeJson(path.join(tempDir, '.vscode', 'settings.json'), settings, {
83+
spaces: 2,
84+
})
9885

99-
try {
100-
await openServerPage(page, tempDir, sharedCodeServer)
101-
await testLineageWithProjectPath(page)
102-
} finally {
103-
await stopCodeServer(context)
104-
}
86+
await openServerPage(page, tempDir, sharedCodeServer)
87+
await testLineageWithProjectPath(page)
10588
})
10689

107-
test.skip('Lineage panel renders correctly - relative project outside of workspace', async ({
90+
test('Lineage panel renders correctly - relative project outside of workspace', async ({
10891
page,
10992
sharedCodeServer,
11093
tempDir,
11194
}) => {
112-
const tempFolder = await fs.mkdtemp(
113-
path.join(os.tmpdir(), 'vscode-test-workspace-'),
114-
)
115-
const projectDir = path.join(tempFolder, 'projects', 'sushi')
95+
const projectDir = path.join(tempDir, 'projects', 'sushi')
11696
await fs.copy(SUSHI_SOURCE_PATH, projectDir)
11797

118-
const workspaceDir = path.join(tempFolder, 'workspace')
98+
const workspaceDir = path.join(tempDir, 'workspace')
11999
await fs.ensureDir(workspaceDir)
120-
const context = await startCodeServer({
121-
tempDir: workspaceDir,
122-
})
123100

124101
const settings = {
125102
'sqlmesh.projectPath': './../projects/sushi',
126-
'python.defaultInterpreterPath': context.defaultPythonInterpreter,
103+
'python.defaultInterpreterPath': sharedCodeServer.defaultPythonInterpreter,
127104
}
128105
await fs.ensureDir(path.join(workspaceDir, '.vscode'))
129106
await fs.writeJson(
130107
path.join(workspaceDir, '.vscode', 'settings.json'),
131108
settings,
132109
{ spaces: 2 },
133110
)
134-
135-
try {
136-
await openServerPage(page, tempDir, sharedCodeServer)
137-
await testLineageWithProjectPath(page)
138-
} finally {
139-
await stopCodeServer(context)
140-
}
111+
await openServerPage(page, workspaceDir, sharedCodeServer)
112+
await testLineageWithProjectPath(page)
141113
})
142114

143-
test.skip('Lineage panel renders correctly - absolute path project outside of workspace', async ({
115+
test('Lineage panel renders correctly - absolute path project outside of workspace', async ({
144116
page,
145117
sharedCodeServer,
118+
tempDir,
146119
}) => {
147-
const tempFolder = await fs.mkdtemp(
148-
path.join(os.tmpdir(), 'vscode-test-workspace-'),
149-
)
150-
const projectDir = path.join(tempFolder, 'projects', 'sushi')
120+
const projectDir = path.join(tempDir, 'projects', 'sushi')
151121
await fs.copy(SUSHI_SOURCE_PATH, projectDir)
152122

153-
const workspaceDir = path.join(tempFolder, 'workspace')
123+
const workspaceDir = path.join(tempDir, 'workspace')
154124
await fs.ensureDir(workspaceDir)
155125

156126
const settings = {

0 commit comments

Comments
 (0)