Skip to content

Don't perform test-suite-discovery when running specific tests#5891

Merged
DanTup merged 3 commits intomasterfrom
only-discover-suites-for-run-all-tests
Jan 22, 2026
Merged

Don't perform test-suite-discovery when running specific tests#5891
DanTup merged 3 commits intomasterfrom
only-discover-suites-for-run-all-tests

Conversation

@DanTup
Copy link
Member

@DanTup DanTup commented Jan 22, 2026

The change in c32340e to fix "Run All Tests" was also triggering full suite discovery for normal runs of tests. This could make the first test run have a fairly slow startup time.

Fixes #5879

The change in c32340e to fix "Run All Tests" was also triggering full suite discovery for normal runs of tests. This could make the first test run have a fairly slow startup time.

Fixes #5879
@DanTup DanTup added this to the v3.128.0 milestone Jan 22, 2026
@DanTup DanTup added is bug fix in testing Relates to test execution of Dart/Flutter tests for end users labels Jan 22, 2026
@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.40%. Comparing base (378bbd3) to head (f6d47e5).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5891   +/-   ##
=======================================
  Coverage   67.39%   67.40%           
=======================================
  Files         168      168           
  Lines       12907    12908    +1     
  Branches     2557     2558    +1     
=======================================
+ Hits         8699     8700    +1     
  Misses       3754     3754           
  Partials      454      454           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DanTup DanTup requested a review from Copilot January 22, 2026 14:51
@DanTup
Copy link
Member Author

DanTup commented Jan 22, 2026

@codex review

/gemini 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 prevents test suite discovery when running specific tests, which improves performance. The changes are logical and well-tested. I've made one suggestion to improve the clarity of the condition for triggering test discovery. The associated refactoring and test additions are solid.

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

This PR fixes a performance issue where running specific tests would trigger slow discovery of all test suites. The fix ensures that full test-suite discovery only occurs when running all tests (i.e., when request.include is undefined), not when running specific tests.

Changes:

  • Modified runTests to only perform suite discovery when request.include is undefined
  • Added tests to verify discovery behavior for both undefined and empty include arrays
  • Updated interface to make testDiscoverer non-optional and removed redundant discoverer property from testController

Reviewed changes

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

File Description
src/extension/test/vs_test_controller.ts Added conditional check to only run full suite discovery when request.include is undefined (Run All Tests scenario)
src/test/dart/test/test_discovery.test.ts Added two new tests verifying discovery behavior and updated existing test calls to use testDiscoverer directly
src/shared/vscode/interfaces.ts Made testDiscoverer non-optional and removed discoverer property from testController interface

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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 automated review suggestions for this pull request.

Reviewed commit: ba6a5eae45

ℹ️ 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 "@codex address that feedback".

@DanTup DanTup merged commit 22e6f39 into master Jan 22, 2026
20 checks passed
@DanTup DanTup deleted the only-discover-suites-for-run-all-tests branch January 22, 2026 15:57
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 bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

First test run in a session triggers slow discovery of all test suites

2 participants