Skip to content

Add seeded test order randomization#3442

Closed
dicnunz wants to merge 1 commit into
avajs:mainfrom
dicnunz:issue-595-randomized-test-order
Closed

Add seeded test order randomization#3442
dicnunz wants to merge 1 commit into
avajs:mainfrom
dicnunz:issue-595-randomized-test-order

Conversation

@dicnunz
Copy link
Copy Markdown

@dicnunz dicnunz commented May 9, 2026

Fixes #595.

IssueHunt bounty: https://issuehunt.io/r/avajs/ava/issues/595

Summary

  • Add --shuffle to randomize test-file order and concurrent test start order within each file using a generated seed.
  • Add --seed=<number> to reproduce a randomized order.
  • Report the seed in the default and TAP reporters.
  • Preserve .serial tests in declaration order before concurrent tests.

Test plan

  • npx test-ava test/randomization/test.js
  • npx test-ava test/scheduler/test.js test/concurrency/test.js
  • npx xo (passes with existing TODO warnings)
  • npx tsc --noEmit
  • git diff --check
  • node --check lib/randomization.js && node --check test/randomization/test.js

IssueHunt Summary

Referenced issues

This pull request has been submitted to:


@sindresorhus
Copy link
Copy Markdown
Member

Closing as this is fully AI-generated spam.

@avajs avajs locked as spam and limited conversation to collaborators May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Randomize test runs

2 participants