Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 9 additions & 23 deletions vscode/extension/tests/lineage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import {
waitForLoadedSQLMesh,
} from './utils'
import { writeFileSync } from 'fs'
import {
createPythonInterpreterSettingsSpecifier,
startCodeServer,
stopCodeServer,
} from './utils_code_server'
import { createPythonInterpreterSettingsSpecifier } from './utils_code_server'

/**
* Helper function to launch VS Code and test lineage with given project path config
Expand Down Expand Up @@ -134,7 +130,7 @@ test('Lineage panel renders correctly - absolute path project outside of workspa
})

// These work on local machine when debuggin but not on CI, so skipping for now
test.skip('Lineage panel renders correctly - multiworkspace setup', async ({
test('Lineage panel renders correctly - multiworkspace setup', async ({
page,
sharedCodeServer,
}) => {
Expand Down Expand Up @@ -177,13 +173,12 @@ test.skip('Lineage panel renders correctly - multiworkspace setup', async ({
{ spaces: 2 },
)

await openServerPage(page, workspaceDir, sharedCodeServer)
await page.waitForSelector('text=Open workspace')
await page.click('text=Open workspace')
await openServerPage(page, workspaceFilePath, sharedCodeServer)
await page.reload()
await testLineageWithProjectPath(page)
})

test.skip('Lineage panel renders correctly - multiworkspace setup reversed', async ({
test('Lineage panel renders correctly - multiworkspace setup reversed', async ({
page,
sharedCodeServer,
}) => {
Expand Down Expand Up @@ -216,12 +211,8 @@ test.skip('Lineage panel renders correctly - multiworkspace setup reversed', asy
}),
)

const context = await startCodeServer({
tempDir: workspaceDir,
})

const settings = {
'python.defaultInterpreterPath': context.defaultPythonInterpreter,
'python.defaultInterpreterPath': sharedCodeServer.defaultPythonInterpreter,
}
await fs.ensureDir(path.join(projectDir1, '.vscode'))
await fs.writeJson(
Expand All @@ -236,12 +227,7 @@ test.skip('Lineage panel renders correctly - multiworkspace setup reversed', asy
{ spaces: 2 },
)

try {
await openServerPage(page, workspaceDir, sharedCodeServer)
await page.waitForSelector('text=Open workspace')
await page.click('text=Open workspace')
await testLineageWithProjectPath(page)
} finally {
await stopCodeServer(context)
}
await openServerPage(page, workspaceFilePath, sharedCodeServer)
await page.reload()
await testLineageWithProjectPath(page)
})
6 changes: 4 additions & 2 deletions vscode/extension/tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,13 @@ export const waitForLoadedSQLMesh = (page: Page) =>
*/
export const openServerPage = async (
page: Page,
tempDir: string,
targetPath: string,
context: CodeServerContext,
) => {
const isWorkspace = targetPath.endsWith('.code-workspace')
const param = isWorkspace ? 'workspace' : 'folder'
await page.goto(
`http://127.0.0.1:${context.codeServerPort}/?folder=${tempDir}`,
`http://127.0.0.1:${context.codeServerPort}/?${param}=${targetPath}`,
)
await page.waitForLoadState('networkidle')
await page.waitForSelector('[role="application"]', { timeout: 10000 })
Expand Down
Loading