-
-
Notifications
You must be signed in to change notification settings - Fork 14
feat(vscode): support run tests with debug or coverage, list test items in tree structure #738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
ac0bf83 to
b20757d
Compare
There was a problem hiding this 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 significantly enhances the VSCode extension by adding test debugging and coverage support, improving the test tree visualization, and refactoring the test execution architecture to use separate worker processes for each test run.
Key changes:
- Implements debug and coverage run profiles for tests, enabling developers to debug tests and collect coverage information directly from VS Code
- Restructures the test item tree to hide workspace/project nodes when there's only one, providing a cleaner UI
- Replaces the long-lived worker process with ephemeral workers spawned per test run, enabling test cancellation and better isolation
Reviewed changes
Copilot reviewed 33 out of 35 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Updated dependencies: removed glob package, added tinyglobby and picomatch for file matching, added coverage-istanbul types |
| packages/vscode/tests/suite/workspace.test.ts | Updated test assertions to reflect new tree structure with consolidated folder nodes |
| packages/vscode/tests/suite/progress.test.ts | Simplified test item path and added cancellation token parameter |
| packages/vscode/tests/suite/index.ts | Migrated from callback-based glob to promise-based tinyglobby |
| packages/vscode/tests/suite/index.test.ts | Refactored to use shared toLabelTree helper from helpers.ts |
| packages/vscode/tests/suite/helpers.ts | Enhanced toLabelTree with fileOnly parameter and updated getProjectItems for new structure |
| packages/vscode/tests/suite/config.test.ts | Removed test file (functionality moved to rstest config-based discovery) |
| packages/vscode/src/worker/reporter.ts | Refactored to use birpc event bindings and added CoverageReporter class for VS Code coverage integration |
| packages/vscode/src/worker/logger.ts | Updated to use birpc's asEvent pattern |
| packages/vscode/src/worker/index.ts | Simplified worker initialization to create rstest instance per run instead of maintaining state |
| packages/vscode/src/types.ts | Consolidated types into WorkerInitOptions, removing separate init and run data types |
| packages/vscode/src/testTree.ts | Restructured test item management with separate classes for folders, files, and cases |
| packages/vscode/src/testRunReporter.ts | Added coverage reporting support with onCoverage method and RstestFileCoverage class |
| packages/vscode/src/project.ts | Major refactoring: uses tinyglobby/picomatch for file discovery, implements tree building with folder collapsing |
| packages/vscode/src/master.ts | Creates ephemeral worker per test run, adds debug support with --inspect-wait, implements cancellation via worker termination |
| packages/vscode/src/extension.ts | Updated test run logic to support workspace/project/folder/file/case hierarchy, added deactivate function |
| packages/vscode/src/config.ts | Removed testFileGlobPattern setting (now read from rstest config) |
| packages/vscode/package.json | Updated dependencies and removed testFileGlobPattern configuration option |
| packages/vscode/README.md | Updated configuration table to reflect removed setting |
| packages/coverage-istanbul/tsconfig.json | Enabled declarationMap for better debugging |
| packages/coverage-istanbul/src/provider.ts | Added support for reporter objects (not just names/arrays) |
| packages/coverage-istanbul/rslib.config.ts | Added conditional source map generation |
| packages/coverage-istanbul/package.json | Added SOURCE_MAP environment variable to dev script |
| packages/core/src/types/coverage.ts | Extended reporter types to accept ReportBase objects |
| packages/core/src/pool/index.ts | Cleared reporters array when serializing runtime config to avoid serialization issues |
| packages/core/src/pool/forks.ts | Added SIGTERM handler for graceful worker shutdown |
| packages/core/package.json | Added istanbul-lib-report types |
| packages/core/LICENSE.md | Updated magic-string repository URL |
| e2e/basic/test/meta.test.ts | Updated path expectations to be relative to project root |
| e2e/basic/test/filePath.test.ts | Updated path expectations to be relative to project root |
| e2e/bail/index.test.ts | Fixed test log filtering to be more specific |
| .vscode/tasks.json | Restructured build tasks with proper dependencies and added rslib problem matcher |
| .vscode/launch.json | Updated pre-launch task reference and disabled autoAttachChildProcesses |
| .vscode/extensions/rslib-problem-matcher/package.json | Added custom problem matcher for rslib watch mode |
| .gitignore | Updated to include .vscode/extensions directory |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fi3ework
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, great work, and a huge thanks to @claneo.
|
cc @9aoy , coverage reporter now can accept an instance, i think it's nice to have that. PTAL. |
|
👏 |
depends on #720
New Features
--inspect-waitargumenttinyglobby, then watches changes with the VSCode watcher, and filters files withpicomatch20251205-202829.mp4
Related Links
Checklist