Skip to content

Conversation

@DanTup
Copy link
Member

@DanTup DanTup commented Sep 11, 2025

The vs.workspace.onDidXXX events only fire for changes in the VS Code UI so we don't detect test changes made externally. This changes to use the watcher instead.

Fixes #5693

The `vs.workspace.onDidXXX` events only fire for changes in the VS Code UI so we don't detect test changes made externally. This changes to use the watcher instead.

Fixes #5693
@DanTup DanTup added this to the v3.120.0 milestone Sep 11, 2025
@DanTup DanTup added is enhancement in testing Relates to test execution of Dart/Flutter tests for end users labels Sep 11, 2025
@DanTup DanTup requested a review from Copilot September 11, 2025 14:27
Copy link

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

Replaces VS Code workspace events with a file system watcher to detect test file changes made outside of the VS Code UI. This ensures test discovery captures modifications like file creation, deletion, and renaming that occur through external editors or filesystem operations.

  • Replaced vs.workspace.onDidXXX events with vs.workspace.createFileSystemWatcher
  • Added test cases to verify file creation, deletion, and renaming behavior
  • Simplified file handling logic by removing rename event processing

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/test/dart/test/test_discovery.test.ts Added comprehensive test cases for filesystem operations including create/delete and rename scenarios
src/extension/lsp/test_discoverer.ts Replaced workspace events with file system watcher for external change detection

@DanTup
Copy link
Member Author

DanTup commented Sep 11, 2025

/gemini review
@codex review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly replaces the use of vs.workspace.onDid... events with a FileSystemWatcher for test discovery, which will allow detecting file changes made outside of the VS Code UI. The implementation is clean, handling file creation, deletion, and renames appropriately. The new tests are comprehensive and correctly verify the new functionality using direct file system operations. The changes look solid and ready to merge.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

@DanTup DanTup merged commit 99f4545 into master Sep 11, 2025
15 checks passed
@DanTup DanTup deleted the use-watcher-for-test-updates branch September 11, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in testing Relates to test execution of Dart/Flutter tests for end users is enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New/renamed/deleted unit test files created externally do not update the Test Runner

2 participants