-
-
Notifications
You must be signed in to change notification settings - Fork 12
feat: re-run on demand in watch mode. #475
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. |
bad79e9
to
7b0ecd8
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 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
Rstest
class 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.
|
||
// delete | ||
cli.resetStd(); | ||
fs.delete('./fixtures-test-0/bar.test.ts'); | ||
await cli.waitForStdout('Duration'); | ||
expect(cli.stdout).toMatch('No test files are re-run.'); |
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.
can we log removed files?
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.
it only will log when DEBUG is enabled, i think it's okay to preserve for test and debug.
111cbb9
to
acb1f7b
Compare
Summary
Rerun test files on demand, with following major modification:
Related Links
Checklist