Repository navigation
fix(sequence): stabilize file shuffle (fix #11340) - #11345
Closed
EnginKARATAS wants to merge 2 commits into
Closed
EnginKARATAS wants to merge 2 commits into
EnginKARATAS wants to merge 2 commits into
Conversation
✅ 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
|
hello |
| public async sort(files: TestSpecification[]): Promise<TestSpecification[]> { | ||
| const { sequence } = this.ctx.config | ||
|
|
||
| files.sort((a, b) => a.moduleId.localeCompare(b.moduleId) || a.taskId.localeCompare(b.taskId)) |
There was a problem hiding this comment.
localeCompare sorts by host locale, so Czech puts chunk after config and Danish puts aa last. With aa, chunk and config test files, seed 101 shuffles into three different orders under en_US, cs_CZ and da_DK.
Member
|
#11350 has a more robust implementation |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
PR title
fix(sequence): stabilize file shuffle (fix #11340)
PR body
Description
Resolves #11340
Sort file specifications by module ID, with task ID as a tie breaker, before applying the seeded shuffle. The same files and seed now produce the same order even when file discovery order differs.
The new regression test failed on upstream main and passes with this change. The existing fixed-seed expectation was updated for the canonical input order.
AI assistance: Codex prepared the code and this draft. Please review the change yourself before opening the PR, as Vitest requires a real person to submit it.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
Documentation
Changesets