Repository navigation
Support "Run Test" command on project nodes in test explorer - #5991
Conversation
|
/gemini review |
There was a problem hiding this comment.
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.
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
ProjectNodetest 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.
Fixes #5953