test_runner: support test order randomization#61747
test_runner: support test order randomization#61747pmarchini wants to merge 4 commits intonodejs:mainfrom
Conversation
|
Review requested:
|
5556788 to
e6f9a59
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61747 +/- ##
========================================
Coverage 89.75% 89.75%
========================================
Files 674 675 +1
Lines 204416 204828 +412
Branches 39285 39352 +67
========================================
+ Hits 183472 183851 +379
- Misses 13227 13257 +30
- Partials 7717 7720 +3
🚀 New features to boost your workflow:
|
e6f9a59 to
b3b2388
Compare
b3b2388 to
08db017
Compare
2eeb519 to
08db017
Compare
08db017 to
4d626b6
Compare
JakobJingleheimer
left a comment
There was a problem hiding this comment.
🙌
I see I'm late to the party. None of my comments are pressing :)
| ``` | ||
|
|
||
| Using suite-style APIs such as `describe()`/`it()` or `suite()`/`test()` | ||
| still allows randomization, because sibling tests are queued together. |
There was a problem hiding this comment.
nit: I thiiink it should be "enqueued"? "queued" together means they wait together; enqueued together means they're added to a queue one-by-one setting up a sequence.
| @@ -191,6 +198,12 @@ function getRunArgs(path, { forceExit, | |||
| if (rerunFailuresFilePath) { | |||
| ArrayPrototypePush(runArgs, `--test-rerun-failures=${rerunFailuresFilePath}`); | |||
| } | |||
| if (randomize === true) { | |||
There was a problem hiding this comment.
Related to the skip and todo discussion: should this check truthiness rather than strict?
|
I couldn't find the actualCI failure, but Richard did: https://ci.nodejs.org/job/node-test-binary-windows-js-suites/38847/RUN_SUBSET=3,nodes=win11-arm64-COMPILED_BY-vs2022_clang-arm64/testReport/junit/(root)/parallel/test_domain_abort_on_uncaught/ The failure looks legit? |
This PR adds deterministic randomization to the Node.js test runner at both levels:
--test-randomizeenables randomized execution, and--test-random-seed=<seed>replays the same order deterministically (and implicitly enables randomization).When no seed is provided, one is generated and printed in the summary so runs are easy to reproduce.