Skip to content

Seed is not logged when only sequence.shuffle.tests is enabled #9557

@nstepien

Description

@nstepien

Describe the bug

When running the tests in a random order, the seed will not be logged.

if (this.ctx.config.sequence.sequencer === RandomSequencer) {
this.log(PAD + c.gray(`Running tests with seed "${this.ctx.config.sequence.seed}"`))
}

This does not work:

      sequence: {
        shuffle: {
          tests: true
        }
      }

This works:

      sequence: {
        shuffle: {
          files: true
        }
      }
// or
      sequence: {
        shuffle: true
      }

It's actually been happening for a very long time, probably every since the shuffle.files/shuffle.tests settings were introduced.

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-ahqdjnan?file=vite.config.ts&initialPath=__vitest__/

System Info

System:
    OS: Windows 11 10.0.26200
    CPU: (32) x64 AMD Ryzen 9 9950X3D 16-Core Processor
    Memory: 34.22 GB / 63.58 GB
  Binaries:
    Node: 25.4.0 - C:\Program Files\nodejs\node.EXE
    npm: 11.7.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 144.0.7559.110
    Edge: Chromium (140.0.3485.54)
    Firefox: 147.0 - C:\Program Files\Mozilla Firefox\firefox.exe
  npmPackages:
    @vitejs/plugin-react: ^5.1.2 => 5.1.2
    @vitest/browser-playwright: ^4.0.16 => 4.0.18
    @vitest/coverage-istanbul: ^4.0.16 => 4.0.18
    playwright: ~1.58.0 => 1.58.0
    vite: ^8.0.0-beta.11 => 8.0.0-beta.11
    vitest: ^4.0.17 => 4.0.18
    vitest-browser-react: ^2.0.2 => 2.0.5

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3-minor-bugAn edge case that only affects very specific usage (priority)pr welcome

    Type

    Projects

    Status

    Approved

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions