Commit 16b2f32
Two regressions introduced during the 3.x → 4.x ESM migration:
## Bug 1 – plugins with runInWorker:false silently skipped in child processes
lib/container.js used options.child to detect "running inside a worker thread"
and skipped plugins whose runInWorker is false (testomatio defaults to false).
But run-multiple also sets --child on every forked child process, so those
plugins were incorrectly skipped there too.
Fix: replace options.child with !isMainThread (worker_threads).
A run-multiple child is a freshly-forked OS process whose isMainThread is true,
so the gate no longer fires. An actual run-workers worker thread has
isMainThread === false, so the gate still fires as intended.
| Context | options.child | isMainThread | before (skipped?) | after |
|---------------------------|---------------|--------------|-------------------|--------|
| run-workers worker thread | truthy (idx) | false | skipped ✓ | skipped ✓ |
| run-multiple child proc | truthy (str) | true | skipped ✗ (bug) | loads ✓ |
| normal run / parent proc | falsy | true | loads ✓ | loads ✓ |
## Bug 2 – all children write to the same reportDir, last one wins
3.x run-multiple.js replaced three per-child directory keys before forking:
output, reportDir, mochaFile
The 4.x port dropped the reportDir line, so every child kept the shared
reportDir value from the config (e.g. "output/report") and overwrote each
other's HTML file.
Fix: restore the missing replaceValueDeep('reportDir', ...) call so each child
receives its own directory, matching 3.x behaviour.
Regression test added: verifies that a plugin with runInWorker:false is
initialised once per child and that each child receives a distinct reportDir.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2c89828 commit 16b2f32
5 files changed
Lines changed: 55 additions & 2 deletions
File tree
- lib
- command
- test
- data/sandbox
- runner
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
731 | 732 | | |
732 | 733 | | |
733 | 734 | | |
734 | | - | |
| 735 | + | |
735 | 736 | | |
736 | 737 | | |
737 | 738 | | |
738 | | - | |
| 739 | + | |
739 | 740 | | |
740 | 741 | | |
741 | 742 | | |
| |||
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
202 | 219 | | |
203 | 220 | | |
204 | 221 | | |
| |||
0 commit comments