supercov 4.29.5 → 4.29.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/cli.md CHANGED
@@ -542,7 +542,9 @@ phpunit`). See `docs/design/strong-mutation.md`,
542
542
  job's run holds its share's verdicts, `merge` keeps them all in the merged
543
543
  run, and a later `supercov mutants` keeps each verdict nothing changed could
544
544
  move from whichever earlier run holds it (see
545
- [Combine shards](#combine-shards)).
545
+ [Combine shards](#combine-shards)). `supercov mutants --shard` measures a
546
+ run of its own even on an unchanged checkout, so a job never saves into a
547
+ run it restored, which every job of its round holds a copy of.
546
548
  - `--critical <glob>` (repeatable): every mutant there must be killed or
547
549
  accepted, or the command fails.
548
550
  - `--fail-on survived,timeout,no-coverage,error`: fail on any asked mutant with
@@ -1215,8 +1217,11 @@ adds none, and where its tests ran a mutant, a verdict that needs values they
1215
1217
  did not record is `unknown`.
1216
1218
 
1217
1219
  The merged run keeps the strong verdicts the runs saved (`mutants test`,
1218
- `--shard` among them), by mutant, and `merge` prints how many and from which
1219
- runs. A kill in any run is a kill. A survival stands only where the run that
1220
+ `--shard` among them), by mutant, and `merge` prints how many, how many came
1221
+ from each run, and how many the merged run's plan decides without running
1222
+ them (`1265 strong verdict(s) kept from runs r8, r7: 1103 from r8, 150 from
1223
+ r7, 12 the merged run's plan decides`). A verdict two runs hold alike counts
1224
+ for the first run named. A kill in any run is a kill. A survival stands only where the run that
1220
1225
  let the mutant survive measured every test of the merged suite that could
1221
1226
  kill it; where another run's tests could, and it has no verdict, the mutant is
1222
1227
  left for a pass over the merged run to run. An error stands only where no run
@@ -1224,7 +1229,16 @@ holds anything else. A run whose verdicts are of another mutant set than the
1224
1229
  merged run lists lends none, and `merge` names it; a run some of whose tests
1225
1230
  another measured again lends none either. Split a strong pass across jobs this
1226
1231
  way: each job measures and runs `supercov mutants --shard k/n -- <command>`,
1227
- and the last merges (see `docs/mutation.md`, A pass split across jobs).
1232
+ and the last merges (see `docs/mutation.md`, A pass split across jobs). A
1233
+ second round on the same commit restores the first round's runs and does the
1234
+ same: each job measures a run of its own, which keeps the restored runs'
1235
+ verdicts and replaces them, and the last job's `merge` takes the new runs.
1236
+
1237
+ A run named twice is refused (`Each merged run must be unique: r1 is named
1238
+ more than once`): copies of one run that several jobs saved verdicts into
1239
+ share its id, and `.supercov/runs` holds one of them. Up to 4.29.5,
1240
+ `supercov mutants --shard` on a checkout unchanged since the runs it restored
1241
+ saved into the latest of them; run such a round again.
1228
1242
 
1229
1243
  `assertions assess` assesses a merged run across every suite merged into it,
1230
1244
  reusing the answers saved when its parts were assessed. `tests affected` of a
package/docs/mutation.md CHANGED
@@ -104,7 +104,10 @@ summary gives the mutation score, every verdict counted, and ends with the
104
104
  mutants the tests let survive.
105
105
 
106
106
  - **Unchanged checkout.** The next `supercov mutants` reads the same run again
107
- and runs nothing it already decided.
107
+ and runs nothing it already decided. With `--shard` it measures a run of its
108
+ own all the same, as after an edit, so that each job's share is saved into a
109
+ run no other job writes (see
110
+ [A pass split across jobs](#a-pass-split-across-jobs)).
108
111
  - **After an edit.** It measures the checkout again and keeps an earlier
109
112
  verdict for each mutant whose file is as it was and whose candidate tests,
110
113
  and their test files, nothing changed could reach, as `runs latest tests
@@ -248,12 +251,20 @@ and stays the same while that code does.
248
251
 
249
252
  A large application suite's strong pass can be split across machines. Each
250
253
  job measures the whole suite and runs its share of the mutants; a last job
251
- merges the runs, and the merged run holds every job's verdicts:
254
+ merges the runs, and the merged run holds every job's verdicts. A pass whose
255
+ budgets leave mutants undecided goes on in another round, the same workflow run
256
+ again on the same commit, and later commits go on from where the last round
257
+ ended:
252
258
 
253
259
  ```yaml
254
260
  # Each of four jobs (matrix.shard 1 to 4):
255
261
  - uses: actions/cache/restore@v4
256
- with: { path: .supercov/runs, key: "mutants-${{ github.sha }}", restore-keys: "mutants-" }
262
+ with:
263
+ path: .supercov/runs
264
+ key: mutants-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}
265
+ restore-keys: |
266
+ mutants-${{ github.sha }}-
267
+ mutants-
257
268
  - run: npx supercov mutants --shard ${{ matrix.shard }}/4 --budget 2400 -- npm test
258
269
  - uses: actions/upload-artifact@v4
259
270
  with: { name: "mutants-${{ matrix.shard }}", path: .supercov/runs, include-hidden-files: true }
@@ -262,11 +273,16 @@ merges the runs, and the merged run holds every job's verdicts:
262
273
  with: { pattern: "mutants-*", path: .supercov/runs, merge-multiple: true }
263
274
  - run: npx supercov merge
264
275
  - run: npx supercov runs latest mutants --status survived
265
- - run: npx supercov runs clean --keep 5 # the four jobs' runs and their merge
276
+ - run: npx supercov runs clean --keep 5 # this round's four runs and their merge
266
277
  - uses: actions/cache/save@v4
267
- with: { path: .supercov/runs, key: "mutants-${{ github.sha }}" }
278
+ with:
279
+ path: .supercov/runs
280
+ key: mutants-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}
268
281
  ```
269
282
 
283
+ The cache key names the round, so each round saves its own; a round restores
284
+ the latest one saved for its commit, or else the latest one saved.
285
+
270
286
  `supercov mutants --shard k/n -- <command>` is `supercov -- <command>` with
271
287
  the mutants' probes on, then `runs latest mutants test --shard k/n`, keeping
272
288
  earlier verdicts as after an edit. Name the command after `--`: without it,
@@ -294,11 +310,28 @@ merge ([CLI reference](cli.md#combine-shards)).
294
310
  that run has no verdict for it, as a unit run merged with an end-to-end run
295
311
  can, the mutant is left undecided, and a pass over the merged run runs it.
296
312
  Verdicts of another mutant set are not kept, and the merge says whose.
313
+ - **Another round.** On the commit the restored runs measured, each job still
314
+ measures a run of its own: `supercov mutants --shard` never saves into a run
315
+ it restored, of which every job of the round holds a copy. It keeps every
316
+ verdict the restored runs hold (`429 verdict(s) kept from runs r4, r3, r2,
317
+ r1`), and the shares are of what is left. Each job's run replaces the
318
+ restored ones of its command, so the last job's `supercov merge` takes this
319
+ round's runs, whose verdicts hold the earlier rounds'. It says how many
320
+ verdicts came from each run (`1265 strong verdict(s) kept from runs r8, r7,
321
+ r6, r5: 802 from r8, 151 from r7, 160 from r6, 140 from r5, 12 the merged
322
+ run's plan decides`): a verdict two runs hold alike, as every job's copy of
323
+ the earlier rounds' verdicts, counts for the first run named.
297
324
  - **The next pass.** The restored runs lend their verdicts on a later
298
325
  commit: each job keeps every verdict nothing changed could move, from
299
326
  whichever earlier job's run holds it, and the shares are of what is left.
300
327
  Keep the merged run's parts with it: a merged run's `tests affected` is
301
328
  answered from them.
329
+ - **Copies of one run.** Up to 4.29.5, `supercov mutants --shard` on a
330
+ checkout unchanged since the runs it restored saved into the latest of them,
331
+ so every job of a second round wrote its share into a copy of one run. The
332
+ copies share an id, one directory of `.supercov/runs` holds one of them, and
333
+ `supercov merge` refuses a run named more than once, saying so. Run that
334
+ round again: each job now measures a run of its own.
302
335
 
303
336
  ### Runners without a driver
304
337
 
@@ -382,6 +415,16 @@ no mutants shows none of this.
382
415
  as detected; the summary says how many, and against what limit.
383
416
  `--timeout-factor <x>` (or `SUPERCOV_STRONG_TIMEOUT_FACTOR`) changes the
384
417
  1.5: a suite whose tests' times vary widely between runs may want 2 or 3.
418
+ A mutant tries its candidates cheapest to a kill first (a test's time over
419
+ how likely it is to kill: one that infected the mutant counts as four
420
+ times likelier than one that only reached it), and a slow test runs it only
421
+ once its cheaper candidates let it live; a file's tests take one mutant
422
+ each in turn, so mutants are decided one after another rather than all at
423
+ the end. The progress lines name the tests with the most work left (how
424
+ many mutants wait for each, and its time a run) and the time the round
425
+ has left. A candidate in a project others start from (a login `setup`)
426
+ never runs with a mutant: a mutant no other test kills is an `error` that
427
+ says so.
385
428
  - **Jest and Mocha** run in resident runners, as StrykerJS's do; `node:test`,
386
429
  AVA, node-tap, `bun:test` and Vitest Browser Mode run one test file per
387
430
  start of the command, with the mutant on from its start.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supercov",
3
- "version": "4.29.5",
3
+ "version": "4.29.6",
4
4
  "description": "Coverage, security and code quality for coding agents",
5
5
  "keywords": [
6
6
  "coverage",
@@ -125,14 +125,14 @@
125
125
  "test:windows-tls": "node scripts/windows-tls-test.mjs"
126
126
  },
127
127
  "optionalDependencies": {
128
- "@supercov/cli-darwin-arm64": "4.29.5",
129
- "@supercov/cli-darwin-x64": "4.29.5",
130
- "@supercov/cli-linux-arm64-gnu": "4.29.5",
131
- "@supercov/cli-linux-arm64-musl": "4.29.5",
132
- "@supercov/cli-linux-x64-gnu": "4.29.5",
133
- "@supercov/cli-linux-x64-musl": "4.29.5",
134
- "@supercov/cli-win32-arm64": "4.29.5",
135
- "@supercov/cli-win32-x64": "4.29.5"
128
+ "@supercov/cli-darwin-arm64": "4.29.6",
129
+ "@supercov/cli-darwin-x64": "4.29.6",
130
+ "@supercov/cli-linux-arm64-gnu": "4.29.6",
131
+ "@supercov/cli-linux-arm64-musl": "4.29.6",
132
+ "@supercov/cli-linux-x64-gnu": "4.29.6",
133
+ "@supercov/cli-linux-x64-musl": "4.29.6",
134
+ "@supercov/cli-win32-arm64": "4.29.6",
135
+ "@supercov/cli-win32-x64": "4.29.6"
136
136
  },
137
137
  "peerDependencies": {
138
138
  "@playwright/test": ">=1.55.0",
@@ -9,12 +9,23 @@
9
9
  // disk that every worker and every invocation of the pass share. A mutant
10
10
  // goes from candidate to candidate as copies take it, and stops at its first
11
11
  // kill; nothing waits for a stage to end, and no worker restarts for a
12
- // mutant. The first run of a test in each worker is a control, with no
13
- // mutant: the pass's baseline the first time, and after a kill (a failed
14
- // test gives Playwright's next test a new worker) the check that the test
15
- // still passes without the mutant on the same server, which confirms the
16
- // kill. A harness may start several invocations at once, each with a share
17
- // of the tests; they share the pass's files and decide the same way.
12
+ // mutant. A test's first run in each invocation is a control, with no
13
+ // mutant: the pass's baseline the first time; and after a kill, the test's
14
+ // next run is one too, the check that it still passes without the mutant on
15
+ // the same server, which confirms the kill. A harness may start several
16
+ // invocations at once, each with a share of the tests; they share the pass's
17
+ // files and decide the same way.
18
+ //
19
+ // The order (docs/design/strong-mutation.md, "Which candidate first"): a
20
+ // mutant's candidates are ordered cheapest to a kill first (each test's time
21
+ // over how likely it is to kill: those whose own evidence infected it are
22
+ // taken as likelier), so a slow test comes last; a file's copies run in
23
+ // sweeps, the k-th copy of each of its tests in turn, cheapest test first;
24
+ // and a copy takes, of the mutants waiting for its test, the one with the
25
+ // fewest earlier candidates still to try, the one its test infected, and the
26
+ // one closest to a verdict, in that order. So a slow test runs a mutant once
27
+ // its cheaper candidates let it live, and a file's tests finish one mutant
28
+ // before the next rather than one test's mutants before the next test's.
18
29
  //
19
30
  // The attempt's mutant goes into its scope, which reaches the app's server
20
31
  // with every request (header, cookies, child processes) and the page through
@@ -43,6 +54,10 @@ import { basename, dirname, resolve, sep } from "node:path";
43
54
  const TIMEOUT_FACTOR = 1.5;
44
55
  const TIMEOUT_CONSTANT_MS = 5_000;
45
56
  const DEFAULT_DURATION_MS = 1_000;
57
+ // How much likelier to kill a mutant a test is taken to be where its own
58
+ // evidence infected it than where it only reached it: what orders a mutant's
59
+ // candidates, with their times.
60
+ const INFECTED_LIKELIER = 4;
46
61
  const POLL_MS = 50;
47
62
  // Playwright makes every test case of every file it loads before the first
48
63
  // test runs, in the runner: an invocation holds about this many copies, and
@@ -57,6 +72,8 @@ export const PAGE_TIMEOUT_MARKER = "SUPERCOV_MUTANT_TIMEOUT";
57
72
 
58
73
  /** A copy's describe: `[supercov copy <k>]`, k from 1. */
59
74
  const COPY_TITLE = /^\[supercov copy (\d+)\]$/;
75
+ // The most costly tests a status file names.
76
+ const COSTLY_SHOWN = 3;
60
77
  export function copyTitle(copy) {
61
78
  return `[supercov copy ${copy}]`;
62
79
  }
@@ -91,8 +108,15 @@ export function strongPass() {
91
108
  };
92
109
  }
93
110
 
111
+ const keys = new Map();
94
112
  export function key(text) {
95
- return createHash("sha256").update(String(text)).digest("hex").slice(0, 24);
113
+ const said = String(text);
114
+ let found = keys.get(said);
115
+ if (found === undefined) {
116
+ found = createHash("sha256").update(said).digest("hex").slice(0, 24);
117
+ keys.set(said, found);
118
+ }
119
+ return found;
96
120
  }
97
121
 
98
122
  export function writeJson(path, value) {
@@ -147,7 +171,7 @@ export function mark(path) {
147
171
  * and every control of it that passed in this pass, in any worker or round
148
172
  * (a test whose time varies is given its slowest), and a second at least.
149
173
  */
150
- function baselineMsOf(pass, original, test) {
174
+ export function baselineMsOf(pass, original, test) {
151
175
  let longest = Math.max(DEFAULT_DURATION_MS, test.durationMs ?? 0);
152
176
  for (const name of entries(`${pass.shared}/durations/${key(original)}`))
153
177
  longest = Math.max(longest, Number(name.split("-")[1]) || 0);
@@ -155,7 +179,7 @@ function baselineMsOf(pass, original, test) {
155
179
  }
156
180
 
157
181
  /** A mutant attempt's time limit from its test's baseline: StrykerJS's `timeoutMS`. */
158
- function limitOf(baselineMs, factor) {
182
+ export function limitOf(baselineMs, factor) {
159
183
  return Math.ceil(baselineMs * factor + TIMEOUT_CONSTANT_MS);
160
184
  }
161
185
 
@@ -204,7 +228,8 @@ function serialFilesOf(plan, tests, fullyParallel) {
204
228
  /**
205
229
  * The projects others depend on (`dependencies`, `teardown`): their tests,
206
230
  * a login that stores the session others start from, run as they are in
207
- * every invocation, with no mutant, whether or not a mutant needs them.
231
+ * every invocation, with no mutant, whether or not a mutant needs them. A
232
+ * mutant's candidate among them is never run with it.
208
233
  */
209
234
  function setupProjectsOf(config) {
210
235
  const names = new Set();
@@ -223,6 +248,12 @@ function fullyParallelOf(config) {
223
248
  return projects.every((project) => project.fullyParallel ?? config?.fullyParallel ?? false);
224
249
  }
225
250
 
251
+ /** The project others start from that a plan test is in, by its name (`<project> > <file> > ...`). */
252
+ function inSetupProject(test, setupProjects) {
253
+ const name = test.name ?? "";
254
+ return setupProjects.find((project) => project && name.startsWith(`${project} > `));
255
+ }
256
+
226
257
  // A plan test's id as Playwright knows it: a Rust wasm run names a test by
227
258
  // its file too (`<file>::<id>`).
228
259
  function playwrightId(test) {
@@ -253,10 +284,12 @@ function declarationKey(file, title) {
253
284
  /**
254
285
  * The pass's work, worked out in the runner from the plan (or the job the
255
286
  * round runs): each mutant to run with its candidate tests in the order it
256
- * takes them (those whose own evidence infected it first, cheapest first),
257
- * each test's queue of mutants (those it is the likeliest killer of first),
258
- * and how many copies each test needs: one for each mutant that may take it,
259
- * one more for each control a kill may call for, and the first control.
287
+ * takes them (cheapest to a kill first: by measured time, those whose own
288
+ * evidence infected it counted as likelier), each test's queue of mutants (those
289
+ * it is the likeliest killer of first), and how many copies each test needs:
290
+ * one for each mutant that may take it, one more for each control a kill may
291
+ * call for, and the first control. A candidate in a project others start
292
+ * from is never run with the mutant: the mutant's verdict says so.
260
293
  */
261
294
  function buildPass(pass, root, config) {
262
295
  const plan = readJson(pass.planPath);
@@ -273,6 +306,8 @@ function buildPass(pass, root, config) {
273
306
  const restarts = [];
274
307
  const deferred = [];
275
308
  const otherRunners = { ...(job?.otherRunners ?? {}) };
309
+ const setupOnly = { ...(job?.setupOnly ?? {}) };
310
+ const setupProjects = setupProjectsOf(config);
276
311
  const mutants = [];
277
312
  if (job && job.kind !== "main") {
278
313
  for (const entry of job.mutants) {
@@ -312,34 +347,56 @@ function buildPass(pass, root, config) {
312
347
  });
313
348
  continue;
314
349
  }
315
- // Its candidates, cheapest first (the plan's order), those whose own
316
- // evidence shows it infected first of all.
350
+ // Its candidates, and which of them infected it.
317
351
  const own = [];
318
352
  const others = new Set();
353
+ const setup = new Set();
319
354
  for (const candidate of mutant.candidates) {
320
355
  const test = plan.tests[candidate.test];
321
- if (test && tests[playwrightId(test)])
356
+ const project = test && tests[playwrightId(test)] && inSetupProject(test, setupProjects);
357
+ if (project)
358
+ setup.add(project);
359
+ else if (test && tests[playwrightId(test)])
322
360
  own.push({ id: playwrightId(test), infected: candidate.reason === "infected" });
323
361
  else if (test)
324
362
  others.add(test.runner);
325
363
  }
326
364
  if (others.size)
327
365
  otherRunners[mutant.id] = [...others].sort();
366
+ if (setup.size)
367
+ setupOnly[mutant.id] = [...setup].sort();
328
368
  if (!own.length) {
329
- immediate.push(others.size
330
- ? { id: mutant.id, status: "error", reason: `its candidates ran under ${[...others].sort().join(", ")}, which this pass does not run`, tests: 0, durationMs: 0 }
369
+ const unrun = unrunReason(otherRunners[mutant.id], setupOnly[mutant.id], "its candidates");
370
+ immediate.push(unrun
371
+ ? { id: mutant.id, status: "error", reason: unrun, tests: 0, durationMs: 0 }
331
372
  : { id: mutant.id, status: "survived", reason: "no-runnable-candidate", tests: 0, durationMs: 0 });
332
373
  continue;
333
374
  }
334
- const ordered = [...new Set([...own.filter((test) => test.infected), ...own.filter((test) => !test.infected)].map((test) => test.id))];
375
+ // Cheapest to a kill first: each test's measured time (one the
376
+ // run timed none of counts as a second, the least a baseline
377
+ // is), over how likely it is to kill, a test whose own evidence
378
+ // infected it `INFECTED_LIKELIER` times likelier than one that
379
+ // only reached it; the plan's order between equals. So a test
380
+ // that infected it goes first unless it is that much slower,
381
+ // and a slow test goes last.
382
+ const costOf = (test) => (tests[test.id].durationMs ?? DEFAULT_DURATION_MS) * (test.infected ? 1 : INFECTED_LIKELIER);
383
+ own.sort((a, b) => costOf(a) - costOf(b));
384
+ const infected = [...new Set(own.filter((test) => test.infected).map((test) => test.id))];
385
+ const ordered = [...new Set(own.map((test) => test.id))];
335
386
  const switched = `${mutant.file}#${found.index}`;
336
387
  if (mutant.serverWide) {
337
388
  restarts.push({ id: mutant.id, mutant: switched, tests: ordered, reason: mutant.serverWide });
338
389
  continue;
339
390
  }
340
- mutants.push({ id: mutant.id, mutant: switched, tests: ordered });
391
+ mutants.push({ id: mutant.id, mutant: switched, tests: ordered, infected });
341
392
  }
342
393
  }
394
+ // What a survivor's verdict says of the candidates it was not run with.
395
+ for (const entry of mutants) {
396
+ const unrun = unrunReason(otherRunners[entry.id], setupOnly[entry.id], "its other candidates");
397
+ if (unrun)
398
+ entry.unrun = unrun;
399
+ }
343
400
  // Each test's queue, and the copies the round's mutants need, as many as
344
401
  // an invocation holds; the mutants past them wait for the next.
345
402
  const limit = copiesPerInvocation();
@@ -347,7 +404,10 @@ function buildPass(pass, root, config) {
347
404
  let copies = 0;
348
405
  const entries = {};
349
406
  for (const entry of mutants) {
350
- const added = entry.tests.reduce((sum, id) => sum + 2 + (queues.has(id) ? 0 : 1), 0);
407
+ // Two copies a candidate (an attempt, and a control should it
408
+ // kill), one more where it is not the first (a sweep it may wait
409
+ // out), and each test's first run.
410
+ const added = entry.tests.reduce((sum, id, at) => sum + 2 + (at > 0 ? 1 : 0) + (queues.has(id) ? 0 : 1), 0);
351
411
  if (copies && copies + added > limit && kind === "main") {
352
412
  deferred.push({ id: entry.id });
353
413
  continue;
@@ -361,14 +421,21 @@ function buildPass(pass, root, config) {
361
421
  });
362
422
  }
363
423
  const declared = {};
424
+ // What orders a sweep of a file's copies: each test's measured time.
425
+ const costs = {};
364
426
  for (const [id, queue] of queues) {
365
- // The likeliest killers' mutants first; the plan's order between equals.
427
+ // The likeliest killers' mutants first; the plan's order between
428
+ // equals. A copy takes from it by each mutant's standing then.
366
429
  queue.sort((a, b) => a.at - b.at);
367
430
  const test = tests[id];
368
431
  test.jobs = queue.length;
369
432
  test.queue = queue.map((job) => job.id);
370
433
  const where = declarationKey(resolve(root, test.file), test.title);
371
- declared[where] = Math.max(declared[where] ?? 0, 2 * queue.length + 1);
434
+ // A copy for each sweep the test may wait out: one for each mutant
435
+ // with a candidate before it.
436
+ const later = queue.filter((job) => job.at > 0).length;
437
+ declared[where] = Math.max(declared[where] ?? 0, 2 * queue.length + later + 1);
438
+ costs[where] = Math.max(costs[where] ?? 0, test.durationMs ?? DEFAULT_DURATION_MS);
372
439
  }
373
440
  return {
374
441
  pass: pass.name,
@@ -386,16 +453,32 @@ function buildPass(pass, root, config) {
386
453
  timeoutFactor: Number(plan.timeoutFactor) > 0 ? Number(plan.timeoutFactor) : TIMEOUT_FACTOR,
387
454
  tests,
388
455
  declared,
456
+ costs,
389
457
  entries,
390
- setupProjects: setupProjectsOf(config),
458
+ setupProjects,
391
459
  concurrency,
392
460
  immediate,
393
461
  restarts,
394
462
  otherRunners,
463
+ setupOnly,
395
464
  deferred,
396
465
  };
397
466
  }
398
467
 
468
+ /**
469
+ * Why a mutant no Playwright test killed has no verdict of `survived`: the
470
+ * candidates this pass does not run with it (`lead` names them), or
471
+ * `undefined` where it runs every one.
472
+ */
473
+ export function unrunReason(others, setup, lead) {
474
+ const parts = [];
475
+ if (others?.length)
476
+ parts.push(`${lead} ran under ${others.join(", ")}, which this pass does not run`);
477
+ if (setup?.length)
478
+ parts.push(`${lead} are in the project${setup.length > 1 ? "s" : ""} ${setup.map((name) => JSON.stringify(name)).join(", ")}, which the others start from and which run${setup.length > 1 ? "" : "s"} without a mutant`);
479
+ return parts.length ? parts.join("; ") : undefined;
480
+ }
481
+
399
482
  /** The round's work: built and written by the runner, read by its judge. */
400
483
  let passCache;
401
484
  export function loadPass(pass) {
@@ -427,6 +510,7 @@ function writeRoundFiles(pass, work) {
427
510
  timeoutFactor: work.timeoutFactor,
428
511
  tests,
429
512
  declared: work.declared,
513
+ costs: work.costs,
430
514
  setupProjects: work.setupProjects,
431
515
  concurrency: work.concurrency,
432
516
  });
@@ -564,6 +648,11 @@ function invocationMutant(pass) {
564
648
  * describe runs as a default one: in order, in one worker, but a failed test
565
649
  * (a kill) does not skip the rest; a test that leans on an earlier one's
566
650
  * state is caught by its control.
651
+ *
652
+ * A worker runs a file's tests in the order they are declared, so the
653
+ * copies are arranged in sweeps as they are declared (`arrange`): after the
654
+ * tests themselves, every test's first copy, cheapest test first, then
655
+ * every test's second copy, and so on, beside the tests of their describe.
567
656
  */
568
657
  export function installCopies(baseTest) {
569
658
  if (!copying())
@@ -583,9 +672,18 @@ export function installCopies(baseTest) {
583
672
  if (type === "skip" || type === "fixme")
584
673
  return;
585
674
  const suite = this._currentSuite?.(location, "test()");
586
- const copies = copiesOf(suite?._requireFile ?? location?.file, title);
587
- for (let copy = 1; copy < copies; copy++)
675
+ const file = suite?._requireFile ?? location?.file;
676
+ const copies = copiesOf(file, title);
677
+ if (copies < 2)
678
+ return;
679
+ const cost = costOf(file, title);
680
+ for (let copy = 1; copy < copies; copy++) {
588
681
  describe.call(this, "default", location, copyTitle(copy), () => declare.call(this, type, location, title, fnOrDetails, fn));
682
+ const made = Array.isArray(suite?._entries) ? suite._entries[suite._entries.length - 1] : undefined;
683
+ if (made)
684
+ sweeps.set(made, { copy, cost });
685
+ }
686
+ arrange(suite);
589
687
  };
590
688
  prototype._describe = function (type, ...rest) {
591
689
  return describe.call(this, type === "serial" ? "default" : type === "serial.only" ? "only" : type, ...rest);
@@ -600,8 +698,36 @@ let declaredCopies;
600
698
  function copiesOf(file, title) {
601
699
  if (!file)
602
700
  return 1;
603
- declaredCopies ??= readJsonOr(`${strongPass().round}/worker.json`, { declared: {} }).declared;
604
- return declaredCopies[declarationKey(file, title)] ?? 1;
701
+ declaredCopies ??= readJsonOr(`${strongPass().round}/worker.json`, { declared: {}, costs: {} });
702
+ return declaredCopies.declared[declarationKey(file, title)] ?? 1;
703
+ }
704
+
705
+ /** A test's measured time, which places its copies in each sweep. */
706
+ function costOf(file, title) {
707
+ return declaredCopies.costs?.[declarationKey(file, title)] ?? DEFAULT_DURATION_MS;
708
+ }
709
+
710
+ /** Each copy's describe: which copy it is and its test's cost. */
711
+ const sweeps = new WeakMap();
712
+
713
+ /**
714
+ * Puts a describe's entries in sweeps: what is not a copy first, as
715
+ * declared, then the copies by their number, the cheapest test's first,
716
+ * the declared order between equals. The worker runs a file's tests in this
717
+ * order (it loads the file itself), so a file's tests take one mutant each
718
+ * in turn rather than one test all its mutants before the next test starts,
719
+ * and a slow test runs last in each sweep. A Playwright whose suites keep
720
+ * their entries otherwise is left as declared.
721
+ */
722
+ export function arrange(suite) {
723
+ const list = suite?._entries;
724
+ if (!Array.isArray(list))
725
+ return;
726
+ const placed = list.map((entry, at) => ({ entry, at, sweep: sweeps.get(entry) ?? { copy: 0, cost: 0 } }));
727
+ placed.sort((a, b) => a.sweep.copy - b.sweep.copy || a.sweep.cost - b.sweep.cost || a.at - b.at);
728
+ placed.forEach((place, at) => {
729
+ list[at] = place.entry;
730
+ });
605
731
  }
606
732
 
607
733
  /** How a test did with no mutant: `passed`, `failed`, or `undefined` before it ended. */
@@ -693,9 +819,23 @@ export function invocation() {
693
819
  return process.env["SUPERCOV_PLAYWRIGHT_INVOCATION"] ?? "0";
694
820
  }
695
821
 
696
- // The tests that passed without a mutant in this worker (a control): a test
697
- // runs with a mutant only in a worker where it passed without one.
698
- const passedHere = new Set();
822
+ /**
823
+ * Whether a test's next run in this invocation has no mutant: none of its
824
+ * runs without one passed here yet (or the last failed), or a kill of it
825
+ * here waits for one to confirm it. A test runs with a mutant only on a
826
+ * server where it passed without one, whichever worker runs it.
827
+ */
828
+ function needsControl(pass, test) {
829
+ return !existsSync(readyPath(pass, invocation(), test)) || entries(`${pass.round}/pending/${invocation()}/${key(test)}`).length > 0;
830
+ }
831
+
832
+ function readyPath(pass, at, test) {
833
+ return `${pass.round}/ready/${at}/${key(test)}`;
834
+ }
835
+
836
+ function claimPath(pass, id, test) {
837
+ return `${pass.round}/claims/${key(id)}/${key(test)}`;
838
+ }
699
839
 
700
840
  /** Whether a mutant needs no more attempts: a verdict given, killed, or held for a later round. */
701
841
  function settled(pass, id) {
@@ -726,44 +866,104 @@ function inFlightSince(pass, id) {
726
866
  }
727
867
 
728
868
  /**
729
- * The next mutant for a copy of `test`: the first of its queue not settled
730
- * and not yet tried against it, one no other attempt runs first. Taken by
731
- * making its mark, which only one copy can.
869
+ * The next mutant for a copy of `test`: of its queue, one not settled, not
870
+ * yet tried against it and run by no other attempt now, the best by its
871
+ * standing (`standingOf`). Taken by making its mark, which only one copy
872
+ * can. Where even the best has a candidate before `test` still to try (a
873
+ * cheaper test, or one likelier to kill it), the copy takes none while the
874
+ * test's copies left (`copiesLeft`, after this one) still cover every mutant
875
+ * waiting for it and a control for each: the test's next copy, a sweep
876
+ * later, looks again. So a slow test's copies go to the mutants its cheaper
877
+ * candidates let live, and it runs every mutant all the same before its
878
+ * copies are spent.
732
879
  */
733
- function takeJob(pass, test, only, limitMs) {
880
+ function takeJob(pass, shape, test, only, limitMs, copiesLeft) {
734
881
  const queue = queueOf(pass, test);
735
- const busy = [];
736
- for (let at = queue.done; at < queue.ids.length; at++) {
737
- const id = queue.ids[at];
738
- if (only !== undefined && id !== only)
739
- continue;
740
- const tried = `${pass.round}/claims/${key(id)}/${key(test)}`;
741
- if (existsSync(tried) || settled(pass, id)) {
742
- // Nothing undoes either: no copy looks at it again.
743
- if (at === queue.done)
744
- queue.done += 1;
745
- continue;
746
- }
747
- const since = inFlightSince(pass, id);
748
- if (since !== undefined) {
749
- // One that has run longer than this test's limit may hang:
750
- // a second attempt would only wait as long.
751
- if (Date.now() - since < limitMs)
752
- busy.push(id);
753
- continue;
882
+ // A test that fails without any mutant is no candidate: it holds back
883
+ // no later one.
884
+ const failed = new Map();
885
+ const unrunnable = (other) => {
886
+ if (!failed.has(other))
887
+ failed.set(other, baselineOf(pass, other) === "failed");
888
+ return failed.get(other);
889
+ };
890
+ let busy;
891
+ for (;;) {
892
+ busy = [];
893
+ let best;
894
+ let waiting = 0;
895
+ for (let at = queue.done; at < queue.ids.length; at++) {
896
+ const id = queue.ids[at];
897
+ if (only !== undefined && id !== only)
898
+ continue;
899
+ if (existsSync(claimPath(pass, id, test)) || settled(pass, id)) {
900
+ // Nothing undoes either: no copy looks at it again.
901
+ if (at === queue.done)
902
+ queue.done += 1;
903
+ continue;
904
+ }
905
+ waiting += 1;
906
+ const since = inFlightSince(pass, id);
907
+ if (since !== undefined) {
908
+ // One that has run longer than this test's limit may hang:
909
+ // a second attempt would only wait as long.
910
+ if (Date.now() - since < limitMs)
911
+ busy.push(id);
912
+ continue;
913
+ }
914
+ const standing = standingOf(pass, shape, id, test, at, unrunnable);
915
+ if (!best || before(standing, best.standing))
916
+ best = { id, standing };
754
917
  }
755
- if (mark(tried))
756
- return id;
918
+ if (!best)
919
+ break;
920
+ const controls = entries(`${pass.round}/pending/${invocation()}/${key(test)}`).length;
921
+ if (only === undefined && best.standing[0] > 0 && copiesLeft >= 2 * waiting + controls)
922
+ return undefined;
923
+ if (mark(claimPath(pass, best.id, test)))
924
+ return best.id;
925
+ // Another copy took it first: choose again.
757
926
  }
758
927
  // Every mutant left runs elsewhere now: one of them here too, rather
759
928
  // than leave this test's copies unused while its attempt runs.
760
929
  for (const id of busy) {
761
- if (only === undefined && !settled(pass, id) && mark(`${pass.round}/claims/${key(id)}/${key(test)}`))
930
+ if (only === undefined && !settled(pass, id) && mark(claimPath(pass, id, test)))
762
931
  return id;
763
932
  }
764
933
  return undefined;
765
934
  }
766
935
 
936
+ /**
937
+ * Where a mutant stands for a copy of `test`, best first: how many of its
938
+ * candidates before `test` are still to try (none: its cheaper candidates
939
+ * let it live, and this test is the next that may kill it), whether `test`
940
+ * infected it, how long its candidates still to try take (the closest to a
941
+ * verdict first), and its place in the test's queue.
942
+ */
943
+ function standingOf(pass, shape, id, test, at, unrunnable) {
944
+ const entry = mutantOf(pass, id);
945
+ const passed = passedWith(pass, id);
946
+ const place = entry.tests.indexOf(test);
947
+ let earlier = 0;
948
+ let leftMs = 0;
949
+ entry.tests.forEach((other, index) => {
950
+ if (passed.has(key(other)) || unrunnable(other))
951
+ return;
952
+ leftMs += shape.tests[other]?.durationMs ?? DEFAULT_DURATION_MS;
953
+ if (index < place)
954
+ earlier += 1;
955
+ });
956
+ return [earlier, entry.infected?.includes(test) ? 0 : 1, leftMs, at];
957
+ }
958
+
959
+ function before(a, b) {
960
+ for (let at = 0; at < a.length; at++) {
961
+ if (a[at] !== b[at])
962
+ return a[at] < b[at];
963
+ }
964
+ return false;
965
+ }
966
+
767
967
  /** Whether a test has mutants left to take, or kills to confirm, in this invocation. */
768
968
  function workLeft(pass, test) {
769
969
  if (entries(`${pass.round}/pending/${invocation()}/${key(test)}`).length)
@@ -771,12 +971,46 @@ function workLeft(pass, test) {
771
971
  const queue = queueOf(pass, test);
772
972
  for (let at = queue.done; at < queue.ids.length; at++) {
773
973
  const id = queue.ids[at];
774
- if (!existsSync(`${pass.round}/claims/${key(id)}/${key(test)}`) && !settled(pass, id))
974
+ if (!existsSync(claimPath(pass, id, test)) && !settled(pass, id))
775
975
  return true;
776
976
  }
777
977
  return false;
778
978
  }
779
979
 
980
+ /**
981
+ * The work left in this invocation's tests, for the progress lines: how
982
+ * many mutants wait for each test it runs (not settled, not yet tried
983
+ * against it), how long that takes at the test's baseline, and the costliest
984
+ * few tests, those whose runs left take longest. `held` are the tests the
985
+ * invocation runs.
986
+ */
987
+ export function queuedWork(pass, work, held) {
988
+ const settledNow = new Set([...entries(`${pass.shared}/verdicts`), ...entries(`${pass.round}/killed`)]);
989
+ const claimed = new Map();
990
+ const tests = [];
991
+ let ms = 0;
992
+ for (const id of held) {
993
+ const test = work.tests[id];
994
+ let waiting = 0;
995
+ for (const mutant of test?.queue ?? []) {
996
+ const at = key(mutant);
997
+ if (settledNow.has(at))
998
+ continue;
999
+ if (!claimed.has(at))
1000
+ claimed.set(at, new Set(entries(`${pass.round}/claims/${at}`)));
1001
+ if (!claimed.get(at).has(key(id)))
1002
+ waiting += 1;
1003
+ }
1004
+ if (!waiting)
1005
+ continue;
1006
+ const baselineMs = baselineMsOf(pass, id, test);
1007
+ ms += waiting * baselineMs;
1008
+ tests.push({ title: test.title ?? id, waiting, baselineMs, limitMs: limitOf(baselineMs, work.timeoutFactor) });
1009
+ }
1010
+ tests.sort((a, b) => b.waiting * b.baselineMs - a.waiting * a.baselineMs || a.title.localeCompare(b.title));
1011
+ return { ms, tests: tests.slice(0, COSTLY_SHOWN) };
1012
+ }
1013
+
780
1014
  /**
781
1015
  * Notes that an attempt runs, and whether another mutant's attempt runs
782
1016
  * beside it in this invocation (its server): each attempt that starts looks
@@ -849,9 +1083,10 @@ export async function strongClaim(testInfo) {
849
1083
  if (entries(unreliable).length >= CONTROL_FAILURES)
850
1084
  return null;
851
1085
  let attempt;
852
- if (!shape.everywhere && !passedHere.has(original)) {
853
- // The test's first run in this worker, or the first since it failed
854
- // here: without a mutant, the round's baseline or a kill's control.
1086
+ if (!shape.everywhere && needsControl(pass, original)) {
1087
+ // The test's first run in this invocation, the first since it failed
1088
+ // here, or the first since a kill here: without a mutant, the
1089
+ // round's baseline or a kill's control.
855
1090
  if (!workLeft(pass, original))
856
1091
  return null;
857
1092
  attempt = shape.baselines && baselineOf(pass, original) === undefined
@@ -866,7 +1101,11 @@ export async function strongClaim(testInfo) {
866
1101
  const derived = limitOf(baselineMs, shape.timeoutFactor);
867
1102
  // The test's own timeout, where shorter, ends it first anyway.
868
1103
  const limitMs = configured > 0 ? Math.min(derived, configured) : derived;
869
- const id = takeJob(pass, original, shape.batch ? invocationMutant(pass) ?? null : undefined, limitMs);
1104
+ // This copy's number, and the test's copies after it in this
1105
+ // invocation: what a copy that waits a sweep may spend.
1106
+ const copy = withoutCopy(testInfo.titlePath).copy;
1107
+ const copiesLeft = copiesOf(testInfo.file, testInfo.title) - 1 - copy;
1108
+ const id = takeJob(pass, shape, original, shape.batch ? invocationMutant(pass) ?? null : undefined, limitMs, copiesLeft);
870
1109
  if (!id)
871
1110
  return null;
872
1111
  const entry = mutantOf(pass, id);
@@ -960,9 +1199,8 @@ function surviveIfDone(pass, id) {
960
1199
  if (!entry.tests.every((test) => passed.has(key(test))))
961
1200
  return;
962
1201
  const ran = entry.tests.length;
963
- const others = readJsonOr(`${pass.round}/pass.json`, { otherRunners: {} }).otherRunners?.[id];
964
- giveVerdict(pass, others
965
- ? { id, status: "error", reason: `no Playwright test killed it, and its other candidates ran under ${others.join(", ")}, which this pass does not run`, tests: ran, durationMs: 0 }
1202
+ giveVerdict(pass, entry.unrun
1203
+ ? { id, status: "error", reason: `no Playwright test killed it, and ${entry.unrun}`, tests: ran, durationMs: 0 }
966
1204
  : { id, status: "survived", ...(entry.reason ? { reason: reasonOf(loadWorker(pass).kind, entry.reason) } : {}), tests: ran, durationMs: 0 });
967
1205
  }
968
1206
 
@@ -1028,7 +1266,6 @@ export function settleAttempt(pass, attempt) {
1028
1266
  return ended;
1029
1267
  }
1030
1268
  if (ended.outcome === "passed") {
1031
- passedHere.add(test);
1032
1269
  mark(`${pass.round}/passed/${key(attempt.id)}/${key(test)}`);
1033
1270
  // One mutant an invocation: a survivor waits for the judge, who
1034
1271
  // knows whether its server ran it.
@@ -1041,7 +1278,6 @@ export function settleAttempt(pass, attempt) {
1041
1278
  // A kill, or a timeout (it ran out of its limit): no other copy takes
1042
1279
  // the mutant now, and either is confirmed alike.
1043
1280
  const { status, reason } = verdictOf(ended);
1044
- passedHere.delete(test);
1045
1281
  mark(`${pass.round}/killed/${key(attempt.id)}`);
1046
1282
  if (beside)
1047
1283
  mark(`${pass.round}/confirm/${key(attempt.id)}`);
@@ -1069,9 +1305,9 @@ function suffix(shape, entry) {
1069
1305
  /**
1070
1306
  * A run with no mutant: the test's baseline (the first in a main round), or
1071
1307
  * a control after a kill. Passing, it lets the test take mutants in this
1072
- * worker and confirms the kills before it on this server; failing, it puts
1073
- * them in doubt, and a test that fails so twice in an invocation is not run
1074
- * there again.
1308
+ * invocation and confirms the kills before it on this server; failing, it
1309
+ * puts them in doubt, and a test that fails so twice in an invocation is not
1310
+ * run there again.
1075
1311
  */
1076
1312
  function settleControl(pass, ended, shape) {
1077
1313
  const test = ended.original;
@@ -1099,7 +1335,7 @@ function settleControl(pass, ended, shape) {
1099
1335
  mark(`${pass.round}/doubt/${key(kill.id)}`);
1100
1336
  }
1101
1337
  if (passed) {
1102
- passedHere.add(test);
1338
+ mark(readyPath(pass, ended.invocation, test));
1103
1339
  // Its time, for its mutants' limits.
1104
1340
  mark(`${pass.shared}/durations/${key(test)}`);
1105
1341
  writeFileSync(`${pass.shared}/durations/${key(test)}/${ended.worker}-${ended.endedAt - ended.startedAt}`, "");
@@ -1107,7 +1343,7 @@ function settleControl(pass, ended, shape) {
1107
1343
  }
1108
1344
  if (ended.outcome === "skipped")
1109
1345
  return;
1110
- passedHere.delete(test);
1346
+ rmSync(readyPath(pass, ended.invocation, test), { recursive: true, force: true });
1111
1347
  mark(`${pass.round}/unreliable/${ended.invocation}/${key(test)}`);
1112
1348
  writeFileSync(`${pass.round}/unreliable/${ended.invocation}/${key(test)}/${ended.worker}-${Date.now()}`, "");
1113
1349
  }
@@ -11,10 +11,12 @@
11
11
  // from whichever invocations ran it, and what was cut short is unfinished.
12
12
  import { appendFileSync, existsSync, readFileSync, realpathSync, statSync } from "node:fs";
13
13
  import { pathToFileURL } from "node:url";
14
- import { attemptPath, baselineOf, entries, invocation, EVERYWHERE, firstWords, giveVerdict, key, loadPass, outcomeOf, placeOf, readJson, reasonOf, settleAttempt, strongPass, verdictOf, withoutCopy, writeJson } from "./playwrightStrong.mjs";
14
+ import { attemptPath, baselineOf, entries, invocation, EVERYWHERE, firstWords, giveVerdict, key, loadPass, outcomeOf, placeOf, queuedWork, readJson, reasonOf, settleAttempt, strongPass, verdictOf, withoutCopy, writeJson } from "./playwrightStrong.mjs";
15
15
 
16
16
  // How often, at most, the status file is written.
17
17
  const STATUS_MS = 1_000;
18
+ // How often, at most, the work left is counted for it.
19
+ const QUEUED_MS = 5_000;
18
20
 
19
21
  /** Each JSON file in a directory of the pass, or none. */
20
22
  function readAll(directory) {
@@ -63,6 +65,11 @@ export default class SupercovPlaywrightStrongReporter {
63
65
  this.running = new Map();
64
66
  this.counts = { baselines: 0, controls: 0, failedControls: 0, attempts: 0, killed: 0, timedOut: 0, passed: 0 };
65
67
  this.writtenAt = 0;
68
+ // The tests this invocation runs, and the baseline time of the runs
69
+ // it ended: its pace, for the time its work left takes.
70
+ this.held = [];
71
+ this.doneMs = 0;
72
+ this.queuedAt = 0;
66
73
  }
67
74
  // It prints its own lines, and says it prints: Playwright adds a reporter
68
75
  // of its own where none does. The command's output is a log beside the
@@ -84,6 +91,8 @@ export default class SupercovPlaywrightStrongReporter {
84
91
  if (withoutCopy(test.titlePath()).copy)
85
92
  continue;
86
93
  writeJson(`${this.pass.round}/originals/${key(placeOf(test))}`, test.id);
94
+ if (this.work.tests[test.id]?.jobs)
95
+ this.held.push(test.id);
87
96
  }
88
97
  this.copies = copies;
89
98
  const mutants = Object.keys(this.work.entries).length;
@@ -137,6 +146,8 @@ export default class SupercovPlaywrightStrongReporter {
137
146
  /** A line on the command's output for each attempt with a mutant, and each control that failed. */
138
147
  say(attempt) {
139
148
  const took = seconds((attempt.endedAt ?? Date.now()) - attempt.startedAt);
149
+ this.firstStartedAt ??= attempt.startedAt;
150
+ this.doneMs += attempt.baselineMs ?? this.work.tests[attempt.original]?.durationMs ?? 0;
140
151
  if (attempt.kind !== "mutant") {
141
152
  this.counts[attempt.kind === "baseline" ? "baselines" : "controls"] += 1;
142
153
  if (attempt.outcome === "failed" || attempt.outcome === "timed-out") {
@@ -186,6 +197,8 @@ export default class SupercovPlaywrightStrongReporter {
186
197
  limitMs: attempt?.limitMs,
187
198
  };
188
199
  });
200
+ if (now && this.work && Date.now() - this.queuedAt >= QUEUED_MS)
201
+ this.countQueued();
189
202
  try {
190
203
  writeJson(`${this.pass.shared}/status/${process.pid}.json`, {
191
204
  round: this.pass.name,
@@ -198,12 +211,32 @@ export default class SupercovPlaywrightStrongReporter {
198
211
  firstMutantAt: this.firstMutantAt,
199
212
  lastEndedAt: this.lastEndedAt,
200
213
  running,
214
+ ...(this.queued ? { queued: this.queued } : {}),
201
215
  });
202
216
  }
203
217
  catch {
204
218
  // The status is for the progress line; the pass goes on without it.
205
219
  }
206
220
  }
221
+ /**
222
+ * The work left in this invocation's tests (`queuedWork`), and the time
223
+ * it takes at the pace so far: the baseline time of the runs it ended
224
+ * over the time they took, which counts what runs besides the tests (a
225
+ * copy with nothing to run, a new worker after a kill).
226
+ */
227
+ countQueued() {
228
+ this.queuedAt = Date.now();
229
+ try {
230
+ const queued = queuedWork(this.pass, this.work, this.held);
231
+ const spent = (this.lastEndedAt ?? 0) - (this.firstStartedAt ?? 0);
232
+ if (this.doneMs > 0 && spent > 0)
233
+ queued.leftMs = Math.round((queued.ms * spent) / this.doneMs);
234
+ this.queued = queued;
235
+ }
236
+ catch {
237
+ // Counted again at the next status.
238
+ }
239
+ }
207
240
  onEnd() {
208
241
  if (!this.pass)
209
242
  return;
@@ -369,9 +402,8 @@ export default class SupercovPlaywrightStrongReporter {
369
402
  next(entry, "unfinished", left);
370
403
  continue;
371
404
  }
372
- const others = work.otherRunners[id];
373
- verdict(others
374
- ? { status: "error", reason: `no Playwright test killed it, and its other candidates ran under ${others.join(", ")}, which this pass does not run` }
405
+ verdict(entry.unrun
406
+ ? { status: "error", reason: `no Playwright test killed it, and ${entry.unrun}` }
375
407
  : { status: "survived", ...(after ? { reason: after } : {}) });
376
408
  }
377
409
  for (const job of work.restarts)
@@ -407,13 +439,13 @@ export default class SupercovPlaywrightStrongReporter {
407
439
  for (const entry of aloneAgain)
408
440
  (takenAny ? alone : aloneEach).push(entry);
409
441
  if (alone.length)
410
- write({ restart: { kind: "alone", everywhere: true, batch: true, reason: "server-wide", mutants: alone, otherRunners: work.otherRunners } });
442
+ write({ restart: { kind: "alone", everywhere: true, batch: true, reason: "server-wide", mutants: alone, otherRunners: work.otherRunners, setupOnly: work.setupOnly } });
411
443
  for (const job of aloneEach)
412
- write({ restart: { kind: "alone", everywhere: true, reason: job.reason, mutants: [job], otherRunners: work.otherRunners } });
444
+ write({ restart: { kind: "alone", everywhere: true, reason: job.reason, mutants: [job], otherRunners: work.otherRunners, setupOnly: work.setupOnly } });
413
445
  if (rest.length)
414
- write({ restart: { kind: "rest", reason: "unfinished", mutants: rest, otherRunners: work.otherRunners } });
446
+ write({ restart: { kind: "rest", reason: "unfinished", mutants: rest, otherRunners: work.otherRunners, setupOnly: work.setupOnly } });
415
447
  if (serial.length)
416
- write({ restart: { kind: "serial", reason: [...new Set(serial.map((job) => job.reason))].join(", "), mutants: serial, otherRunners: work.otherRunners } });
448
+ write({ restart: { kind: "serial", reason: [...new Set(serial.map((job) => job.reason))].join(", "), mutants: serial, otherRunners: work.otherRunners, setupOnly: work.setupOnly } });
417
449
  const mutated = attempts.filter((attempt) => attempt.kind === "mutant");
418
450
  write({
419
451
  summary: true,