Skip to content

Support "Run Test" command on project nodes in test explorer - #5991

Merged
DanTup merged 1 commit into
masterfrom
run-project-tests
Mar 19, 2026
Merged

DanTup merged 1 commit into
masterfrom
run-project-tests

Conversation

@DanTup

@DanTup DanTup commented Mar 19, 2026

Copy link
Copy Markdown
Member

Fixes #5953

@DanTup DanTup added this to the v3.132.0 milestone Mar 19, 2026
@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 Mar 19, 2026
@DanTup
DanTup requested a review from Copilot March 19, 2026 15:18
@DanTup

DanTup commented Mar 19, 2026

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

The pull request introduces support for running tests directly from project nodes in the test explorer. This is achieved by updating the VsCodeTestController to recognize ProjectNode instances as runnable and modifying the isRunnableNode function to handle them. Comprehensive test cases have been added to test_discovery.test.ts and dart_test.test.ts to validate this new functionality, ensuring that tests can be correctly executed when initiated from a project node. A new helper function, findProjectNode, was also added to facilitate these tests. The changes are well-implemented and adequately tested.

@devin-ai-integration devin-ai-integration 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@codecov

codecov Bot commented Mar 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.62%. Comparing base (4029b89) to head (b19674a).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
src/extension/test/vs_test_controller.ts 60.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5991   +/-   ##
=======================================
  Coverage   67.61%   67.62%           
=======================================
  Files         170      170           
  Lines       12983    12987    +4     
  Branches     2572     2574    +2     
=======================================
+ Hits         8779     8783    +4     
+ Misses       3743     3742    -1     
- Partials      461      462    +1     

☔ 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.

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

Adds support for VS Code’s Test Explorer “Run Test” (and related profiles like debug/coverage where applicable) directly on project/package-level test nodes, addressing Dart-Code issue #5953.

Changes:

  • Tag ProjectNode test items as runnable in the VS Code test controller so run profiles are offered on project/package nodes.
  • Add a new test helper (findProjectNode) to locate project nodes in the VS Code test controller tree.
  • Add coverage to ensure project nodes are tagged runnable and that running via a project node executes only that project’s tests.

Reviewed changes

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

File Description
src/test/helpers.ts Adds findProjectNode() helper for retrieving project-level TestItems in tests.
src/test/dart/test/test_discovery.test.ts Adds a test asserting project nodes are tagged as runnable.
src/test/dart_debug/dart_test.test.ts Adds an integration-style test that runs tests via a project node and verifies only that project’s suite runs.
src/extension/test/vs_test_controller.ts Expands runnable tagging logic to include ProjectNode (and refactors runnable check to isRunnableNode).

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

You can also share your feedback on Copilot code review. Take the survey.

@DanTup
DanTup merged commit 4b7fcdd into master Mar 19, 2026
29 of 30 checks passed
@DanTup
DanTup deleted the run-project-tests branch March 19, 2026 15:27
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.

Add "Run tests" context menu option to package level test nodes

2 participants