Skip to content

chore(vscode): refactor tests#5021

Merged
benfdking merged 1 commit intomainfrom
refactoring_the_context_tests
Jul 25, 2025
Merged

chore(vscode): refactor tests#5021
benfdking merged 1 commit intomainfrom
refactoring_the_context_tests

Conversation

@benfdking
Copy link
Contributor

No description provided.

@benfdking benfdking force-pushed the refactoring_the_context_tests branch from a4884f0 to edbe39a Compare July 25, 2025 11:53
@benfdking benfdking requested a review from Copilot July 25, 2025 12:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors test files to eliminate code duplication by introducing a centralized utility function waitForLoadedSQLMesh to replace repeated inline calls to page.waitForSelector('text=Loaded SQLMesh Context').

  • Extract repeated wait selector logic into a reusable utility function
  • Update all test files to use the new waitForLoadedSQLMesh function
  • Standardize the message text format in the LSP implementation

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.

File Description
vscode/extension/tests/utils.ts Adds new waitForLoadedSQLMesh utility function
sqlmesh/lsp/main.py Standardizes message format and removes folder path parameter
vscode/extension/tests/*.spec.ts Updates 17 test files to use the new utility function

def loaded_sqlmesh_message(ls: LanguageServer) -> None:
ls.show_message(
f"Loaded SQLMesh context from {folder}",
f"Loaded SQLMesh Context",
Copy link

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message text 'Loaded SQLMesh Context' is inconsistent with the test selector pattern 'text=Loaded SQLMesh context' (lowercase 'context'). This will cause test failures as the selector won't match the actual message.

Suggested change
f"Loaded SQLMesh Context",
f"Loaded SQLMesh context",

Copilot uses AI. Check for mistakes.
@benfdking benfdking merged commit c02022e into main Jul 25, 2025
27 checks passed
@benfdking benfdking deleted the refactoring_the_context_tests branch July 25, 2025 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants