@mark1russell7/rigor-mutation 0.2.1 → 0.2.3

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/README.md CHANGED
@@ -45,6 +45,10 @@ The lane file `mutation.json` is at the root of the repository:
45
45
  - `dryRunTimeoutMinutes` is the time in minutes for the run of the tests without mutants. The default is 15.
46
46
  - `stryker` has more options for the Stryker config of each selection of the package, for example `{ "ignoreStatic": true }`. Its keys replace the keys of the config, but `--concurrency` replaces its `concurrency`. The lane owns `mutate`, `thresholds`, `jsonReporter`, `htmlReporter`, `timeoutMS` and `dryRunTimeoutMinutes`, so `stryker` cannot have them.
47
47
  - `disables` (at the root of the lane) names the list of the disabled mutants. The default is `mutation-disables.json`.
48
+ - `staticLimits` gives the most static runs of each file of the package, from the folder where Stryker starts. The key `*` gives the limit of the other files. `plan-check` reads it.
49
+ - `targetMinutes` (at the root of the lane) is the target of the estimate of each selection, in minutes. The default is 100.
50
+ - `stopMinutes` (at the root of the lane) is the stop of the estimate of each selection, in minutes. The default is 140. It is not less than `targetMinutes`.
51
+ - `planPerClock` (at the root of the lane) is the planned net time of one minute of the clock. The default is 9.8, from a nightly run of Vex.
48
52
 
49
53
  A selection is one Stryker run: a package (`collections`) or a part (`collections.impl`). `rigor-mutation list --runs` gives the selections of a full run: the parts of each package with parts, else the package.
50
54
 
@@ -93,6 +97,31 @@ A partial score is a no read, because it does not read all the mutants. Its fiel
93
97
 
94
98
  The workflow `stryker-stop.yml` checks the reporter in a real run. It stops Stryker on the fixture lane `test/stryker/mutation.json` and examines the partial score.
95
99
 
100
+ ### The cost plan
101
+
102
+ After the run of the tests without mutants, Stryker makes a plan of the mutants. The reporter `rigor-partial` writes it to `plan.json`, next to `mutation.json`:
103
+
104
+ - `files` gives the plan of each file: its mutants, the runs, the static runs, the planned net time and the time limits in milliseconds. `lines` gives the runs, the static runs and the net time of each line.
105
+ - `tests` gives the 40 tests of the largest cost. The cost of a test is its time, times the runs that start it.
106
+
107
+ Each line of a mutant in `partial.jsonl` also gives its planned net time and its time limit.
108
+
109
+ `rigor-mutation config <selection> --plan` gives a config that stops Stryker after the plan. Stryker starts no mutant, so the plan costs only the run of the tests.
110
+
111
+ `rigor-mutation plan-check <selection>...` reads the plan of each selection. It gives the estimate of the clock. It gives a warning when the estimate is over `targetMinutes`, and in GitHub Actions also a warning annotation. The estimate has an error of 28 minutes in the mean, so the target does not fail. These conditions fail a selection:
112
+
113
+ - The estimate is over `stopMinutes`. Stryker cannot end the selection before the stop, so it cannot give a full score.
114
+ - A file has more static runs than its limit in `staticLimits`.
115
+
116
+ A static run starts each test, so it costs the time of all the tests. Code outside a function gives a static mutant.
117
+
118
+ ```text
119
+ vex.kernel: 812 runs, 3 of them static, with a planned net time of 12.4 h. The estimate is 76 minutes of the clock, the target is 100 and the stop is 140.
120
+ plan-check: each plan of 1 selections is in its limits
121
+ ```
122
+
123
+ `--report <file>` reads the plan of one selection from a file. `--reports <dir>` reads `<dir>/mutation-<selection>/plan.json`. The workflow `stryker-stop.yml` checks the plan in a real run.
124
+
96
125
  ## The score
97
126
 
98
127
  The score counts the detected mutants, out of the mutants that a test covers or that survive. Compile errors, runtime errors and ignored mutants do not count.
@@ -156,12 +185,21 @@ packages/compiler/src/module-sheet.test.ts:12: "../../testkit/src/fc-timeout.ts"
156
185
 
157
186
  The check does not read comments, type imports and paths with a template expression.
158
187
 
159
- With `--collect`, the Vitest of each package also loads each test file, as Stryker does. It starts the collect of Vitest in a new process, with `staticParse: false`. Then each file starts, so the check finds a missing package, also through a helper or a computed dynamic import. These are faults:
188
+ With `--collect`, the Vitest of each package also loads each test file, as Stryker does. The check copies the folder of the package to `.stryker-tmp/load-check-*` in that folder, and links its `node_modules`. Stryker makes its sandbox in the same form. The copy takes only the files that Stryker copies. The ignore rules of Stryker 10 and the `ignorePatterns` of the `stryker` field of the lane leave out the other files. The collect of Vitest starts in the copy, in a new process, with `staticParse: false`. Then each file starts, so the check finds a missing package, also through a helper. A path that finds a file only in the folder of the package fails in the copy too. Then for each selection of the package, Vitest gives the test files that its related mode starts for the mutated files. These are faults:
160
189
 
161
190
  - a test file that does not load,
162
191
  - a test file that holds no test,
163
192
  - an error outside a test file,
164
- - a package with no test file.
193
+ - a package with no test file,
194
+ - a test file that no selection starts, and that `notRead` does not name,
195
+ - an entry of `notRead` for a file that is not on the disk, or that a selection starts,
196
+ - a dynamic import with a computed path in a file that the run loads, unless `computedImports` of the package names the file with a reason.
197
+
198
+ The related mode does not follow a computed import. A test file that reaches the mutated files only through this import thus starts in no selection, and each mutant that it detects survives.
199
+
200
+ ```json
201
+ { "computedImports": { "src/load-all.test.ts": "it imports each module of src/ops, and ops.test.ts tests each module" } }
202
+ ```
165
203
 
166
204
  On a fault, the check fails with a line that starts with `No read`. A score of that package is not a reading.
167
205
 
package/build/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as runCli } from "./run-DSF8ITXj.js";
2
+ import { n as runCli } from "./run-DcH6lUvo.js";
3
3
  // src/cli.ts
4
4
  try {
5
5
  process.exitCode = runCli(process.argv.slice(2), {
package/build/collect.js CHANGED
@@ -1,39 +1,58 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from "node:module";
3
3
  import { join, relative, resolve } from "node:path";
4
- import { realpathSync, writeFileSync } from "node:fs";
4
+ import { readFileSync, realpathSync, writeFileSync } from "node:fs";
5
5
  import { pathToFileURL } from "node:url";
6
6
  // src/collect.ts
7
7
  /**
8
8
  * The collect of `load-check --collect`. The CLI starts this file in a new process for each package:
9
- * `node collect.ts <dir> <out> [<vitest config>]`. It loads the Vitest that the folder of the package resolves. That
10
- * Vitest collects each test file, and the script writes a `Collected` as JSON to `<out>`.
9
+ * `node collect.ts <request> <out>`. The request is a `CollectRequest` as JSON. The script loads the Vitest that the
10
+ * folder resolves. That Vitest collects each test file, and the script writes a `Collected` as JSON to `<out>`.
11
11
  *
12
12
  * The option `staticParse: false` makes Vitest start each file. Under Vitest 5 the default form only parses a file, so
13
- * it does not find a missing package.
13
+ * it does not find a missing package. Then for each selection, the script sets `related` to its mutated files. It reads
14
+ * the test files that the related mode starts, as the runner of Stryker does.
14
15
  */
15
- const [dir, out, config] = process.argv.slice(2);
16
- if (dir === void 0 || out === void 0) throw new Error("collect.ts takes <dir> <out> [<vitest config>]");
17
- const root = resolve(dir);
16
+ const [requestFile, out] = process.argv.slice(2);
17
+ if (requestFile === void 0 || out === void 0) throw new Error("collect.ts takes <request> <out>");
18
+ const request = JSON.parse(readFileSync(requestFile, "utf8"));
19
+ const root = resolve(request.dir);
20
+ const fromRoot = (file) => relative(root, file).replaceAll("\\", "/");
18
21
  const entry = createRequire(join(root, "package.json")).resolve("vitest/node");
19
22
  const vitestNode = await import(pathToFileURL(entry).href);
20
23
  process.chdir(root);
24
+ const config = request.config === void 0 ? {} : { config: resolve(root, request.config) };
21
25
  const vitest = await vitestNode.createVitest("test", {
22
26
  root,
23
27
  watch: false,
24
- ...config === void 0 ? {} : { config: resolve(root, config) }
28
+ ...config
25
29
  });
26
30
  try {
27
31
  const { testModules, unhandledErrors } = await vitest.collect(void 0, { staticParse: false });
32
+ const message = (e) => e instanceof Error ? e.message : String(e);
33
+ const unhandled = unhandledErrors.map(message);
34
+ const selections = {};
35
+ for (const [name, files] of Object.entries(request.selections)) {
36
+ selections[name] = [];
37
+ if (files.length === 0) continue;
38
+ vitest.config.related = files.map((f) => resolve(root, f));
39
+ try {
40
+ const specifications = await vitest.getRelevantTestSpecifications();
41
+ selections[name] = [...new Set(specifications.map((s) => fromRoot(s.moduleId)))].toSorted();
42
+ } catch (e) {
43
+ unhandled.push(`the related mode of Vitest failed for the selection ${name}: ${message(e)}`);
44
+ }
45
+ }
28
46
  const collected = {
29
47
  version: vitestNode.version,
30
48
  path: realpathSync(entry).replaceAll("\\", "/"),
31
49
  files: testModules.map((m) => ({
32
- file: relative(root, m.moduleId).replaceAll("\\", "/"),
50
+ file: fromRoot(m.moduleId),
33
51
  errors: m.errors().map((e) => e.message),
34
52
  children: m.children.size
35
53
  })),
36
- unhandled: unhandledErrors.map((e) => e instanceof Error ? e.message : String(e))
54
+ unhandled,
55
+ selections
37
56
  };
38
57
  writeFileSync(out, `${JSON.stringify(collected)}\n`);
39
58
  process.exitCode = 0;
@@ -1 +1 @@
1
- {"version":3,"file":"collect.js","names":[],"sources":["../src/collect.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * The collect of `load-check --collect`. The CLI starts this file in a new process for each package:\n * `node collect.ts <dir> <out> [<vitest config>]`. It loads the Vitest that the folder of the package resolves. That\n * Vitest collects each test file, and the script writes a `Collected` as JSON to `<out>`.\n *\n * The option `staticParse: false` makes Vitest start each file. Under Vitest 5 the default form only parses a file, so\n * it does not find a missing package.\n */\nimport { realpathSync, writeFileSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { join, relative, resolve } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport type { Collected } from \"./load.ts\";\n\nconst [dir, out, config] = process.argv.slice(2);\nif (dir === undefined || out === undefined) throw new Error(\"collect.ts takes <dir> <out> [<vitest config>]\");\nconst root = resolve(dir);\n// Each package reads the Vitest of its own folder, as the runner of Stryker does.\nconst entry = createRequire(join(root, \"package.json\")).resolve(\"vitest/node\");\nconst vitestNode = (await import(pathToFileURL(entry).href)) as typeof import(\"vitest/node\");\nprocess.chdir(root);\nconst vitest = await vitestNode.createVitest(\"test\", { root, watch: false, ...(config === undefined ? {} : { config: resolve(root, config) }) });\ntry {\n const { testModules, unhandledErrors } = await vitest.collect(undefined, { staticParse: false });\n const collected: Collected = {\n version: vitestNode.version,\n path: realpathSync(entry).replaceAll(\"\\\\\", \"/\"),\n files: testModules.map((m) => ({\n file: relative(root, m.moduleId).replaceAll(\"\\\\\", \"/\"),\n errors: m.errors().map((e) => e.message),\n children: m.children.size,\n })),\n unhandled: unhandledErrors.map((e) => (e instanceof Error ? e.message : String(e))),\n };\n writeFileSync(out, `${JSON.stringify(collected)}\\n`);\n // Vitest sets the exit code 1 for a file that does not load. The file of the collect gives that fault.\n process.exitCode = 0;\n} finally {\n await vitest.close();\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAM,CAAC,KAAK,KAAK,UAAU,QAAQ,KAAK,MAAM,CAAC;AAC/C,IAAI,QAAQ,KAAA,KAAa,QAAQ,KAAA,GAAW,MAAM,IAAI,MAAM,gDAAgD;AAC5G,MAAM,OAAO,QAAQ,GAAG;AAExB,MAAM,QAAQ,cAAc,KAAK,MAAM,cAAc,CAAC,CAAC,CAAC,QAAQ,aAAa;AAC7E,MAAM,aAAc,MAAM,OAAO,cAAc,KAAK,CAAC,CAAC;AACtD,QAAQ,MAAM,IAAI;AAClB,MAAM,SAAS,MAAM,WAAW,aAAa,QAAQ;CAAE;CAAM,OAAO;CAAO,GAAI,WAAW,KAAA,IAAY,CAAC,IAAI,EAAE,QAAQ,QAAQ,MAAM,MAAM,EAAE;AAAG,CAAC;AAC/I,IAAI;CACF,MAAM,EAAE,aAAa,oBAAoB,MAAM,OAAO,QAAQ,KAAA,GAAW,EAAE,aAAa,MAAM,CAAC;CAC/F,MAAM,YAAuB;EAC3B,SAAS,WAAW;EACpB,MAAM,aAAa,KAAK,CAAC,CAAC,WAAW,MAAM,GAAG;EAC9C,OAAO,YAAY,KAAK,OAAO;GAC7B,MAAM,SAAS,MAAM,EAAE,QAAQ,CAAC,CAAC,WAAW,MAAM,GAAG;GACrD,QAAQ,EAAE,OAAO,CAAC,CAAC,KAAK,MAAM,EAAE,OAAO;GACvC,UAAU,EAAE,SAAS;EACvB,EAAE;EACF,WAAW,gBAAgB,KAAK,MAAO,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC,CAAE;CACpF;CACA,cAAc,KAAK,GAAG,KAAK,UAAU,SAAS,EAAE,GAAG;CAEnD,QAAQ,WAAW;AACrB,UAAU;CACR,MAAM,OAAO,MAAM;AACrB"}
1
+ {"version":3,"file":"collect.js","names":[],"sources":["../src/collect.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * The collect of `load-check --collect`. The CLI starts this file in a new process for each package:\n * `node collect.ts <request> <out>`. The request is a `CollectRequest` as JSON. The script loads the Vitest that the\n * folder resolves. That Vitest collects each test file, and the script writes a `Collected` as JSON to `<out>`.\n *\n * The option `staticParse: false` makes Vitest start each file. Under Vitest 5 the default form only parses a file, so\n * it does not find a missing package. Then for each selection, the script sets `related` to its mutated files. It reads\n * the test files that the related mode starts, as the runner of Stryker does.\n */\nimport { readFileSync, realpathSync, writeFileSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { join, relative, resolve } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport type { Collected, CollectRequest } from \"./load.ts\";\n\nconst [requestFile, out] = process.argv.slice(2);\nif (requestFile === undefined || out === undefined) throw new Error(\"collect.ts takes <request> <out>\");\nconst request = JSON.parse(readFileSync(requestFile, \"utf8\")) as CollectRequest;\nconst root = resolve(request.dir);\nconst fromRoot = (file: string): string => relative(root, file).replaceAll(\"\\\\\", \"/\");\n// Each package reads the Vitest of its own folder, as the runner of Stryker does.\nconst entry = createRequire(join(root, \"package.json\")).resolve(\"vitest/node\");\nconst vitestNode = (await import(pathToFileURL(entry).href)) as typeof import(\"vitest/node\");\nprocess.chdir(root);\nconst config = request.config === undefined ? {} : { config: resolve(root, request.config) };\nconst vitest = await vitestNode.createVitest(\"test\", { root, watch: false, ...config });\ntry {\n const { testModules, unhandledErrors } = await vitest.collect(undefined, { staticParse: false });\n const message = (e: unknown): string => (e instanceof Error ? e.message : String(e));\n const unhandled = unhandledErrors.map(message);\n const selections: Record<string, string[]> = {};\n for (const [name, files] of Object.entries(request.selections)) {\n selections[name] = [];\n // An empty list of related files makes Vitest start each test file, so a selection with no file starts none.\n if (files.length === 0) continue;\n (vitest.config as { related?: string[] }).related = files.map((f) => resolve(root, f));\n try {\n const specifications = await vitest.getRelevantTestSpecifications();\n selections[name] = [...new Set(specifications.map((s) => fromRoot(s.moduleId)))].toSorted();\n } catch (e) {\n unhandled.push(`the related mode of Vitest failed for the selection ${name}: ${message(e)}`);\n }\n }\n const collected: Collected = {\n version: vitestNode.version,\n path: realpathSync(entry).replaceAll(\"\\\\\", \"/\"),\n files: testModules.map((m) => ({ file: fromRoot(m.moduleId), errors: m.errors().map((e) => e.message), children: m.children.size })),\n unhandled,\n selections,\n };\n writeFileSync(out, `${JSON.stringify(collected)}\\n`);\n // Vitest sets the exit code 1 for a file that does not load. The file of the collect gives that fault.\n process.exitCode = 0;\n} finally {\n await vitest.close();\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAM,CAAC,aAAa,OAAO,QAAQ,KAAK,MAAM,CAAC;AAC/C,IAAI,gBAAgB,KAAA,KAAa,QAAQ,KAAA,GAAW,MAAM,IAAI,MAAM,kCAAkC;AACtG,MAAM,UAAU,KAAK,MAAM,aAAa,aAAa,MAAM,CAAC;AAC5D,MAAM,OAAO,QAAQ,QAAQ,GAAG;AAChC,MAAM,YAAY,SAAyB,SAAS,MAAM,IAAI,CAAC,CAAC,WAAW,MAAM,GAAG;AAEpF,MAAM,QAAQ,cAAc,KAAK,MAAM,cAAc,CAAC,CAAC,CAAC,QAAQ,aAAa;AAC7E,MAAM,aAAc,MAAM,OAAO,cAAc,KAAK,CAAC,CAAC;AACtD,QAAQ,MAAM,IAAI;AAClB,MAAM,SAAS,QAAQ,WAAW,KAAA,IAAY,CAAC,IAAI,EAAE,QAAQ,QAAQ,MAAM,QAAQ,MAAM,EAAE;AAC3F,MAAM,SAAS,MAAM,WAAW,aAAa,QAAQ;CAAE;CAAM,OAAO;CAAO,GAAG;AAAO,CAAC;AACtF,IAAI;CACF,MAAM,EAAE,aAAa,oBAAoB,MAAM,OAAO,QAAQ,KAAA,GAAW,EAAE,aAAa,MAAM,CAAC;CAC/F,MAAM,WAAW,MAAwB,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;CAClF,MAAM,YAAY,gBAAgB,IAAI,OAAO;CAC7C,MAAM,aAAuC,CAAC;CAC9C,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,QAAQ,UAAU,GAAG;EAC9D,WAAW,QAAQ,CAAC;EAEpB,IAAI,MAAM,WAAW,GAAG;EACxB,OAAQ,OAAkC,UAAU,MAAM,KAAK,MAAM,QAAQ,MAAM,CAAC,CAAC;EACrF,IAAI;GACF,MAAM,iBAAiB,MAAM,OAAO,8BAA8B;GAClE,WAAW,QAAQ,CAAC,GAAG,IAAI,IAAI,eAAe,KAAK,MAAM,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;EAC5F,SAAS,GAAG;GACV,UAAU,KAAK,uDAAuD,KAAK,IAAI,QAAQ,CAAC,GAAG;EAC7F;CACF;CACA,MAAM,YAAuB;EAC3B,SAAS,WAAW;EACpB,MAAM,aAAa,KAAK,CAAC,CAAC,WAAW,MAAM,GAAG;EAC9C,OAAO,YAAY,KAAK,OAAO;GAAE,MAAM,SAAS,EAAE,QAAQ;GAAG,QAAQ,EAAE,OAAO,CAAC,CAAC,KAAK,MAAM,EAAE,OAAO;GAAG,UAAU,EAAE,SAAS;EAAK,EAAE;EACnI;EACA;CACF;CACA,cAAc,KAAK,GAAG,KAAK,UAAU,SAAS,EAAE,GAAG;CAEnD,QAAQ,WAAW;AACrB,UAAU;CACR,MAAM,OAAO,MAAM;AACrB"}
package/build/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as PartialLine, r as PartialReporter, t as PARTIAL_FILE } from "./reporter-CkdX8IPx.js";
1
+ import { C as staticFaults, S as readPlan, _ as TestOfDryRun, b as filePlans, c as LinePlan, d as PlanLimits, f as PlanOfMutant, g as TARGET_MINUTES, h as SelectionPlan, i as ReporterOptions, l as PLAN_FILE, m as STOP_MINUTES, n as PartialLine, p as PlanRead, r as PartialReporter, s as FilePlan, t as PARTIAL_FILE, u as PLAN_PER_CLOCK, v as TestPlan, w as testPlans, x as parsePlan, y as clockMinutes } from "./reporter-BS3LIodv.js";
2
2
  /**
3
3
  * The lane file of a repository (`mutation.json`) names the packages that the mutation tests mutate. A package has
4
4
  * its folder, its globs and an optional gate. A big package has parts, so that each part has its own runner.
@@ -44,6 +44,16 @@ interface PackageLane {
44
44
  * --test-files` fails for each other test file on the disk that the report does not read. The file is from `dir`.
45
45
  */
46
46
  readonly notRead?: Readonly<Record<string, string>>;
47
+ /**
48
+ * Each file of this field has a dynamic import with a computed path, and the value gives the reason. The related walk
49
+ * of Vitest does not follow this type of import. `load-check --collect` fails for each other file of the run with one.
50
+ */
51
+ readonly computedImports?: Readonly<Record<string, string>>;
52
+ /**
53
+ * This field gives the most static runs in the plan of each file, from `dir`. The key `*` gives the limit of each other
54
+ * file. A static run starts each test. `plan-check` fails a file over its limit.
55
+ */
56
+ readonly staticLimits?: Readonly<Record<string, number>>;
47
57
  }
48
58
  /** The keys of the Stryker config that the lane owns. The field `stryker` of a package cannot have them. */
49
59
  export declare const STRYKER_OWNED: readonly string[];
@@ -59,6 +69,12 @@ interface Lane {
59
69
  readonly maxTestFall?: number;
60
70
  /** Each selection of this field can have a higher fall of its test count. The value gives the reason. */
61
71
  readonly plannedFalls?: Readonly<Record<string, string>>;
72
+ /** This field gives the planned net time of one minute of the clock, for the estimate of `plan-check`. The default is 9.8. */
73
+ readonly planPerClock?: number;
74
+ /** This field gives the target of the estimate of a selection, in minutes. `plan-check` warns of a selection over it. The default is 100. */
75
+ readonly targetMinutes?: number;
76
+ /** This field gives the stop of the estimate of a selection, in minutes. `plan-check` fails a selection over it. The default is 140. */
77
+ readonly stopMinutes?: number;
62
78
  }
63
79
  /** A selection is one Stryker run: a package (`collections`) or a part of a package (`collections.impl`). */
64
80
  interface Selection {
@@ -120,6 +136,11 @@ interface ConfigOptions {
120
136
  * test. Use it to see if the tests pass under Stryker before a long run.
121
137
  */
122
138
  readonly dryRun?: boolean;
139
+ /**
140
+ * When this option is true, Stryker starts the tests without mutants and makes its plan. The reporter `rigor-partial`
141
+ * writes the plan into `plan.json` and stops Stryker. No mutant runs. `plan-check` reads the plan.
142
+ */
143
+ readonly plan?: boolean;
123
144
  /**
124
145
  * When this option is false, Stryker does not rewrite the tsconfig of the package in its sandbox. The default is true.
125
146
  * The rewrite uses `parseConfigFileTextToJson`, and TypeScript 7 does not have it. Refer to `rewritesTsconfig`.
@@ -154,6 +175,9 @@ interface StrykerConfig {
154
175
  readonly tsconfigFile?: string;
155
176
  readonly dryRunOnly?: true;
156
177
  readonly disableBail?: true;
178
+ readonly rigorPartial?: {
179
+ readonly stopAfterPlan: true;
180
+ };
157
181
  }
158
182
  /**
159
183
  * The file URL of the module of the reporter `rigor-partial`: the source in the workspace, the build in the package of
@@ -371,6 +395,22 @@ export declare function isConfigFile(file: string, vitestConfig?: string): boole
371
395
  * @param vitestConfig - the field `vitestConfig` of the lane
372
396
  */
373
397
  export declare function leavingPaths(files: readonly PackageFile[], vitestConfig?: string): LeavingPath[];
398
+ /** A dynamic import with a computed path in a file that the run loads. */
399
+ interface ComputedImport {
400
+ /** The file, from the folder of the package, with `/`. */
401
+ readonly file: string;
402
+ /** The line of the import, from 1. */
403
+ readonly line: number;
404
+ }
405
+ /**
406
+ * This function gives each dynamic import with a computed path in the files that the run loads. The related walk of
407
+ * Vitest does not follow this type of import. So no selection starts a test file that reaches the mutated files only through
408
+ * it, and each mutant of these files survives. The function does not read comments and config files.
409
+ *
410
+ * @param files - the files of the package, from its folder
411
+ * @param vitestConfig - the field `vitestConfig` of the lane
412
+ */
413
+ export declare function computedImports(files: readonly PackageFile[], vitestConfig?: string): ComputedImport[];
374
414
  /**
375
415
  * This function gives the test files that the related mode of the Vitest runner starts for a selection. A test file
376
416
  * is related when it loads a file of the selection, directly or through other files of the package. The function
@@ -398,6 +438,8 @@ interface Collected {
398
438
  readonly files: readonly CollectedFile[];
399
439
  /** The messages of the errors outside a test file. */
400
440
  readonly unhandled: readonly string[];
441
+ /** The test files that the related mode of Vitest starts for each selection, by the name of the selection. */
442
+ readonly selections: Readonly<Record<string, readonly string[]>>;
401
443
  }
402
444
  /**
403
445
  * This function gives the reason of each fault of a collect. A test file that does not load gives no failed test, so
@@ -417,5 +459,5 @@ interface CliIo {
417
459
  export declare const HELP: string;
418
460
  /** This function starts the CLI with its arguments and gives the exit code. */
419
461
  export declare function runCli(argv: readonly string[], io: CliIo): number;
420
- export { type CliIo, type Collected, type CollectedFile, type ConfigOptions, type Disable, type DisableCheck, type Lane, type LeavingPath, type Mutant, type MutationReport, PARTIAL_FILE, type PackageFile, type PackageLane, type PartialCosts, type PartialLine, PartialReporter, type PartialRun, type Score, type ScoreOutcome, type Selection, type StrykerConfig };
462
+ export { type CliIo, type Collected, type CollectedFile, type ComputedImport, type ConfigOptions, type Disable, type DisableCheck, type FilePlan, type Lane, type LeavingPath, type LinePlan, type Mutant, type MutationReport, PARTIAL_FILE, PLAN_FILE, PLAN_PER_CLOCK, type PackageFile, type PackageLane, type PartialCosts, type PartialLine, PartialReporter, type PartialRun, type PlanLimits, type PlanOfMutant, type PlanRead, type ReporterOptions, STOP_MINUTES, type Score, type ScoreOutcome, type Selection, type SelectionPlan, type StrykerConfig, TARGET_MINUTES, type TestOfDryRun, type TestPlan, clockMinutes, filePlans, parsePlan, readPlan, staticFaults, testPlans };
421
463
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/lane.ts","../src/config.ts","../src/score.ts","../src/disables.ts","../src/load.ts","../src/run.ts"],"mappings":";;;;;;UAQiB;;WAEN;;;;;WAKA;;;;;;WAMA,QAAQ,SAAS;;WAEjB;;;;;WAKA;;WAEA;;;;;WAKA;;WAEA;;;;;WAKA,UAAU,SAAS;;;;;WAKnB,UAAU,SAAS;;;qBAIjB;;UAGI;WACN,UAAU,SAAS,eAAe;;WAElC;;;;;WAKA;;WAEA,eAAe,SAAS;;;UAOlB;WACN;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,SAAS,SAAS;;;;;;;wBAyDb,UAAU,gBAAgB;;wBAk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mB;;wBA+BlF,gBAAgB,gBAAgB,WAAW,iBAAiB,YAAY;;UC9CvE;;WAEN;;WAEA;;WAEA;;;UAIM;;WAEN;WACA;;;;;;;;wBAoBK,aAAa,cAAc;;;;;;;;;;wBAsC3B,aAAa,gBAAgB,eAAe,wBAAwB;;;;;;;;;wBAqCpE,iBAAiB,gBAAgB,eAAe,WAAW;;UA0B1D;;WAEN;;WAEA;;WAEA;;;UAIM;;WAEN;;WAEA;WACA,gBAAgB;;WAEhB;;;;;;;wBAQK,cAAc,WAAW;;UCtJxB;WACN;WACA,SAAS;WACT,SAAS;;WAET,MAAM,SAAS;;;qBAIb;;wBAibG,OAAO,yBAAyB,IAAI"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/lane.ts","../src/config.ts","../src/score.ts","../src/disables.ts","../src/load.ts","../src/run.ts"],"mappings":";;;;;;UASiB;;WAEN;;;;;WAKA;;;;;;WAMA,QAAQ,SAAS;;WAEjB;;;;;WAKA;;WAEA;;;;;WAKA;;WAEA;;;;;WAKA,UAAU,SAAS;;;;;WAKnB,UAAU,SAAS;;;;;WAKnB,kBAAkB,SAAS;;;;;WAK3B,eAAe,SAAS;;;qBAItB;;UAGI;WACN,UAAU,SAAS,eAAe;;WAElC;;;;;WAKA;;WAEA,eAAe,SAAS;;WAExB;;WAEA;;WAEA;;;UAOM;WACN;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,SAAS,SAAS;;;;;;;wBA8Db,UAAU,gBAAgB;;wBAyB1B,eAAe,MAAM;;wBAKrB,cAAc,MAAM;;;;;;wBASpB,OAAO,MAAM,MAAM,eAAe;;;;;;;;;wBAoElC,aAAa,WAAW,WAAW,4BAA4B,UAAS;;;;;;;;;;;;wBAkDxE,WAAW,MAAM,MAAM,aAAa,0BAA0B,SAAS;;UCzTtE;;WAEN;;WAEA;;;;;WAKA;;;;;WAKA;;;;;WAKA;;;UAIM;;WAEN;WACA;WACA;aAAoB;;WACpB;WACA;WACA;WACA;aAAyB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iB,gBAAgB,eAAe,WAAW;;UA0B1D;;WAEN;;WAEA;;WAEA;;;UAIM;;WAEN;;WAEA;WACA,gBAAgB;;WAEhB;;WAEA,YAAY,SAAS;;;;;;;wBAkBhB,cAAc,WAAW;;UCtMxB;WACN;WACA,SAAS;WACT,SAAS;;WAET,MAAM,SAAS;;;qBAIb;;wBAqhBG,OAAO,yBAAyB,IAAI"}
package/build/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { A as selectionNames, C as strykerConfig, D as partErrors, E as parseLane, O as runSelections, S as rewritesTsconfig, T as changedFiles, _ as DRY_RUN_TIMEOUT_MINUTES, a as leavingPaths, b as REPORT_DIR, c as findDisables, d as packageScore, f as parsePartial, g as summaryMarkdown, h as scoreReport, i as isConfigFile, k as select, l as formatScore, m as partialScore, n as runCli, o as relatedTestFiles, p as parseReport, r as collectFaults, s as compareDisables, t as HELP, u as isHitLimit, v as NO_TSCONFIG, w as STRYKER_OWNED, x as TIMEOUT_MS, y as PARTIAL_PLUGIN } from "./run-DSF8ITXj.js";
2
- import { n as PartialReporter, t as PARTIAL_FILE } from "./reporter-Cypwcaj9.js";
3
- export { DRY_RUN_TIMEOUT_MINUTES, HELP, NO_TSCONFIG, PARTIAL_FILE, PARTIAL_PLUGIN, PartialReporter, REPORT_DIR, STRYKER_OWNED, TIMEOUT_MS, changedFiles, collectFaults, compareDisables, findDisables, formatScore, isConfigFile, isHitLimit, leavingPaths, packageScore, parseLane, parsePartial, parseReport, partErrors, partialScore, relatedTestFiles, rewritesTsconfig, runCli, runSelections, scoreReport, select, selectionNames, strykerConfig, summaryMarkdown };
1
+ import { a as PLAN_FILE, c as TARGET_MINUTES, d as parsePlan, f as readPlan, l as clockMinutes, m as testPlans, n as PartialReporter, o as PLAN_PER_CLOCK, p as staticFaults, s as STOP_MINUTES, t as PARTIAL_FILE, u as filePlans } from "./reporter-BYC384h-.js";
2
+ import { A as select, C as rewritesTsconfig, D as parseLane, E as changedFiles, O as partErrors, S as TIMEOUT_MS, T as STRYKER_OWNED, _ as summaryMarkdown, a as isConfigFile, b as PARTIAL_PLUGIN, c as compareDisables, d as isHitLimit, f as packageScore, g as scoreReport, h as partialScore, i as computedImports, j as selectionNames, k as runSelections, l as findDisables, m as parseReport, n as runCli, o as leavingPaths, p as parsePartial, r as collectFaults, s as relatedTestFiles, t as HELP, u as formatScore, v as DRY_RUN_TIMEOUT_MINUTES, w as strykerConfig, x as REPORT_DIR, y as NO_TSCONFIG } from "./run-DcH6lUvo.js";
3
+ export { DRY_RUN_TIMEOUT_MINUTES, HELP, NO_TSCONFIG, PARTIAL_FILE, PARTIAL_PLUGIN, PLAN_FILE, PLAN_PER_CLOCK, PartialReporter, REPORT_DIR, STOP_MINUTES, STRYKER_OWNED, TARGET_MINUTES, TIMEOUT_MS, changedFiles, clockMinutes, collectFaults, compareDisables, computedImports, filePlans, findDisables, formatScore, isConfigFile, isHitLimit, leavingPaths, packageScore, parseLane, parsePartial, parsePlan, parseReport, partErrors, partialScore, readPlan, relatedTestFiles, rewritesTsconfig, runCli, runSelections, scoreReport, select, selectionNames, staticFaults, strykerConfig, summaryMarkdown, testPlans };
@@ -0,0 +1,219 @@
1
+ /**
2
+ * The cost plan of a selection. Stryker makes a plan of the mutants after the run of the tests without mutants. The
3
+ * reporter `rigor-partial` writes the plan of each file and each line into `plan.json`. `plan-check` reads the file and
4
+ * gives the estimate of the clock of the selection. It warns of a selection over its target. It fails a selection over
5
+ * its stop, and a file over its limit of static runs. The cut of the parts can then follow the cost of the lines, and
6
+ * not the size of the files.
7
+ */
8
+ /** The name of the file of the plan, in the folder of the JSON report. */
9
+ declare const PLAN_FILE = "plan.json";
10
+ /**
11
+ * The default planned net time of one minute of the clock. In a nightly run of Vex (GitHub Actions, 2 test processes),
12
+ * the mutants that ended had 9.8 to 11.7 times the planned time of their clock. The lower value gives the longer estimate.
13
+ */
14
+ declare const PLAN_PER_CLOCK = 9.8;
15
+ /** The default target of the estimate of a selection, in minutes. A slow runner then ends a job of 150 minutes. */
16
+ declare const TARGET_MINUTES = 100;
17
+ /**
18
+ * The default stop of the estimate of a selection, in minutes. A selection over it does not end before the limit of the
19
+ * job, so it cannot give a full score. The estimate has an error of 28 minutes in the mean, so the target only warns.
20
+ */
21
+ declare const STOP_MINUTES = 140;
22
+ /** The parts of a plan of Stryker for one mutant that the reporter reads. */
23
+ interface PlanOfMutant {
24
+ readonly plan: string;
25
+ readonly mutant: {
26
+ readonly id: string;
27
+ readonly fileName: string;
28
+ readonly static?: boolean;
29
+ /** The start of the mutant. In a plan, Stryker counts the lines from 0. */
30
+ readonly location?: {
31
+ readonly start: {
32
+ readonly line: number;
33
+ };
34
+ };
35
+ };
36
+ readonly netTime?: number;
37
+ /** The tests that Stryker starts for the mutant. With no filter, Stryker starts all tests, as for a static mutant. */
38
+ readonly runOptions?: {
39
+ readonly timeout?: number;
40
+ readonly testFilter?: readonly string[];
41
+ };
42
+ }
43
+ /** The parts of a test of the run without mutants that the reporter reads. */
44
+ interface TestOfDryRun {
45
+ readonly id: string;
46
+ readonly name: string;
47
+ readonly fileName?: string;
48
+ readonly timeSpentMs: number;
49
+ }
50
+ /** The plan of one line: the line from 1, the runs that start on it, the static runs of them, and their planned net time. */
51
+ type LinePlan = readonly [line: number, runs: number, staticRuns: number, netMs: number];
52
+ /** The plan of one file of a selection. */
53
+ interface FilePlan {
54
+ /** The mutants of the file, with the mutants that have an early result. */
55
+ readonly mutants: number;
56
+ readonly runs: number;
57
+ readonly static: number;
58
+ readonly netMs: number;
59
+ readonly limitMs: number;
60
+ /** The plan of each line with a run, in the order of the lines. */
61
+ readonly lines: readonly LinePlan[];
62
+ }
63
+ /** The plan of one test: its name, its file, its time without mutants, the runs that start it, and their product. */
64
+ type TestPlan = readonly [name: string, file: string, ms: number, runs: number, costMs: number];
65
+ /** The content of `plan.json`. The paths of the files are from the folder where Stryker starts. */
66
+ interface SelectionPlan {
67
+ readonly files: Readonly<Record<string, FilePlan>>;
68
+ readonly tests: readonly TestPlan[];
69
+ }
70
+ /** This function gives the plan of each file: its mutants, the mutants that Stryker starts, and their planned times. */
71
+ declare function filePlans(plans: readonly PlanOfMutant[], path?: (fileName: string) => string): Record<string, FilePlan>;
72
+ /**
73
+ * This function gives the tests of the largest planned cost, the largest first. The cost of a test is its time without
74
+ * mutants, times the runs that start it. A test with a large cost is the first place to make the selection faster.
75
+ */
76
+ declare function testPlans(plans: readonly PlanOfMutant[], tests: readonly TestOfDryRun[], path?: (fileName: string) => string, top?: number): TestPlan[];
77
+ /** This function gives the estimate of the minutes of the clock of a planned net time. */
78
+ declare function clockMinutes(netMs: number, planPerClock?: number): number;
79
+ /** The read of the plan of a selection. */
80
+ interface PlanRead {
81
+ readonly runs: number;
82
+ readonly static: number;
83
+ readonly netMs: number;
84
+ /** The estimate of the clock of the selection, in minutes. */
85
+ readonly minutes: number;
86
+ /** One line for a selection over its stop, and one for each file over its limit of static runs. */
87
+ readonly faults: readonly string[];
88
+ /** One line for a selection over its target and under its stop. */
89
+ readonly warnings: readonly string[];
90
+ /** The line of the plan of the selection, with its estimate. */
91
+ readonly line: string;
92
+ }
93
+ /** The limits of the read of a plan. */
94
+ interface PlanLimits {
95
+ readonly planPerClock?: number;
96
+ readonly targetMinutes?: number;
97
+ readonly stopMinutes?: number;
98
+ /** The most static runs of each file. The key `*` gives the limit of each file that the field does not name. */
99
+ readonly staticLimits?: Readonly<Record<string, number>>;
100
+ }
101
+ /**
102
+ * This function gives the faults of the static runs of a plan. A static run starts each test, so it costs the time of
103
+ * all tests. Code outside a function gives a static mutant.
104
+ */
105
+ declare function staticFaults(files: Readonly<Record<string, FilePlan>>, limits?: Readonly<Record<string, number>>): string[];
106
+ /** This function reads the plan of a selection: its estimate of the clock, against the target and the stop, and its static runs. */
107
+ declare function readPlan(name: string, plan: SelectionPlan, limits?: PlanLimits): PlanRead;
108
+ /**
109
+ * This function reads the JSON of `plan.json`.
110
+ *
111
+ * @throws Error when the JSON has no object `files` or no list `tests`
112
+ */
113
+ declare function parsePlan(json: unknown): SelectionPlan;
114
+ /** The name of the file of the reporter, in the folder of the JSON report. */
115
+ declare const PARTIAL_FILE = "partial.jsonl";
116
+ /** A line of `partial.jsonl`. The field `at` gives the time in milliseconds since 1970. */
117
+ type PartialLine = {
118
+ readonly event: "start";
119
+ readonly at: number;
120
+ } | {
121
+ readonly event: "plan";
122
+ readonly at: number;
123
+ readonly mutants: number;
124
+ readonly run: number;
125
+ } | {
126
+ readonly event: "mutant";
127
+ readonly at: number;
128
+ readonly file: string;
129
+ readonly status: string;
130
+ readonly statusReason?: string;
131
+ readonly mutatorName: string;
132
+ readonly line: number;
133
+ /** The planned net time of the mutant in milliseconds. A mutant with an early result has none. */
134
+ readonly netMs?: number;
135
+ /** The time limit of the mutant in milliseconds. A mutant that the clock stops costs this time. */
136
+ readonly limitMs?: number;
137
+ readonly static?: boolean;
138
+ } | {
139
+ readonly event: "done";
140
+ readonly at: number;
141
+ };
142
+ /** The parts of a Stryker mutant result that the reporter reads. */
143
+ interface TestedMutant {
144
+ readonly id?: string;
145
+ readonly fileName: string;
146
+ readonly status: string;
147
+ readonly statusReason?: string;
148
+ readonly mutatorName: string;
149
+ readonly location: {
150
+ readonly start: {
151
+ readonly line: number;
152
+ };
153
+ };
154
+ }
155
+ /** The options of Stryker that the reporter reads. */
156
+ interface ReporterOptions {
157
+ readonly jsonReporter?: {
158
+ readonly fileName?: string;
159
+ };
160
+ /** With `stopAfterPlan` at true, the reporter stops Stryker after it writes the plan, before the first mutant. */
161
+ readonly rigorPartial?: {
162
+ readonly stopAfterPlan?: boolean;
163
+ };
164
+ }
165
+ /** The reporter. Stryker gives it its options, and `now`, `cwd` and `exit` are for the tests. */
166
+ declare class PartialReporter {
167
+ static readonly inject: readonly ["options"];
168
+ readonly file: string;
169
+ /** The file of the cost plan, in the folder of the JSON report. */
170
+ readonly planFile: string;
171
+ private readonly now;
172
+ private readonly cwd;
173
+ private readonly exit;
174
+ private readonly stopAfterPlan;
175
+ private tests;
176
+ private runs;
177
+ constructor(options: ReporterOptions, now?: () => number, cwd?: string, exit?: (code: number) => void);
178
+ onDryRunCompleted(event: {
179
+ readonly result: {
180
+ readonly tests: readonly TestOfDryRun[];
181
+ };
182
+ }): void;
183
+ onMutationTestingPlanReady(event: {
184
+ readonly mutantPlans: readonly PlanOfMutant[];
185
+ }): void;
186
+ onMutantTested(result: TestedMutant): void;
187
+ onMutationTestReportReady(): void;
188
+ /** This function gives the path of a file from the folder where Stryker starts, with `/`. */
189
+ private readonly path;
190
+ private write;
191
+ }
192
+ /** The schema of the option of the reporter. Stryker adds it to its own schema, so the option gives no warning. */
193
+ declare const strykerValidationSchema: {
194
+ readonly $schema: "http://json-schema.org/draft-07/schema";
195
+ readonly type: "object";
196
+ readonly properties: {
197
+ readonly rigorPartial: {
198
+ readonly description: "The options of the reporter rigor-partial.";
199
+ readonly type: "object";
200
+ readonly properties: {
201
+ readonly stopAfterPlan: {
202
+ readonly description: "Stop Stryker after the reporter writes the plan.";
203
+ readonly type: "boolean";
204
+ readonly default: false;
205
+ };
206
+ };
207
+ readonly additionalProperties: false;
208
+ readonly default: {};
209
+ };
210
+ };
211
+ };
212
+ /** The plugins of this module, in the form of `declareClassPlugin` of `@stryker-mutator/api/plugin`. */
213
+ declare const strykerPlugins: readonly {
214
+ readonly kind: "Reporter";
215
+ readonly name: string;
216
+ readonly injectableClass: typeof PartialReporter;
217
+ }[];
218
+ export { staticFaults as C, readPlan as S, TestOfDryRun as _, strykerPlugins as a, filePlans as b, LinePlan as c, PlanLimits as d, PlanOfMutant as f, TARGET_MINUTES as g, SelectionPlan as h, ReporterOptions as i, PLAN_FILE as l, STOP_MINUTES as m, PartialLine as n, strykerValidationSchema as o, PlanRead as p, PartialReporter as r, FilePlan as s, PARTIAL_FILE as t, PLAN_PER_CLOCK as u, TestPlan as v, testPlans as w, parsePlan as x, clockMinutes as y };
219
+ //# sourceMappingURL=reporter-BS3LIodv.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporter-BS3LI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