Group tests under Workspace Folder and Project nodes#5871
Conversation
Previously we put all suites in one huge flat list Fixes #5858
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #5871 +/- ##
==========================================
- Coverage 67.31% 67.30% -0.02%
==========================================
Files 168 168
Lines 12822 12891 +69
Branches 2538 2553 +15
==========================================
+ Hits 8631 8676 +45
- Misses 3743 3762 +19
- Partials 448 453 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Some of this code got messed up by reformatting when there was invalid code.
|
@codex review /gemini review |
There was a problem hiding this comment.
Code Review
This pull request is a great improvement, refactoring the test view from a flat list to a hierarchy based on workspace folders and projects. The implementation looks solid, with a well-designed model introducing WorkspaceFolderNode, ProjectNode, and RunnableTreeNode. The test controller and extension activation logic have been updated accordingly, and the tests themselves have been modified to reflect the new structure. I've found a couple of minor areas for improvement in a test helper function to make it more robust and readable. Overall, excellent work!
There was a problem hiding this comment.
Pull request overview
This pull request reorganizes the test tree structure by introducing workspace folder and project nodes as parents of test suites, replacing the previous flat list. This makes it easier to navigate tests in multi-project and multi-workspace scenarios.
Changes:
- Added WorkspaceFolderNode and ProjectNode classes to create a hierarchical test tree structure
- Updated test helpers to locate suite nodes through the new hierarchy
- Modified all test files' expected results to include the new project/workspace folder parent nodes
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/shared/test/test_model.ts | Added WorkspaceFolderNode, ProjectNode, and RunnableTreeNode classes; implemented hierarchy creation logic |
| src/extension/test/vs_test_controller.ts | Updated node creation/removal to support the new hierarchy; added extractRunnableNodes helper |
| src/extension/extension.ts | Updated TestModel initialization with workspace folder accessor functions |
| src/extension/commands/test.ts | Updated type signatures to use RunnableTreeNode |
| src/test/helpers.ts | Added findSuiteNode helper to navigate the new hierarchy; updated makeTestTextTree to filter workspace/project nodes |
| src/test/test_projects/**/test/*.dart | Updated expected test results to include project names as parent nodes |
| src/test/dart_debug/dart_test.test.ts | Updated test code to use findSuiteNode helper; fixed commented code syntax |
| src/test/flutter_test_debug/debug/flutter_test.test.ts | Updated test code to use findSuiteNode helper |
| src/test/dart/test/test_discovery.test.ts | Updated test expectations to include project node in tree |
| .vscode/launch.json | Renamed launch configuration for clarity |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0686f09104
ℹ️ 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".
Tests pass locally, can't see a reason why we didn't do this.
Previously we put all suites in one huge flat list.
Fixes #5858