-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix: log seed when only sequence.shuffle.tests is enabled
#9576
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
base: main
Are you sure you want to change the base?
fix: log seed when only sequence.shuffle.tests is enabled
#9576
Conversation
Previously, the seed was only logged when RandomSequencer was used (i.e., when files were shuffled). This fix ensures the seed is also set and logged when only test shuffling is enabled, since the seed is used for shuffling tests within files. Fixes vitest-dev#9557
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.
Thank you for your contribution. We should add a test confirming the seed is shown. You can see examples in test/cli. Prefer runInlineTests
| @@ -0,0 +1,11 @@ | |||
| --- | |||
| "vitest": patch | |||
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.
We don’t use changeset, this file can be deleted
- Test that seed is logged when only shuffle.tests is enabled - Test that seed is logged when shuffle is true - Test that seed is NOT logged when shuffle is disabled
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Added tests using
Ready for re-review! |
You missed the review comments regarding |
|
Removed the changeset file - apologies for missing that inline comment! |
Summary
This PR fixes #9557 where the seed is not logged when only
sequence.shuffle.testsis enabled.The Problem
When using the config:
The seed was not being logged, even though it's used to shuffle tests within files.
The Fix
Two changes:
resolveConfig.ts: Set the seed when either files OR tests are shuffledlogger.ts: Log the seed when either files (RandomSequencer) or tests are shuffledRoot Cause
The original code only checked if
RandomSequencerwas being used, butRandomSequenceris only set whenshuffle.filesis true. When onlyshuffle.testsis true,BaseSequenceris used but the seed is still needed for shuffling tests.Testing
random.test.tstest was already flaky before this change (unrelated issue)