@cnc-tools/storm 0.5.0 → 0.7.0

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.
Files changed (171) hide show
  1. package/dist/build-info.js +1 -1
  2. package/dist/combine-errors.js +2 -2
  3. package/dist/commands/dashboard.js +1 -1
  4. package/dist/commands/{run → exec}/cleanup.d.ts +1 -1
  5. package/dist/commands/{run → exec}/cleanup.js +1 -1
  6. package/dist/commands/{run/outcomes.d.ts → exec/command.d.ts} +103 -112
  7. package/dist/commands/exec/command.js +23 -0
  8. package/dist/commands/{run → exec}/job-summary.d.ts +5 -1
  9. package/dist/commands/{run → exec}/job-summary.js +5 -2
  10. package/dist/commands/{run → exec}/live-view.js +29 -13
  11. package/dist/commands/exec/metadata.d.ts +69 -0
  12. package/dist/commands/exec/metadata.js +55 -0
  13. package/dist/commands/{run → exec}/mint-failed.js +4 -4
  14. package/dist/commands/exec/outcomes.d.ts +664 -0
  15. package/dist/commands/exec/outcomes.js +347 -0
  16. package/dist/commands/{run → exec}/progress.d.ts +14 -2
  17. package/dist/commands/{run → exec}/progress.js +54 -9
  18. package/dist/commands/exec/run-command.d.ts +227 -0
  19. package/dist/commands/exec/run-command.js +696 -0
  20. package/dist/commands/exec/run-metadata.d.ts +59 -0
  21. package/dist/commands/exec/run-metadata.js +61 -0
  22. package/dist/commands/{run → exec}/run-record.d.ts +110 -5
  23. package/dist/commands/{run → exec}/run-record.js +57 -1
  24. package/dist/commands/exec/testserver-flags.d.ts +48 -0
  25. package/dist/commands/exec/testserver-flags.js +80 -0
  26. package/dist/commands/{run → exec}/view.js +36 -4
  27. package/dist/commands/runs/facts.d.ts +25 -0
  28. package/dist/commands/runs/facts.js +38 -5
  29. package/dist/commands/runs/list/command.d.ts +25 -0
  30. package/dist/commands/runs/list/outcomes.d.ts +25 -0
  31. package/dist/commands/runs/logs/metadata.js +1 -1
  32. package/dist/commands/runs/logs/outcomes.js +4 -1
  33. package/dist/commands/runs/past-run.d.ts +2 -2
  34. package/dist/commands/runs/past-run.js +2 -2
  35. package/dist/commands/runs/show/command.d.ts +25 -0
  36. package/dist/commands/runs/show/metadata.js +2 -2
  37. package/dist/commands/runs/show/outcomes.d.ts +25 -0
  38. package/dist/commands/runs/show/outcomes.js +37 -5
  39. package/dist/commands/vitest/command.d.ts +325 -0
  40. package/dist/commands/vitest/command.js +138 -0
  41. package/dist/commands/vitest/metadata.d.ts +69 -0
  42. package/dist/commands/vitest/metadata.js +35 -0
  43. package/dist/commands/vitest/outcomes.d.ts +298 -0
  44. package/dist/commands/vitest/outcomes.js +77 -0
  45. package/dist/config/index.d.ts +2 -1
  46. package/dist/config/index.js +1 -0
  47. package/dist/config/resolve.d.ts +3 -3
  48. package/dist/config/resolve.js +3 -3
  49. package/dist/config/resource-config.d.ts +2 -2
  50. package/dist/config/schema.d.ts +1 -1
  51. package/dist/config/set.d.ts +15 -4
  52. package/dist/config/set.js +28 -12
  53. package/dist/config-file/define.d.ts +8 -6
  54. package/dist/context.d.ts +6 -3
  55. package/dist/context.js +4 -2
  56. package/dist/core/command-provider.d.ts +1 -1
  57. package/dist/core/events.d.ts +9 -7
  58. package/dist/core/presentation.js +1 -1
  59. package/dist/core/presentations.js +1 -1
  60. package/dist/core/run-state.d.ts +30 -6
  61. package/dist/core/run-state.js +19 -4
  62. package/dist/core/run.d.ts +17 -4
  63. package/dist/core/run.js +61 -25
  64. package/dist/resources/testserver/command.d.ts +1 -1
  65. package/dist/resources/testserver/command.js +1 -1
  66. package/dist/resources/testserver/config.d.ts +1 -1
  67. package/dist/resources/testserver/config.js +3 -2
  68. package/dist/resources/testserver/credential-facts.js +1 -1
  69. package/dist/resources/testserver/resource.d.ts +2 -2
  70. package/dist/resources/testserver/sandbox/create.d.ts +2 -2
  71. package/dist/resources/testserver/sandbox/create.js +2 -2
  72. package/dist/resources.d.ts +9 -6
  73. package/dist/resources.js +3 -3
  74. package/dist/runner/events.d.ts +64 -1
  75. package/dist/runner/gateways.d.ts +17 -6
  76. package/dist/runner/index.d.ts +5 -4
  77. package/dist/runner/index.js +4 -3
  78. package/dist/runner/live/snapshot-records.js +18 -4
  79. package/dist/runner/prepare.d.ts +23 -4
  80. package/dist/runner/prepare.js +13 -3
  81. package/dist/runner/ready.d.ts +7 -3
  82. package/dist/runner/ready.js +11 -5
  83. package/dist/runner/scope.d.ts +17 -1
  84. package/dist/runner/scope.js +4 -0
  85. package/dist/runner/snapshot-build.d.ts +3 -1
  86. package/dist/runner/snapshot-build.js +12 -2
  87. package/dist/runner/snapshot-cache.d.ts +46 -8
  88. package/dist/runner/snapshot-cache.js +60 -11
  89. package/dist/runner/snapshot-key.d.ts +12 -1
  90. package/dist/runner/snapshot-key.js +17 -1
  91. package/dist/runner/snapshot-save.d.ts +53 -0
  92. package/dist/runner/snapshot-save.js +148 -0
  93. package/dist/sdk/index.js +1 -1
  94. package/dist/sdk/payload/payload.d.ts +2 -2
  95. package/dist/sdk/payload/payload.js +2 -2
  96. package/dist/story/align.d.ts +1 -1
  97. package/dist/story/align.js +1 -1
  98. package/dist/story/definition.d.ts +22 -15
  99. package/dist/story/definition.js +2 -2
  100. package/dist/story/errors.js +1 -1
  101. package/dist/story/gateways.d.ts +45 -25
  102. package/dist/story/gateways.js +2 -2
  103. package/dist/story/host.d.ts +11 -8
  104. package/dist/story/host.js +37 -37
  105. package/dist/story/index.d.ts +1 -1
  106. package/dist/story/index.js +4 -4
  107. package/dist/story/json.d.ts +1 -1
  108. package/dist/story/json.js +2 -2
  109. package/dist/story/live/recording-gateway.d.ts +2 -0
  110. package/dist/story/live/{artifact-gateway.js → recording-gateway.js} +33 -12
  111. package/dist/story/mode.d.ts +2 -2
  112. package/dist/story/mode.js +1 -1
  113. package/dist/story/orphans.d.ts +23 -5
  114. package/dist/story/orphans.js +44 -8
  115. package/dist/story/recording.d.ts +62 -0
  116. package/dist/story/{artifact.js → recording.js} +31 -27
  117. package/dist/story/report.d.ts +21 -9
  118. package/dist/story/report.js +37 -25
  119. package/dist/story/settle.d.ts +23 -21
  120. package/dist/story/settle.js +17 -16
  121. package/dist/story/{run.d.ts → start.d.ts} +18 -17
  122. package/dist/story/{run.js → start.js} +66 -43
  123. package/dist/vercel-cli/driver.d.ts +1 -1
  124. package/dist/vercel-cli/entry.d.ts +1 -1
  125. package/dist/vercel-cli/entry.js +1 -1
  126. package/dist/vercel-cli/verbose.d.ts +2 -2
  127. package/dist/vercel-cli/verbose.js +2 -2
  128. package/dist/vitest/config.d.ts +5 -5
  129. package/dist/vitest/config.js +5 -5
  130. package/dist/vitest/find-vitest.d.ts +7 -0
  131. package/dist/vitest/find-vitest.js +28 -0
  132. package/dist/vitest/fixtures.d.ts +2 -2
  133. package/dist/vitest/fixtures.js +3 -3
  134. package/dist/vitest/gateways.d.ts +37 -6
  135. package/dist/vitest/gateways.js +3 -2
  136. package/dist/vitest/live/list-gateway.d.ts +7 -3
  137. package/dist/vitest/live/list-gateway.js +55 -8
  138. package/dist/vitest/plan.d.ts +41 -8
  139. package/dist/vitest/plan.js +47 -16
  140. package/dist/vitest/sandbox.d.ts +1 -1
  141. package/dist/vitest/sandbox.js +1 -1
  142. package/dist/vitest/test-events.d.ts +2 -2
  143. package/dist/vitest/test-events.js +3 -3
  144. package/dist/vitest/test-results.d.ts +1 -1
  145. package/dist/vitest/test-results.js +1 -1
  146. package/dist/vitest/types.d.ts +1 -1
  147. package/package.json +2 -2
  148. package/skills/overview.md +5 -4
  149. package/skills/read-run-output.md +1 -1
  150. package/dist/commands/run/command.d.ts +0 -327
  151. package/dist/commands/run/command.js +0 -620
  152. package/dist/commands/run/metadata.d.ts +0 -47
  153. package/dist/commands/run/metadata.js +0 -83
  154. package/dist/commands/run/outcomes.js +0 -332
  155. package/dist/story/artifact.d.ts +0 -60
  156. package/dist/story/live/artifact-gateway.d.ts +0 -2
  157. /package/dist/commands/{run → exec}/live-view.d.ts +0 -0
  158. /package/dist/commands/{run → exec}/mint-failed.d.ts +0 -0
  159. /package/dist/commands/{run → exec}/redaction.d.ts +0 -0
  160. /package/dist/commands/{run → exec}/redaction.js +0 -0
  161. /package/dist/commands/{run → exec}/run-collector.d.ts +0 -0
  162. /package/dist/commands/{run → exec}/run-collector.js +0 -0
  163. /package/dist/commands/{run → exec}/tests-summary.d.ts +0 -0
  164. /package/dist/commands/{run → exec}/tests-summary.js +0 -0
  165. /package/dist/commands/{run → exec}/text.d.ts +0 -0
  166. /package/dist/commands/{run → exec}/text.js +0 -0
  167. /package/dist/commands/{run → exec}/view.d.ts +0 -0
  168. /package/dist/commands/{run → exec}/waterfall.d.ts +0 -0
  169. /package/dist/commands/{run → exec}/waterfall.js +0 -0
  170. /package/dist/commands/{run → exec}/worker-chart.d.ts +0 -0
  171. /package/dist/commands/{run → exec}/worker-chart.js +0 -0
@@ -4,8 +4,8 @@ import { readRunPayload, RUN_PAYLOAD_VARIABLE, RunPayloadError } from "../sdk/in
4
4
  import { describeInvocation } from "./report.js";
5
5
  /**
6
6
  * The listener `vercelCli` uses when the caller passes no `onInvocationEnd`: one that prints each invocation with
7
- * `describeInvocation` to `print`, when `env`'s run payload says the run is verbose (`storm run --verbose`), or
8
- * `undefined` outside `storm run`, in a run that isn't verbose, or when the run payload can't be read.
7
+ * `describeInvocation` to `print`, when `env`'s run payload says the run is verbose (its `--verbose`), or
8
+ * `undefined` outside a storm run, in a run that isn't verbose, or when the run payload can't be read.
9
9
  */
10
10
  export function defaultInvocationListener(env, print) {
11
11
  const raw = env[RUN_PAYLOAD_VARIABLE];
@@ -25,7 +25,7 @@ export interface TestserverWorkersOptions {
25
25
  }
26
26
  /**
27
27
  * The `maxWorkers` for a testserver vitest project: `workersPerSandbox` times the number of Testserver sandboxes in
28
- * the run payload. With `STORM_RUN` unset or empty, outside `storm run`, it counts one Testserver sandbox,
28
+ * the run payload. With `STORM_RUN` unset or empty, outside a storm run, it counts one Testserver sandbox,
29
29
  * so the config still loads. Throws a `RunPayloadError` when `STORM_RUN` holds no valid run payload, and an
30
30
  * `Error` when `workersPerSandbox` is not a positive integer.
31
31
  */
@@ -36,15 +36,15 @@ export interface StormReporterOptions {
36
36
  }
37
37
  /**
38
38
  * A vitest reporter for a testserver project's config: it appends each test's final result, retries settled, to the
39
- * run payload's `testEvents` file, which `storm run` counts the tests from. It prints nothing, so list it beside
39
+ * run payload's `testEvents` file, which the run counts the tests from. It prints nothing, so list it beside
40
40
  * the reporter a person reads, `reporters: ["default", stormReporter()]`; a `--reporter` given to vitest on the
41
- * command line replaces both. Outside `storm run`, or when the run payload names no test events file, it
41
+ * command line replaces both. Outside a storm run, or when the run payload names no test events file, it
42
42
  * reports nothing, and once an append fails it drops every later result: it never fails a test.
43
43
  */
44
44
  export declare function stormReporter(options?: StormReporterOptions): StormReporter;
45
45
  /**
46
- * The reporters for a testserver project's config under `storm run`: vitest's `default`, which names each file
47
- * and its slow or failed tests as each file finishes, or under `storm run --verbose` its `verbose`, which names
46
+ * The reporters for a testserver project's config under a storm run: vitest's `default`, which names each file
47
+ * and its slow or failed tests as each file finishes, or under a run's `--verbose` its `verbose`, which names
48
48
  * each test as it finishes; and `stormReporter()`. With `STORM_RUN` unset or empty it picks `default`.
49
49
  * Throws a `RunPayloadError` when `STORM_RUN` holds no valid run payload.
50
50
  */
@@ -23,7 +23,7 @@ export const testserverConnectionRetry = {
23
23
  };
24
24
  /**
25
25
  * The `maxWorkers` for a testserver vitest project: `workersPerSandbox` times the number of Testserver sandboxes in
26
- * the run payload. With `STORM_RUN` unset or empty, outside `storm run`, it counts one Testserver sandbox,
26
+ * the run payload. With `STORM_RUN` unset or empty, outside a storm run, it counts one Testserver sandbox,
27
27
  * so the config still loads. Throws a `RunPayloadError` when `STORM_RUN` holds no valid run payload, and an
28
28
  * `Error` when `workersPerSandbox` is not a positive integer.
29
29
  */
@@ -39,17 +39,17 @@ export function testserverWorkers(options = {}) {
39
39
  }
40
40
  /**
41
41
  * A vitest reporter for a testserver project's config: it appends each test's final result, retries settled, to the
42
- * run payload's `testEvents` file, which `storm run` counts the tests from. It prints nothing, so list it beside
42
+ * run payload's `testEvents` file, which the run counts the tests from. It prints nothing, so list it beside
43
43
  * the reporter a person reads, `reporters: ["default", stormReporter()]`; a `--reporter` given to vitest on the
44
- * command line replaces both. Outside `storm run`, or when the run payload names no test events file, it
44
+ * command line replaces both. Outside a storm run, or when the run payload names no test events file, it
45
45
  * reports nothing, and once an append fails it drops every later result: it never fails a test.
46
46
  */
47
47
  export function stormReporter(options = {}) {
48
48
  return testResultReporter(options.env ?? process.env);
49
49
  }
50
50
  /**
51
- * The reporters for a testserver project's config under `storm run`: vitest's `default`, which names each file
52
- * and its slow or failed tests as each file finishes, or under `storm run --verbose` its `verbose`, which names
51
+ * The reporters for a testserver project's config under a storm run: vitest's `default`, which names each file
52
+ * and its slow or failed tests as each file finishes, or under a run's `--verbose` its `verbose`, which names
53
53
  * each test as it finishes; and `stormReporter()`. With `STORM_RUN` unset or empty it picks `default`.
54
54
  * Throws a `RunPayloadError` when `STORM_RUN` holds no valid run payload.
55
55
  */
@@ -0,0 +1,7 @@
1
+ /** Where a package's `vitest` sits under a directory. */
2
+ export declare const VITEST_BIN: string;
3
+ /**
4
+ * The directories whose `node_modules/.bin` may hold `vitest`, nearest first: `from`, then each directory above it, up
5
+ * to and including `root`. When `from` isn't `root` or inside it, up to the filesystem's root.
6
+ */
7
+ export declare function vitestSearchDirectories(from: string, root: string): readonly string[];
@@ -0,0 +1,28 @@
1
+ // Where to look for `vitest` in `node_modules/.bin`. Pure, so the live list gateway and its fake look in the same
2
+ // directories.
3
+ import { dirname, join, relative, isAbsolute } from "node:path";
4
+ /** Where a package's `vitest` sits under a directory. */
5
+ export const VITEST_BIN = join("node_modules", ".bin", "vitest");
6
+ /**
7
+ * The directories whose `node_modules/.bin` may hold `vitest`, nearest first: `from`, then each directory above it, up
8
+ * to and including `root`. When `from` isn't `root` or inside it, up to the filesystem's root.
9
+ */
10
+ export function vitestSearchDirectories(from, root) {
11
+ const inside = from === root || isInside(root, from);
12
+ const directories = [];
13
+ let directory = from;
14
+ for (;;) {
15
+ directories.push(directory);
16
+ if (inside && directory === root)
17
+ return directories;
18
+ const parent = dirname(directory);
19
+ if (parent === directory)
20
+ return directories;
21
+ directory = parent;
22
+ }
23
+ }
24
+ /** Whether `path` is inside `directory`, below it. */
25
+ function isInside(directory, path) {
26
+ const between = relative(directory, path);
27
+ return between !== "" && !between.startsWith("..") && !isAbsolute(between);
28
+ }
@@ -21,11 +21,11 @@ declare module "vitest" {
21
21
  * (`@cnc-tools/storm/vitest/config`), in vitest's main process. `stormEvents`, `stormFileEvents` and
22
22
  * `stormTestEvents` are the adapter's own, which tests don't use.
23
23
  *
24
- * - `verbose` (per worker): whether the run is verbose, under `storm run --verbose`, from the run payload. Then
24
+ * - `verbose` (per worker): whether the run is verbose, under a run's `--verbose`, from the run payload. Then
25
25
  * `container` prints each container start and `proxy` each request as it is recorded, for passing tests too, and
26
26
  * a test's own fixture can print what it does, as the Vercel CLI driver's invocations.
27
27
  * - `testserverUrl` (per worker): this worker's Testserver sandbox, `sandboxes[(VITEST_POOL_ID - 1) % N]` from the
28
- * run payload's `resources.testserverPool`. Outside `storm run`, or with a `VITEST_POOL_ID` that isn't a
28
+ * run payload's `resources.testserverPool`. Outside a storm run, or with a `VITEST_POOL_ID` that isn't a
29
29
  * positive integer, it throws, so the test fails rather than skips.
30
30
  * - `stormFile` (per file): the adapter's own state for the file, which tests don't use: its `container`, the
31
31
  * holder of the file's container, and its `acquisitions`, the container and proxy starts still in flight. Creating
@@ -7,7 +7,7 @@ import { sandboxForWorker } from "./sandbox.js";
7
7
  import { countTests, reportedStart, testEventReporter, testEventState } from "./test-events.js";
8
8
  /**
9
9
  * The Testserver URL of this worker's Testserver sandbox, `sandboxes[(VITEST_POOL_ID - 1) % N]` of the run
10
- * payload's `resources.testserverPool`. Throws outside `storm run`, and outside a vitest worker.
10
+ * payload's `resources.testserverPool`. Throws outside a storm run, and outside a vitest worker.
11
11
  */
12
12
  function workerTestserverUrl() {
13
13
  return sandboxForWorker(readRunPayload(), process.env["VITEST_POOL_ID"]);
@@ -126,11 +126,11 @@ const fixtures = vitestTest
126
126
  * (`@cnc-tools/storm/vitest/config`), in vitest's main process. `stormEvents`, `stormFileEvents` and
127
127
  * `stormTestEvents` are the adapter's own, which tests don't use.
128
128
  *
129
- * - `verbose` (per worker): whether the run is verbose, under `storm run --verbose`, from the run payload. Then
129
+ * - `verbose` (per worker): whether the run is verbose, under a run's `--verbose`, from the run payload. Then
130
130
  * `container` prints each container start and `proxy` each request as it is recorded, for passing tests too, and
131
131
  * a test's own fixture can print what it does, as the Vercel CLI driver's invocations.
132
132
  * - `testserverUrl` (per worker): this worker's Testserver sandbox, `sandboxes[(VITEST_POOL_ID - 1) % N]` from the
133
- * run payload's `resources.testserverPool`. Outside `storm run`, or with a `VITEST_POOL_ID` that isn't a
133
+ * run payload's `resources.testserverPool`. Outside a storm run, or with a `VITEST_POOL_ID` that isn't a
134
134
  * positive integer, it throws, so the test fails rather than skips.
135
135
  * - `stormFile` (per file): the adapter's own state for the file, which tests don't use: its `container`, the
136
136
  * holder of the file's container, and its `acquisitions`, the container and proxy starts still in flight. Creating
@@ -5,19 +5,44 @@ export interface ListedTest {
5
5
  /** The absolute path of its file. */
6
6
  readonly file: string;
7
7
  }
8
- /** What to list: `vitest list --json` with `args` after it, such as a project and file filters. */
8
+ /** What to list: `vitest list` with `args`, such as a project and file filters, and `--json`. */
9
9
  export interface VitestListRequest {
10
- /** Passed after `list --json`, as `vitest run` takes them. */
10
+ /** Passed to `vitest list`, as `vitest run` takes them. */
11
11
  readonly args: readonly string[];
12
12
  /** Where vitest runs; default the current directory. */
13
13
  readonly cwd?: string;
14
+ /** The `vitest` to start, such as the absolute path `findVitest` found; default `vitest` from `PATH`. */
15
+ readonly executable?: string;
14
16
  /** How long the listing may take before it is killed. */
15
17
  readonly timeoutMs: number;
18
+ /** Stops the listing when it aborts, before it starts or while it runs: the listing is `canceled`. */
19
+ readonly signal?: AbortSignal;
16
20
  }
21
+ /** Where to look for `vitest`: in `node_modules/.bin` of `from` and of each directory above it, up to `root`. */
22
+ export interface FindVitestRequest {
23
+ /** The directory vitest runs in, an absolute path. */
24
+ readonly from: string;
25
+ /**
26
+ * The last directory to look in, an absolute path: the repository's root, or the filesystem's root outside a
27
+ * repository. When `from` isn't inside it, the search goes on up to the filesystem's root.
28
+ */
29
+ readonly root: string;
30
+ }
31
+ /**
32
+ * The `vitest` found nearest `from`, as an absolute path to its `node_modules/.bin/vitest`; or, when no directory has
33
+ * one, every directory looked in, nearest first (`vitestSearchDirectories`).
34
+ */
35
+ export type FindVitestResult = {
36
+ readonly ok: true;
37
+ readonly path: string;
38
+ } | {
39
+ readonly ok: false;
40
+ readonly searched: readonly string[];
41
+ };
17
42
  /**
18
- * Why the tests couldn't be listed: `vitest` couldn't be started (not on `PATH`, or no such `cwd`), it didn't finish
19
- * within `timeoutMs`, it exited other than 0 (with the last line of its stderr that isn't blank or a stack frame, empty
20
- * when there is none), or its output wasn't a list of tests.
43
+ * Why the tests couldn't be listed: `vitest` couldn't be started (not on `PATH` or not found, or no such `cwd`), it
44
+ * didn't finish within `timeoutMs`, it exited other than 0 (with the last line of its stderr that isn't blank or a
45
+ * stack frame, empty when there is none), its output wasn't a list of tests, or the request's `signal` stopped it.
21
46
  */
22
47
  export type VitestListFailure = {
23
48
  readonly kind: "start-failed";
@@ -33,6 +58,8 @@ export type VitestListFailure = {
33
58
  } | {
34
59
  readonly kind: "unreadable-output";
35
60
  readonly message: string;
61
+ } | {
62
+ readonly kind: "canceled";
36
63
  };
37
64
  export type VitestListResult = {
38
65
  readonly ok: true;
@@ -41,7 +68,11 @@ export type VitestListResult = {
41
68
  readonly ok: false;
42
69
  readonly failure: VitestListFailure;
43
70
  };
44
- /** Lists the tests a `vitest run` with the same arguments would run, without running them. */
45
71
  export interface VitestListGateway {
72
+ /** Lists the tests a `vitest run` with the same arguments would run, without running them. */
46
73
  listTests(request: VitestListRequest): Promise<VitestListResult>;
74
+ /**
75
+ * Finds the `vitest` a package's scripts would run: the nearest `node_modules/.bin/vitest` from `from` up to `root`.
76
+ */
77
+ findVitest(request: FindVitestRequest): Promise<FindVitestResult>;
47
78
  }
@@ -1,3 +1,4 @@
1
- // The Vitest adapter's gateway: listing the tests a `vitest run` would run, before any Testserver sandbox is leased.
2
- // The live gateway is `live/list-gateway.ts`; the fake is `test/fakes/vitest/list-gateway.ts`.
1
+ // The Vitest adapter's gateway: finding `vitest` in `node_modules/.bin`, and listing the tests a `vitest run` would
2
+ // run, before any Testserver sandbox is leased. The live gateway is `live/list-gateway.ts`; the fake is
3
+ // `test/fakes/vitest/list-gateway.ts`.
3
4
  export {};
@@ -1,7 +1,11 @@
1
1
  import type { VitestListGateway } from "../gateways.ts";
2
2
  /**
3
- * The live list gateway: spawns `vitest list --json <args>` from `PATH`, no shell, in `cwd`, with stdin ignored,
4
- * and kills it after `timeoutMs` (`AbortSignal.timeout`). An `error` before the process exits is a start failure,
5
- * unless the timeout caused it.
3
+ * The live list gateway. `listTests` spawns `vitest list <args> --json` (`listArgv`), the request's `executable` or
4
+ * `vitest` from `PATH`, no shell, in `cwd`, with stdin ignored. It sends SIGTERM after `timeoutMs`
5
+ * (`AbortSignal.timeout`), or once the request's `signal` aborts, then waits for the process to exit and answers
6
+ * `timed-out` or `canceled`, `canceled` when the request's `signal` aborted. It waits for the exit, not for the pipes
7
+ * to close, since a process `vitest` left behind could hold them open. Any other `error` is a start failure, answered
8
+ * at once, since no process started. `findVitest` answers the first `node_modules/.bin/vitest` this process may
9
+ * execute, in `vitestSearchDirectories` order.
6
10
  */
7
11
  export declare const liveVitestListGateway: VitestListGateway;
@@ -1,11 +1,33 @@
1
1
  import { spawn } from "node:child_process";
2
+ import { constants } from "node:fs";
3
+ import { access } from "node:fs/promises";
4
+ import { join } from "node:path";
5
+ import { VITEST_BIN, vitestSearchDirectories } from "../find-vitest.js";
2
6
  import { readVitestList } from "../list-output.js";
3
7
  /**
4
- * The live list gateway: spawns `vitest list --json <args>` from `PATH`, no shell, in `cwd`, with stdin ignored,
5
- * and kills it after `timeoutMs` (`AbortSignal.timeout`). An `error` before the process exits is a start failure,
6
- * unless the timeout caused it.
8
+ * The live list gateway. `listTests` spawns `vitest list <args> --json` (`listArgv`), the request's `executable` or
9
+ * `vitest` from `PATH`, no shell, in `cwd`, with stdin ignored. It sends SIGTERM after `timeoutMs`
10
+ * (`AbortSignal.timeout`), or once the request's `signal` aborts, then waits for the process to exit and answers
11
+ * `timed-out` or `canceled`, `canceled` when the request's `signal` aborted. It waits for the exit, not for the pipes
12
+ * to close, since a process `vitest` left behind could hold them open. Any other `error` is a start failure, answered
13
+ * at once, since no process started. `findVitest` answers the first `node_modules/.bin/vitest` this process may
14
+ * execute, in `vitestSearchDirectories` order.
7
15
  */
8
16
  export const liveVitestListGateway = {
17
+ async findVitest({ from, root }) {
18
+ const searched = vitestSearchDirectories(from, root);
19
+ for (const directory of searched) {
20
+ const path = join(directory, VITEST_BIN);
21
+ try {
22
+ await access(path, constants.X_OK);
23
+ return { ok: true, path };
24
+ }
25
+ catch {
26
+ // Not there, or not executable: look further up.
27
+ }
28
+ }
29
+ return { ok: false, searched };
30
+ },
9
31
  listTests(request) {
10
32
  return new Promise((resolve) => {
11
33
  let settled = false;
@@ -15,11 +37,14 @@ export const liveVitestListGateway = {
15
37
  settled = true;
16
38
  resolve(result);
17
39
  };
18
- const child = spawn("vitest", ["list", "--json", ...request.args], {
40
+ const timeout = AbortSignal.timeout(request.timeoutMs);
41
+ const child = spawn(request.executable ?? "vitest", listArgv(request.args), {
19
42
  ...(request.cwd === undefined ? {} : { cwd: request.cwd }),
20
43
  stdio: ["ignore", "pipe", "pipe"],
21
- signal: AbortSignal.timeout(request.timeoutMs),
44
+ signal: request.signal === undefined ? timeout : AbortSignal.any([timeout, request.signal]),
22
45
  });
46
+ // Why the listing was stopped, once the abort killed the process: answered when it has exited.
47
+ let stopped;
23
48
  let stdout = "";
24
49
  let stderr = "";
25
50
  child.stdout.setEncoding("utf8").on("data", (chunk) => {
@@ -29,11 +54,24 @@ export const liveVitestListGateway = {
29
54
  stderr += chunk;
30
55
  });
31
56
  child.on("error", (error) => {
32
- settle(error.name === "AbortError"
33
- ? { ok: false, failure: { kind: "timed-out", timeoutMs: request.timeoutMs } }
34
- : { ok: false, failure: { kind: "start-failed", message: error.message } });
57
+ if (error.name !== "AbortError") {
58
+ settle({ ok: false, failure: { kind: "start-failed", message: error.message } });
59
+ return;
60
+ }
61
+ stopped =
62
+ request.signal?.aborted === true ? { kind: "canceled" } : { kind: "timed-out", timeoutMs: request.timeoutMs };
63
+ if (child.exitCode !== null || child.signalCode !== null)
64
+ settle({ ok: false, failure: stopped });
65
+ });
66
+ child.on("exit", () => {
67
+ if (stopped !== undefined)
68
+ settle({ ok: false, failure: stopped });
35
69
  });
36
70
  child.on("close", (exitCode, signal) => {
71
+ if (stopped !== undefined) {
72
+ settle({ ok: false, failure: stopped });
73
+ return;
74
+ }
37
75
  if (exitCode !== 0) {
38
76
  settle({ ok: false, failure: { kind: "exited", exitCode, signal, lastStderrLine: lastLine(stderr) } });
39
77
  return;
@@ -58,3 +96,12 @@ function lastLine(text) {
58
96
  .map((line) => line.trim())
59
97
  .findLast((line) => line !== "" && !/^at\s/.test(line)) ?? "");
60
98
  }
99
+ /**
100
+ * `vitest list`'s arguments: `args`, with `--json` after them but before a `--` among them. vitest's `--json` takes an
101
+ * optional path, so `vitest list --json test/a.test.ts` would write the list over `test/a.test.ts`; after the
102
+ * arguments, it takes none, and the list goes to stdout.
103
+ */
104
+ function listArgv(args) {
105
+ const end = args.indexOf("--");
106
+ return end === -1 ? ["list", ...args, "--json"] : ["list", ...args.slice(0, end), "--json", ...args.slice(end)];
107
+ }
@@ -1,4 +1,8 @@
1
- import type { VitestListGateway } from "./gateways.ts";
1
+ import type { VitestListFailure, VitestListGateway } from "./gateways.ts";
2
+ export { VITEST_BIN, vitestSearchDirectories } from "./find-vitest.ts";
3
+ export type { FindVitestRequest, FindVitestResult, ListedTest, VitestListFailure, VitestListGateway, VitestListRequest, VitestListResult, } from "./gateways.ts";
4
+ export { liveVitestListGateway } from "./live/list-gateway.ts";
5
+ export { WORKERS_PER_SANDBOX } from "./config.ts";
2
6
  /** How long `listVitestTests` lets `vitest list` run by default. */
3
7
  export declare const LIST_TIMEOUT_MS = 60000;
4
8
  /** How many tests a Vitest run would run, and in how many files. */
@@ -7,27 +11,56 @@ export interface TestPlan {
7
11
  readonly files: number;
8
12
  }
9
13
  export interface ListVitestTestsOptions {
10
- /** Passed after `vitest list --json`, as `vitest run` takes them, such as `["--project", "testserver"]`. */
14
+ /** Passed to `vitest list --json`, as `vitest run` takes them, such as `["--project", "testserver"]`. */
11
15
  readonly args: readonly string[];
12
16
  /** Where vitest runs; default the current directory. */
13
17
  readonly cwd?: string;
18
+ /** The `vitest` to start, such as the path `findVitest` found; default `vitest` from `PATH`. */
19
+ readonly executable?: string;
14
20
  /** How long `vitest list` may take; default `LIST_TIMEOUT_MS`, 60s. */
15
21
  readonly timeoutMs?: number;
22
+ /** Stops `vitest list` when it aborts: the plan's failure is then `canceled`. */
23
+ readonly signal?: AbortSignal;
16
24
  }
25
+ /** A Vitest run's test plan, or why its tests couldn't be listed. */
26
+ export type VitestPlanResult = {
27
+ readonly ok: true;
28
+ readonly plan: TestPlan;
29
+ } | {
30
+ readonly ok: false;
31
+ readonly failure: VitestListFailure;
32
+ };
17
33
  /**
18
- * Lists the tests `vitest run <args>` would run, with `vitest list --json <args>` from `PATH`, and counts them.
19
- * Rejects with an `Error` saying why when `vitest` fails to start, doesn't finish within `timeoutMs`, exits other
20
- * than 0 (with the last line of its stderr that isn't a stack frame), or prints something other than a list of tests.
34
+ * Lists the tests `vitest run <args>` would run, with `vitest list <args> --json` (`executable`, else `vitest` from
35
+ * `PATH`), and counts them; or says why it couldn't: `vitest` failed to start, didn't finish within `timeoutMs`, exited
36
+ * other than 0 (with the last line of its stderr that isn't a stack frame), printed something other than a list of
37
+ * tests, or was stopped by `signal` (`canceled`). Throws a `TypeError` unless `timeoutMs` is a positive number.
38
+ */
39
+ export declare function planVitestRun(options: ListVitestTestsOptions, gateway?: VitestListGateway): Promise<VitestPlanResult>;
40
+ /**
41
+ * `planVitestRun`'s plan, rejecting with an `Error` that says why the tests couldn't be listed
42
+ * (`describeVitestListFailure`).
21
43
  */
22
44
  export declare function listVitestTests(options: ListVitestTestsOptions, gateway?: VitestListGateway): Promise<TestPlan>;
45
+ /** The argv that runs `args` with `executable`, a `vitest`: `<executable> run <args...>`. */
46
+ export declare function vitestRunArgv(executable: string, args: readonly string[]): readonly string[];
23
47
  /** The plan `vitest list --json` printed: its tests, and their distinct files. Throws when it isn't a list of tests. */
24
48
  export declare function parseVitestList(stdout: string): TestPlan;
25
49
  /** A plan as a phrase, such as `65 tests in 19 files` or `1 test in 1 file`. */
26
50
  export declare function formatPlan(plan: TestPlan): string;
51
+ /** The most Testserver sandboxes `autoSandboxes` sizes a run for: past it, a run passes `--testserver-sandboxes`. */
52
+ export declare const AUTO_SANDBOXES_MAX = 8;
53
+ /**
54
+ * The Testserver sandboxes `storm vitest` asks for when neither `--testserver-sandboxes` nor the config file says:
55
+ * one per `WORKERS_PER_SANDBOX` (4) files, at least 1 and at most `AUTO_SANDBOXES_MAX` (8) (`sandboxesFor`).
56
+ */
57
+ export declare function autoSandboxes(files: number): number;
27
58
  /**
28
- * The Testserver sandboxes to ask `storm run --set resources.testserverPool.sandboxes=<n>` for: one per
29
- * `workersPerSandbox` files (default `WORKERS_PER_SANDBOX`, 4, as `testserverWorkers` sizes `maxWorkers`), at least
30
- * 1 and at most `max`. A file's tests run in one worker, so more sandboxes than that would sit idle. Throws a `TypeError` unless `files` is a
59
+ * The Testserver sandboxes to ask `storm exec --testserver-sandboxes <n>` for: one per `workersPerSandbox` files
60
+ * (default `WORKERS_PER_SANDBOX`, 4, as `testserverWorkers` sizes `maxWorkers`), at least 1 and at most `max`. A file's
61
+ * tests run in one worker, so more sandboxes than that would sit idle. Throws a `TypeError` unless `files` is a
31
62
  * non-negative integer and `max` and `workersPerSandbox` are positive integers.
32
63
  */
33
64
  export declare function sandboxesFor(files: number, max: number, workersPerSandbox?: number): number;
65
+ /** Why the tests couldn't be listed, as a sentence. */
66
+ export declare function describeVitestListFailure(failure: VitestListFailure): string;
@@ -1,30 +1,49 @@
1
- // The test count of a Vitest run, exported as `@cnc-tools/storm/vitest/plan`, for a launcher that sizes
2
- // `storm run --set resources.testserverPool.sandboxes=<n>` before any Testserver sandbox is leased. Like
3
- // `config.ts`, it imports neither `./fixtures.ts` nor vitest: a launcher script runs outside a Vitest run, where the
4
- // adapter's `test` throws.
1
+ // Planning a Vitest run before any Testserver sandbox is leased, exported as `@cnc-tools/storm/vitest/plan`: finding
2
+ // `vitest` in `node_modules/.bin`, counting the tests `vitest run <args>` would run, sizing the Testserver sandboxes
3
+ // for them, and the `vitest run` argv. It is the adapter's one entry point for the CLI: `storm vitest` imports it
4
+ // and nothing else of the adapter. Like `config.ts`, it imports neither `./fixtures.ts` nor vitest: the CLI and a
5
+ // launcher script run outside a Vitest run, where the adapter's `test` throws.
5
6
  import { WORKERS_PER_SANDBOX } from "./config.js";
6
7
  import { readVitestList } from "./list-output.js";
7
8
  import { liveVitestListGateway } from "./live/list-gateway.js";
9
+ export { VITEST_BIN, vitestSearchDirectories } from "./find-vitest.js";
10
+ export { liveVitestListGateway } from "./live/list-gateway.js";
11
+ export { WORKERS_PER_SANDBOX } from "./config.js";
8
12
  /** How long `listVitestTests` lets `vitest list` run by default. */
9
13
  export const LIST_TIMEOUT_MS = 60_000;
10
14
  /**
11
- * Lists the tests `vitest run <args>` would run, with `vitest list --json <args>` from `PATH`, and counts them.
12
- * Rejects with an `Error` saying why when `vitest` fails to start, doesn't finish within `timeoutMs`, exits other
13
- * than 0 (with the last line of its stderr that isn't a stack frame), or prints something other than a list of tests.
15
+ * Lists the tests `vitest run <args>` would run, with `vitest list <args> --json` (`executable`, else `vitest` from
16
+ * `PATH`), and counts them; or says why it couldn't: `vitest` failed to start, didn't finish within `timeoutMs`, exited
17
+ * other than 0 (with the last line of its stderr that isn't a stack frame), printed something other than a list of
18
+ * tests, or was stopped by `signal` (`canceled`). Throws a `TypeError` unless `timeoutMs` is a positive number.
14
19
  */
15
- export async function listVitestTests(options, gateway = liveVitestListGateway) {
20
+ export async function planVitestRun(options, gateway = liveVitestListGateway) {
16
21
  const timeoutMs = options.timeoutMs ?? LIST_TIMEOUT_MS;
17
22
  if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
18
- throw new TypeError(`listVitestTests: timeoutMs is ${String(timeoutMs)}, not a positive number`);
23
+ throw new TypeError(`planVitestRun: timeoutMs is ${String(timeoutMs)}, not a positive number`);
19
24
  }
20
25
  const listed = await gateway.listTests({
21
26
  args: options.args,
22
27
  ...(options.cwd === undefined ? {} : { cwd: options.cwd }),
28
+ ...(options.executable === undefined ? {} : { executable: options.executable }),
23
29
  timeoutMs,
30
+ ...(options.signal === undefined ? {} : { signal: options.signal }),
24
31
  });
25
- if (!listed.ok)
26
- throw new Error(describeListFailure(listed.failure));
27
- return planOf(listed.tests);
32
+ return listed.ok ? { ok: true, plan: planOf(listed.tests) } : { ok: false, failure: listed.failure };
33
+ }
34
+ /**
35
+ * `planVitestRun`'s plan, rejecting with an `Error` that says why the tests couldn't be listed
36
+ * (`describeVitestListFailure`).
37
+ */
38
+ export async function listVitestTests(options, gateway = liveVitestListGateway) {
39
+ const planned = await planVitestRun(options, gateway);
40
+ if (!planned.ok)
41
+ throw new Error(describeVitestListFailure(planned.failure));
42
+ return planned.plan;
43
+ }
44
+ /** The argv that runs `args` with `executable`, a `vitest`: `<executable> run <args...>`. */
45
+ export function vitestRunArgv(executable, args) {
46
+ return [executable, "run", ...args];
28
47
  }
29
48
  /** The plan `vitest list --json` printed: its tests, and their distinct files. Throws when it isn't a list of tests. */
30
49
  export function parseVitestList(stdout) {
@@ -34,10 +53,19 @@ export function parseVitestList(stdout) {
34
53
  export function formatPlan(plan) {
35
54
  return `${plan.tests} ${plan.tests === 1 ? "test" : "tests"} in ${plan.files} ${plan.files === 1 ? "file" : "files"}`;
36
55
  }
56
+ /** The most Testserver sandboxes `autoSandboxes` sizes a run for: past it, a run passes `--testserver-sandboxes`. */
57
+ export const AUTO_SANDBOXES_MAX = 8;
58
+ /**
59
+ * The Testserver sandboxes `storm vitest` asks for when neither `--testserver-sandboxes` nor the config file says:
60
+ * one per `WORKERS_PER_SANDBOX` (4) files, at least 1 and at most `AUTO_SANDBOXES_MAX` (8) (`sandboxesFor`).
61
+ */
62
+ export function autoSandboxes(files) {
63
+ return sandboxesFor(files, AUTO_SANDBOXES_MAX);
64
+ }
37
65
  /**
38
- * The Testserver sandboxes to ask `storm run --set resources.testserverPool.sandboxes=<n>` for: one per
39
- * `workersPerSandbox` files (default `WORKERS_PER_SANDBOX`, 4, as `testserverWorkers` sizes `maxWorkers`), at least
40
- * 1 and at most `max`. A file's tests run in one worker, so more sandboxes than that would sit idle. Throws a `TypeError` unless `files` is a
66
+ * The Testserver sandboxes to ask `storm exec --testserver-sandboxes <n>` for: one per `workersPerSandbox` files
67
+ * (default `WORKERS_PER_SANDBOX`, 4, as `testserverWorkers` sizes `maxWorkers`), at least 1 and at most `max`. A file's
68
+ * tests run in one worker, so more sandboxes than that would sit idle. Throws a `TypeError` unless `files` is a
41
69
  * non-negative integer and `max` and `workersPerSandbox` are positive integers.
42
70
  */
43
71
  export function sandboxesFor(files, max, workersPerSandbox = WORKERS_PER_SANDBOX) {
@@ -57,7 +85,8 @@ export function sandboxesFor(files, max, workersPerSandbox = WORKERS_PER_SANDBOX
57
85
  function planOf(tests) {
58
86
  return { tests: tests.length, files: new Set(tests.map((test) => test.file)).size };
59
87
  }
60
- function describeListFailure(failure) {
88
+ /** Why the tests couldn't be listed, as a sentence. */
89
+ export function describeVitestListFailure(failure) {
61
90
  switch (failure.kind) {
62
91
  case "start-failed":
63
92
  return `\`vitest list\` failed to start: ${failure.message}`;
@@ -69,5 +98,7 @@ function describeListFailure(failure) {
69
98
  }
70
99
  case "unreadable-output":
71
100
  return failure.message;
101
+ case "canceled":
102
+ return "`vitest list` was canceled";
72
103
  }
73
104
  }
@@ -1,6 +1,6 @@
1
1
  import type { RunPayload } from "../sdk/index.ts";
2
2
  /** What a test that needs a Testserver sandbox fails with in a run that holds none. */
3
- export declare const NO_TESTSERVER_MESSAGE = "this run has no Testserver; add resources.testserverPool to storm.config.ts or pass --set resources.testserverPool.sandboxes=<n>";
3
+ export declare const NO_TESTSERVER_MESSAGE = "this run has no Testserver; add resources.testserverPool to storm.config.ts or pass --testserver-sandboxes <n>";
4
4
  /**
5
5
  * The Testserver URL of the Testserver sandbox the vitest worker numbered `poolId` uses:
6
6
  * `sandboxes[(poolId - 1) % N]` of the run payload's `resources.testserverPool`. `poolId` is the worker's
@@ -1,7 +1,7 @@
1
1
  // Which Testserver sandbox a vitest worker uses, and how many Testserver sandboxes a run counts for sizing workers.
2
2
  // Pure: no vitest import, so `config.ts`, which a `vitest.config.ts` loads, can use it.
3
3
  /** What a test that needs a Testserver sandbox fails with in a run that holds none. */
4
- export const NO_TESTSERVER_MESSAGE = "this run has no Testserver; add resources.testserverPool to storm.config.ts or pass --set resources.testserverPool.sandboxes=<n>";
4
+ export const NO_TESTSERVER_MESSAGE = "this run has no Testserver; add resources.testserverPool to storm.config.ts or pass --testserver-sandboxes <n>";
5
5
  /**
6
6
  * The Testserver URL of the Testserver sandbox the vitest worker numbered `poolId` uses:
7
7
  * `sandboxes[(poolId - 1) % N]` of the run payload's `resources.testserverPool`. `poolId` is the worker's
@@ -7,12 +7,12 @@ export type TestEventReporter = (event: ReportedTestEvent) => void;
7
7
  export declare const silentTestEvents: TestEventReporter;
8
8
  /**
9
9
  * The reporter for this worker: appends each event, with the worker's `VITEST_POOL_ID` and the time, to the run
10
- * payload's `testEvents` file. Outside `storm run`, when the run payload names no such file, or outside a vitest
10
+ * payload's `testEvents` file. Outside a storm run, when the run payload names no such file, or outside a vitest
11
11
  * worker, it reports nothing; and once an append fails it drops every later event: reporting never fails a test.
12
12
  */
13
13
  export declare function testEventReporter(env?: Readonly<Record<string, string | undefined>>, append?: (path: string, text: string) => void, now?: () => number): TestEventReporter;
14
14
  /**
15
- * The test events file the run payload in `env` names; undefined outside `storm run`, when the run payload
15
+ * The test events file the run payload in `env` names; undefined outside a storm run, when the run payload
16
16
  * names none, or when it can't be read.
17
17
  */
18
18
  export declare function testEventsFile(env: Readonly<Record<string, string | undefined>>): string | undefined;
@@ -1,4 +1,4 @@
1
- // The test events a vitest worker appends to the run payload's `testEvents` file, so `storm run` can show which
1
+ // The test events a vitest worker appends to the run payload's `testEvents` file, so the run can show which
2
2
  // worker runs which file, how long each container start and test attempt takes, and how busy the workers are. A
3
3
  // test's final result comes from vitest's main process instead (`test-results.ts`). Pure but for the append, which a
4
4
  // reporter does with one write a line: a short `O_APPEND` write lands whole beside other workers'.
@@ -8,7 +8,7 @@ import { readRunPayload, RUN_PAYLOAD_VARIABLE, testEventLine, } from "../sdk/ind
8
8
  export const silentTestEvents = () => { };
9
9
  /**
10
10
  * The reporter for this worker: appends each event, with the worker's `VITEST_POOL_ID` and the time, to the run
11
- * payload's `testEvents` file. Outside `storm run`, when the run payload names no such file, or outside a vitest
11
+ * payload's `testEvents` file. Outside a storm run, when the run payload names no such file, or outside a vitest
12
12
  * worker, it reports nothing; and once an append fails it drops every later event: reporting never fails a test.
13
13
  */
14
14
  export function testEventReporter(env = process.env, append = (path, text) => appendFileSync(path, text), now = Date.now) {
@@ -31,7 +31,7 @@ export function testEventReporter(env = process.env, append = (path, text) => ap
31
31
  };
32
32
  }
33
33
  /**
34
- * The test events file the run payload in `env` names; undefined outside `storm run`, when the run payload
34
+ * The test events file the run payload in `env` names; undefined outside a storm run, when the run payload
35
35
  * names none, or when it can't be read.
36
36
  */
37
37
  export function testEventsFile(env) {
@@ -71,7 +71,7 @@ export interface StormReporter {
71
71
  * the run ends. Errors are vitest's, the first `MAX_ERRORS`, each `message` and `diff` cut to `ERROR_TEXT_CHARS` and
72
72
  * `stack` to `STACK_LINES` lines.
73
73
  *
74
- * Outside `storm run`, or when the run payload names no test events file, it reports and keeps nothing; a test
74
+ * Outside a storm run, or when the run payload names no test events file, it reports and keeps nothing; a test
75
75
  * whose result can't be read is dropped; and once an append fails it drops every later result: reporting never fails
76
76
  * a test.
77
77
  */
@@ -32,7 +32,7 @@ export const STACK_LINES = 30;
32
32
  * the run ends. Errors are vitest's, the first `MAX_ERRORS`, each `message` and `diff` cut to `ERROR_TEXT_CHARS` and
33
33
  * `stack` to `STACK_LINES` lines.
34
34
  *
35
- * Outside `storm run`, or when the run payload names no test events file, it reports and keeps nothing; a test
35
+ * Outside a storm run, or when the run payload names no test events file, it reports and keeps nothing; a test
36
36
  * whose result can't be read is dropped; and once an append fails it drops every later result: reporting never fails
37
37
  * a test.
38
38
  */
@@ -5,7 +5,7 @@ import type { ContainerScope } from "./container-scope.ts";
5
5
  export interface StormWorkerFixtures {
6
6
  /** This worker's Testserver sandbox, `sandboxes[(VITEST_POOL_ID - 1) % N]` of the run payload's Testserver pool. */
7
7
  testserverUrl: string;
8
- /** Whether the run is verbose (`storm run --verbose`). */
8
+ /** Whether the run is verbose (its `--verbose`). */
9
9
  verbose: boolean;
10
10
  }
11
11
  /** The adapter's fixtures set up for each test. */