Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
bad79e9 to
7b0ecd8
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements on-demand test re-running in watch mode by tracking build chunk changes and only running affected test files. It introduces a new Rstest class to replace the previous context approach and maintains persistent test results for partial updates.
- Introduces a new
Rstestclass that maintains persistent test state and reporter results - Implements chunk-based change detection to identify affected test files in watch mode
- Adds filtering capabilities to reporters to show results only for re-run tests
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/types/worker.ts | Adds chunks field to EntryInfo type for tracking build chunks |
| packages/core/src/types/reporter.ts | Adds optional filterRerunTestPaths parameter to reporter interface and updates import path |
| packages/core/src/runtime/api/poll.ts | Removes biome-ignore comment for lint rule |
| packages/core/src/reporter/summary.ts | Updates error log filtering to respect filterRerunTestPaths parameter |
| packages/core/src/reporter/index.ts | Passes through filterRerunTestPaths to summary error logging |
| packages/core/src/reporter/githubActions.ts | Adds filterRerunTestPaths parameter to interface (unused) |
| packages/core/src/core/runTests.ts | Updates to use new Rstest class and implements on-demand test running logic |
| packages/core/src/core/rstest.ts | New class replacing context pattern with persistent state management |
| packages/core/src/core/rsbuild.ts | Implements chunk change detection and affected entry calculation |
| packages/core/src/core/index.ts | Updates to instantiate Rstest class instead of using context function |
| packages/core/src/core/context.ts | Removes old context creation logic (replaced by Rstest class) |
| e2e/watch/shortcuts.test.ts | Updates tests to verify new debug logging behavior |
| e2e/watch/index.test.ts | Updates tests to verify re-run detection and logging |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
9aoy
reviewed
Aug 21, 2025
| cli.resetStd(); | ||
| fs.delete('./fixtures-test-0/bar.test.ts'); | ||
| await cli.waitForStdout('Duration'); | ||
| expect(cli.stdout).toMatch('No test files are re-run.'); |
Member
Author
There was a problem hiding this comment.
it only will log when DEBUG is enabled, i think it's okay to preserve for test and debug.
111cbb9 to
acb1f7b
Compare
9aoy
approved these changes
Aug 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rerun test files on demand, with following major modification:
Related Links
Checklist