fix: fix per-project sequence config#10659
Merged
Merged
Conversation
The `sequence` block was serialized to workers from the root config only, so per-project `concurrent`, `hooks`, `setupFiles`, and (test-level) `shuffle` were silently ignored. Serialize these from the project config. `seed` stays root-only since it anchors cross-project file ordering. Also fix the `ProjectConfig` type typo (`sequencer` -> `sequence`) so `sequence.seed`/`sequence.sequencer` are correctly hidden on projects, and narrow project `shuffle` to drop the root-only `files` option. Fixes vitest-dev#9645 Co-authored-by: OpenCode (claude-opus-4-8) <noreply@opencode.ai>
Replace the serialized-config assertion with a runtime e2e test that runs two projects with different `sequence.concurrent` values and asserts the fixtures (which self-assert `task.concurrent` and completion order) pass. Co-authored-by: OpenCode (claude-opus-4-8) <noreply@opencode.ai>
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Drop the helper and the per-project `sequencer` check (projects cannot set `sequencer`); only test-level `shuffle` is per project. Co-authored-by: OpenCode (claude-opus-4-8) <noreply@opencode.ai>
Per-project `sequence.shuffle` is now honored at runtime, but `sequence.seed` is resolved from the root config only. If the root config doesn't shuffle, its seed stays undefined, so a project that shuffles its tests would run unseeded and non-reproducibly. Default the shared root seed once when any project shuffles. Also restore a serialized-config test asserting per-project `hooks`, `setupFiles`, and `shuffle` while `seed` stays the shared root value, plus the seed-is-defined-when-a-project-shuffles case. Co-authored-by: OpenCode (claude-opus-4-8) <noreply@opencode.ai>
sequence optionssequence config
Resolve `sequence.seed` unconditionally in `resolveConfig`, consistent with the sibling `groupOrder`/`hooks` defaults. This removes the need for the post-resolution cross-project fixup: a shared root seed always exists, so per-project `sequence.shuffle` is reproducible without special-casing whether the root config itself shuffles. `getSeed()` now always returns the seed (number) rather than null when nothing shuffles; the seed is unused unless tests run at random. Co-authored-by: OpenCode (claude-opus-4-8) <noreply@opencode.ai>
Fold the serialized-config assertion into configureVitest.test.ts (reusing its createVitest helper) instead of a standalone file, and drop the shared-seed test. Co-authored-by: OpenCode (claude-opus-4-8) <noreply@opencode.ai>
hi-ogawa
commented
Jun 25, 2026
| if (resolved.sequence.sequencer === RandomSequencer || resolved.sequence.shuffle) { | ||
| resolved.sequence.seed ??= Date.now() | ||
| } | ||
| resolved.sequence.seed ??= Date.now() |
Collaborator
Author
There was a problem hiding this comment.
I simplified this and getSeed since I wasn't sure if leaving seed undefined is intended from the context of:
If we want to keep getSeed returning null, we can keep revert this and seed fixup seed can happen later during resolveProjects, so let me know.
Collaborator
Author
There was a problem hiding this comment.
Actually we can keep the semantics of getSeed while ensuring seed number at resolved config level. See changes in getSeed.
Add a runInlineTests case (with a real config file, required for `extends`) asserting a bare inline project does not inherit the root `sequence` (uses defaults) while `extends: true` does, and that `seed` is shared from the root either way. Co-authored-by: OpenCode (claude-opus-4-8) <noreply@opencode.ai>
Move the per-project sequence serialization test out of configureVitest.test.ts and the inheritance test out of sequence-shuffle.test.ts into a single runInlineTests case under config/sequence.test.ts. One root config + three projects covers project override, non-inheritance for bare inline projects, inheritance via `extends: true`, and the shared root seed. Co-authored-by: OpenCode (claude-opus-4-8) <noreply@opencode.ai>
runInlineTests serializes an object value to the config file, so pass the config as a typed object instead of a template string. This type-checks the `extends` usage and the narrowed project `sequence` shape. Co-authored-by: OpenCode (claude-opus-4-8) <noreply@opencode.ai>
Keep `sequence.seed` resolved unconditionally at the root, but restore `getSeed(): number | null` returning null unless files or tests run at random (in the root config or any project). This keeps the documented "seed iff random" semantics (vitest-dev#8592, vitest-dev#9576) while sharing one seed across projects. The logger banner now reuses `getSeed()` instead of duplicating the check. Co-authored-by: OpenCode (claude-opus-4-8) <noreply@opencode.ai>
Verify the seed banner prints when only a project (not the root config) shuffles its tests, exercising getSeed's per-project randomization check. Co-authored-by: OpenCode (claude-opus-4-8) <noreply@opencode.ai>
Co-authored-by: OpenCode (claude-opus-4-8) <noreply@opencode.ai>
sheremet-va
approved these changes
Jun 25, 2026
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.
Description
The current intent of per-project
sequenceconfig appears to beOmit<SequenceOptions, 'sequencer' | 'seed'>i.e.sequence.sequencerandsequence.seedare root only. This intent is broken both in typeProjectConfigand runtime. This PR fixes both.As one exception not covered by doc,
sequence.shuffle.filesis a root config concept, so it's clarified in doc and excluded fromProjectConfigtype.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.