Skip to content

Add an experimental flag for custom test tracking - #5727

Merged
DanTup merged 5 commits into
masterfrom
add-experimental-test-tracking
Sep 29, 2025
Merged

DanTup merged 5 commits into
masterfrom
add-experimental-test-tracking

Conversation

@DanTup

@DanTup DanTup commented Sep 25, 2025

Copy link
Copy Markdown
Member

See #5668

@DanTup DanTup added this to the v3.120.0 milestone Sep 25, 2025
@DanTup DanTup added is enhancement An enhancement or improvement that should be listed in release notes but is not a bug fix. in testing Relates to test execution of Dart/Flutter tests for end users labels Sep 25, 2025
@DanTup
DanTup requested a review from Copilot September 25, 2025 17:12

Copilot AI left a comment

Copy link
Copy Markdown

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 adds an experimental flag experimentalTestTracking to enable custom test tracking functionality that updates test locations as documents change. This addresses issue #5668 by implementing a mechanism to track test ranges and update them automatically when users edit files.

  • Adds a new configuration option experimentalTestTracking
  • Implements range tracking for test nodes when the experimental flag is enabled
  • Updates test location handling in the VS Code test controller based on the flag
  • Enables a previously skipped test that verifies the test tracking functionality

Reviewed Changes

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

Show a summary per file
File Description
src/extension/config.ts Adds the new experimentalTestTracking configuration property
src/shared/test/test_model.ts Implements range tracking logic for test nodes when experimental flag is enabled
src/shared/vscode/trackers.ts Adds trackRangeForUri method to support tracking ranges by URI
src/extension/test/vs_test_controller.ts Updates test location handling based on experimental flag
src/test/dart_debug/dart_test.test.ts Enables previously skipped test and sets experimental flag

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/shared/test/test_model.ts Outdated
Comment thread src/shared/test/test_model.ts
Comment thread src/shared/vscode/trackers.ts
@DanTup

DanTup commented Sep 25, 2025

Copy link
Copy Markdown
Member Author

@codex review

@DanTup

DanTup commented Sep 25, 2025

Copy link
Copy Markdown
Member Author

/gemini review

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

Copy link
Copy Markdown

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 introduces an experimental flag, dart.experimentalTestTracking, to improve test tracking for dynamically discovered tests, such as those using pkg:test_reflective_loader. The changes involve adding the configuration setting, updating the test model to track test ranges when the flag is enabled, and modifying the VS Code test controller to use this information. The implementation looks solid, but I've identified a couple of potential memory leaks related to the new range trackers not being disposed of correctly. Additionally, the documentation for the new setting might be slightly misleading regarding restarts. My review includes suggestions to address these points.

Comment thread src/shared/test/test_model.ts
Comment thread package.json Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

ℹ️ 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
  • 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

@DanTup
DanTup force-pushed the add-experimental-test-tracking branch from cc3bded to ccbcfd1 Compare September 29, 2025 09:19
@DanTup
DanTup merged commit 8f40924 into master Sep 29, 2025
17 checks passed
@DanTup
DanTup deleted the add-experimental-test-tracking branch September 29, 2025 10:20
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 An enhancement or improvement that should be listed in release notes but is not a bug fix.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants