feat: add --smart-rerun to prioritize or skip previously failed tests#10684
Open
Thompsonay wants to merge 1 commit into
Open
feat: add --smart-rerun to prioritize or skip previously failed tests#10684Thompsonay wants to merge 1 commit into
Thompsonay wants to merge 1 commit into
Conversation
Adds --smart-rerun, which caches failed test file paths and runs them first on the next invocation, ahead of the rest of the suite. The cache clears automatically once everything passes. Adds --smart-rerun-only-failed (requires --smart-rerun) to skip files that passed last run entirely and only execute previously-failed files, falling back to a full run when the cache is empty or stale. Both flags are off by default and do not change existing behavior. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hello @Thompsonay. Your PR has been labeled To keep your PR open, please follow these steps:
Please, do not generate or format the response with AI. If you do not speak English, reply in your native language or use translation software like Google Translate or Deepl. If the response is generated, the PR will be closed automatically. These measures help us reduce maintenance burden and keep the team's work efficient. See our AI contributions policy for more context. |
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Author
|
I contributed to the open source |
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
--smart-rerun: caches failed test file paths to.vitest-failed-cache.jsonand runs them first on the next invocation, ahead of the rest of the suite. Cache clears automatically once everything passes.--smart-rerun-only-failed(requires--smart-rerun): instead of reordering, skips files that passed last run entirely and only executes previously-failed files. Falls back to a full run if the cache is empty or stale.Test plan
test/unit/test/smart-rerun.test.ts)test/unit/test/cli-test.test.ts)pnpm run buildpasses with no type errorstest/unitsuite passesmainviagit stash)Closes #7834
Related to #10247