Skip to content

Conversation

@claneo
Copy link
Contributor

@claneo claneo commented Dec 5, 2025

depends on #720

New Features

  1. Better test list view
    1. Display test items in a tree structure instead of the previous flat list
    2. Hide the workspace node if there's only one workspace open
    3. Hide the project node if there's only one project and it is placed at the root of the workspace
  2. Spawn a separate worker every time the test is run
    1. Support debugging tests by starting the worker with the --inspect-wait argument
    2. Support test run cancellation by killing the worker
  3. Support running tests with coverage
  4. Use the capabilities of rstest itself to execute multiple test files in parallel
  5. The test files scan result is exactly the same as rstest. Now the extension reads include/exclude from the config file, scans with tinyglobby, then watches changes with the VSCode watcher, and filters files with picomatch
20251205-202829.mp4

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link

netlify bot commented Dec 5, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 020f3fe
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/693f95aba7be510008fc15ff
😎 Deploy Preview https://deploy-preview-738--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@claneo claneo changed the title feat(vscode): debug, coverage, cancel, include/exclude, tree feat(vscode): support run tests with debug or coverage, list test items in tree structure Dec 9, 2025
@claneo claneo force-pushed the vscode-tree branch 2 times, most recently from ac0bf83 to b20757d Compare December 9, 2025 16:42
@claneo claneo marked this pull request as ready for review December 9, 2025 17:45
Copilot AI review requested due to automatic review settings December 9, 2025 17:45
Copy link
Contributor

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

Copy link
Member

@fi3ework fi3ework left a 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.

@fi3ework
Copy link
Member

fi3ework commented Dec 15, 2025

cc @9aoy , coverage reporter now can accept an instance, i think it's nice to have that. PTAL.

@9aoy
Copy link
Contributor

9aoy commented Dec 15, 2025

👏

@9aoy 9aoy merged commit c224372 into web-infra-dev:main Dec 15, 2025
16 checks passed
@claneo claneo deleted the vscode-tree branch December 15, 2025 12:59
@9aoy 9aoy mentioned this pull request Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants