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
5 changes: 2 additions & 3 deletions vscode/extension/tests/broken_project.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import path from 'path'
import {
openLineageView,
openServerPage,
runCommand,
openProblemsView,
saveFile,
SUSHI_SOURCE_PATH,
} from './utils'
Expand Down Expand Up @@ -277,8 +277,7 @@ test('bad model block, then fixed', async ({ page, sharedCodeServer }) => {
// Wait for the error to appear
await page.waitForSelector('text=Error creating context')

// Open the problems view
await runCommand(page, 'View: Focus Problems')
await openProblemsView(page)

// Assert error is present in the problems view
const errorElement = page
Expand Down
26 changes: 9 additions & 17 deletions vscode/extension/tests/diagnostics.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from './fixtures'
import path from 'path'
import fs from 'fs-extra'
import os from 'os'
import { openServerPage, runCommand, SUSHI_SOURCE_PATH } from './utils'
import { openProblemsView, openServerPage, SUSHI_SOURCE_PATH } from './utils'
import { createPythonInterpreterSettingsSpecifier } from './utils_code_server'
import { execAsync } from '../src/utilities/exec'
import yaml from 'yaml'
Expand Down Expand Up @@ -36,8 +36,7 @@ test('Workspace diagnostics show up in the diagnostics panel', async ({
.locator('a')
.click()

// Open problems panel
await runCommand(page, 'View: Focus Problems')
await openProblemsView(page)

await page.waitForSelector('text=problems')
await page.waitForSelector('text=All models should have an owner')
Expand Down Expand Up @@ -82,8 +81,7 @@ test.describe('Bad config.py/config.yaml file issues', () => {
// Wait for the error to appear
await page.waitForSelector('text=Error creating context')

// Open the problems view
await runCommand(page, 'View: Focus Problems')
await openProblemsView(page)

// Asser that the error is present in the problems view
await page
Expand Down Expand Up @@ -125,8 +123,7 @@ test.describe('Bad config.py/config.yaml file issues', () => {
// Wait for the error to appear
await page.waitForSelector('text=Error creating context')

// Open the problems view
await runCommand(page, 'View: Focus Problems')
await openProblemsView(page)

// Asser that the error is present in the problems view
await page
Expand Down Expand Up @@ -164,8 +161,7 @@ test.describe('Bad config.py/config.yaml file issues', () => {
// Expect the error to appear
await page.waitForSelector('text=Error creating context')

// Open the problems view
await runCommand(page, 'View: Focus Problems')
await openProblemsView(page)

// Assert that the error is present in the problems view
const errorElement = page
Expand Down Expand Up @@ -200,8 +196,7 @@ test.describe('Bad config.py/config.yaml file issues', () => {
// Expect the error to appear
await page.waitForSelector('text=Error creating context')

// Open the problems view
await runCommand(page, 'View: Focus Problems')
await openProblemsView(page)

// Assert that the error is present in the problems view
const errorElement = page.getByText('Failed to load config file:').first()
Expand Down Expand Up @@ -242,8 +237,7 @@ test.describe('Diagnostics for bad SQLMesh models', () => {
// Wait for the error to appear
await page.waitForSelector('text=Error creating context')

// Open the problems view
await runCommand(page, 'View: Focus Problems')
await openProblemsView(page)

// Asser that the error is present in the problems view
await page
Expand Down Expand Up @@ -284,8 +278,7 @@ test.describe('Diagnostics for bad SQLMesh models', () => {
// Wait for the error to appear
await page.waitForSelector('text=Error creating context')

// Open the problems view
await runCommand(page, 'View: Focus Problems')
await openProblemsView(page)

// Assert error is present in the problems view
const errorElement = page
Expand Down Expand Up @@ -331,8 +324,7 @@ test.describe('Diagnostics for bad audits', () => {
// Wait for the error to appear
await page.waitForSelector('text=Error creating context')

// Open the problems view
await runCommand(page, 'View: Focus Problems')
await openProblemsView(page)

// Assert that the error is present in the problems view
const errorElement = page
Expand Down
6 changes: 6 additions & 0 deletions vscode/extension/tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ export const pipInstall = async (
export const openLineageView = async (page: Page) =>
await runCommand(page, 'Lineage: Focus On View')

/**
* Open the problems/diagnostics view in the given window.
*/
export const openProblemsView = async (page: Page) =>
await runCommand(page, 'View: Focus Problems')

/**
* Restart the SQLMesh servers
*/
Expand Down