@cnc-tools/storm 0.13.0 → 0.14.1

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 (136) hide show
  1. package/dist/application.js +5 -1
  2. package/dist/bin/storm.js +6 -2
  3. package/dist/build-info.js +1 -1
  4. package/dist/chunks/{chunk-N7E6DAUE.js → chunk-27P2QSIM.js} +1 -1
  5. package/dist/chunks/{chunk-ZDJLKF2G.js → chunk-5ED3IDUJ.js} +7 -4
  6. package/dist/chunks/{chunk-6EQKA7LI.js → chunk-5TMHYH7G.js} +1 -1
  7. package/dist/chunks/{chunk-AX4EQZUS.js → chunk-BFLYGMG3.js} +12 -7
  8. package/dist/chunks/{chunk-LQKNI3EG.js → chunk-BRUIATTR.js} +6 -6
  9. package/dist/chunks/{chunk-DOFB2ACU.js → chunk-HOKDKP5A.js} +1 -1
  10. package/dist/chunks/{chunk-EGNP3S6C.js → chunk-IVRRGGCD.js} +60 -20
  11. package/dist/chunks/{chunk-RTILVSYQ.js → chunk-QBR5VHJ7.js} +1 -1
  12. package/dist/chunks/{chunk-YT5OROR7.js → chunk-RA4L2ACU.js} +12 -2
  13. package/dist/chunks/{chunk-YGS5VRQT.js → chunk-RKONDLPS.js} +8 -5
  14. package/dist/chunks/{chunk-IYM44FUX.js → chunk-UC6DULWY.js} +2 -2
  15. package/dist/chunks/{chunk-2NZXL6OH.js → chunk-XPCUINWS.js} +1 -1
  16. package/dist/chunks/{chunk-Q4TKRILH.js → chunk-YBPTMJUM.js} +98 -21
  17. package/dist/chunks/{chunk-5UMJNVKT.js → chunk-Z5OXOZD3.js} +125 -83
  18. package/dist/chunks/{chunk-X4WBJIOF.js → chunk-ZH5R7W4A.js} +1 -1
  19. package/dist/chunks/{live-app-QFHS54SX.js → live-app-FBVWUUMT.js} +7 -7
  20. package/dist/commands/exec/command.d.ts +2 -0
  21. package/dist/commands/exec/command.js +15 -41
  22. package/dist/commands/exec/define-run-command.d.ts +17 -10
  23. package/dist/commands/exec/define-run-command.js +48 -15
  24. package/dist/commands/exec/driver-plan.d.ts +24 -16
  25. package/dist/commands/exec/driver-plan.js +34 -15
  26. package/dist/commands/exec/driver-refusals.js +7 -6
  27. package/dist/commands/exec/exec-words.d.ts +1 -1
  28. package/dist/commands/exec/exec-words.js +8 -2
  29. package/dist/commands/exec/final-results.d.ts +39 -0
  30. package/dist/commands/exec/final-results.js +29 -0
  31. package/dist/commands/exec/metadata.js +1 -1
  32. package/dist/commands/exec/outcomes.d.ts +13 -3
  33. package/dist/commands/exec/outcomes.js +21 -4
  34. package/dist/commands/exec/plan-run.d.ts +11 -3
  35. package/dist/commands/exec/plan-run.js +3 -2
  36. package/dist/commands/exec/run-command.d.ts +1 -1
  37. package/dist/commands/exec/run-command.js +27 -5
  38. package/dist/commands/exec/test-plan.d.ts +2 -1
  39. package/dist/commands/exec/test-plan.js +13 -4
  40. package/dist/commands/exec/tests-summary.d.ts +2 -2
  41. package/dist/commands/exec/worker-chart.d.ts +1 -1
  42. package/dist/commands/playwright/command.d.ts +10 -7
  43. package/dist/commands/playwright/command.js +14 -14
  44. package/dist/commands/playwright/metadata.js +2 -2
  45. package/dist/commands/runs/list/command.js +6 -6
  46. package/dist/commands/runs/logs/command.js +6 -6
  47. package/dist/commands/runs/show/command.d.ts +2 -2
  48. package/dist/commands/runs/show/command.js +11 -11
  49. package/dist/commands/runs/show/outcomes.d.ts +1 -1
  50. package/dist/commands/snapshots/build/command.js +12 -12
  51. package/dist/commands/snapshots/list/command.js +9 -9
  52. package/dist/commands/vitest/command.d.ts +12 -8
  53. package/dist/commands/vitest/command.js +14 -14
  54. package/dist/commands/vitest/metadata.js +2 -2
  55. package/dist/config/resolve.d.ts +1 -1
  56. package/dist/config/resolve.js +2 -1
  57. package/dist/config/schema.d.ts +8 -0
  58. package/dist/config/schema.js +5 -4
  59. package/dist/extensions/playwright/driver.js +17 -10
  60. package/dist/extensions/testserver/commands/pool/create/command.js +4 -4
  61. package/dist/extensions/testserver/commands/pool/list/command.js +2 -2
  62. package/dist/extensions/testserver/definition.d.ts +1 -1
  63. package/dist/extensions/testserver/extension.d.ts +1 -1
  64. package/dist/extensions/testserver/options/rules.d.ts +3 -3
  65. package/dist/extensions/testserver/options/rules.js +5 -5
  66. package/dist/extensions/testserver/resource.d.ts +1 -1
  67. package/dist/extensions/testserver/vercel-cli/arguments.d.ts +10 -4
  68. package/dist/extensions/testserver/vercel-cli/arguments.js +17 -6
  69. package/dist/extensions/testserver/vercel-cli/environment.d.ts +12 -1
  70. package/dist/extensions/testserver/vercel-cli/environment.js +35 -5
  71. package/dist/extensions/testserver/vercel-cli/index.d.ts +1 -0
  72. package/dist/extensions/testserver/vercel-cli/index.js +1 -0
  73. package/dist/extensions/testserver/vercel-cli/invoker.d.ts +28 -13
  74. package/dist/extensions/testserver/vercel-cli/invoker.js +81 -67
  75. package/dist/extensions/testserver/vercel-cli/live/process-gateway.js +4 -10
  76. package/dist/extensions/testserver/vercel-cli/report.js +5 -2
  77. package/dist/extensions/testserver/vercel-cli/session-id.d.ts +8 -0
  78. package/dist/extensions/testserver/vercel-cli/session-id.js +17 -0
  79. package/dist/extensions/testserver/vitest/config.d.ts +2 -2
  80. package/dist/extensions/testserver/vitest/config.js +2 -2
  81. package/dist/extensions/testserver/vitest/container-scope.d.ts +25 -16
  82. package/dist/extensions/testserver/vitest/container-scope.js +32 -13
  83. package/dist/extensions/testserver/vitest/diagnostics.d.ts +14 -12
  84. package/dist/extensions/testserver/vitest/diagnostics.js +29 -21
  85. package/dist/extensions/testserver/vitest/fixtures.d.ts +14 -1
  86. package/dist/extensions/testserver/vitest/fixtures.js +41 -12
  87. package/dist/extensions/testserver/vitest/types.d.ts +16 -0
  88. package/dist/extensions/vitest/driver.js +28 -14
  89. package/dist/extensions/vitest/plan/gateways.d.ts +28 -5
  90. package/dist/extensions/vitest/plan/gateways.js +2 -2
  91. package/dist/extensions/vitest/plan/list-output.d.ts +5 -0
  92. package/dist/extensions/vitest/plan/list-output.js +23 -9
  93. package/dist/extensions/vitest/plan/live/list-gateway.d.ts +3 -2
  94. package/dist/extensions/vitest/plan/live/list-gateway.js +77 -64
  95. package/dist/extensions/vitest/plan/plan-over.d.ts +19 -7
  96. package/dist/extensions/vitest/plan/plan-over.js +18 -7
  97. package/dist/extensions/vitest/plan/plan.d.ts +14 -5
  98. package/dist/extensions/vitest/plan/plan.js +23 -9
  99. package/dist/extensions.d.ts +2 -2
  100. package/dist/run-directory/plan.d.ts +3 -2
  101. package/dist/run-directory/plan.js +6 -3
  102. package/dist/run-directory/run-record.d.ts +4 -3
  103. package/dist/runner/recipe.d.ts +5 -1
  104. package/dist/runner/sandboxed-command.d.ts +5 -3
  105. package/dist/runner/sandboxed-command.js +10 -4
  106. package/dist/sdk/extension/driver.d.ts +32 -6
  107. package/dist/sdk/extension/driver.js +12 -2
  108. package/dist/sdk/extension/index.d.ts +1 -1
  109. package/dist/sdk/extension/index.js +2 -1
  110. package/dist/sdk/extension/resource-definition.d.ts +6 -5
  111. package/dist/vendor/testserver-sdk/container/api-request.d.ts +2 -3
  112. package/dist/vendor/testserver-sdk/container/api-request.js +2 -3
  113. package/dist/vendor/testserver-sdk/container/container.d.ts +12 -2
  114. package/dist/vendor/testserver-sdk/container/container.js +10 -7
  115. package/dist/vendor/testserver-sdk/container/recorder.d.ts +29 -7
  116. package/dist/vendor/testserver-sdk/container/recorder.js +26 -14
  117. package/dist/vendor/testserver-sdk/index.d.ts +1 -1
  118. package/dist/vendor/testserver-sdk/index.js +1 -1
  119. package/dist/vendor/testserver-sdk/proxy/exchange.d.ts +24 -5
  120. package/dist/vendor/testserver-sdk/proxy/exchange.js +43 -25
  121. package/dist/vendor/testserver-sdk/proxy/faulted-exchange.js +15 -10
  122. package/dist/vendor/testserver-sdk/proxy/faults.d.ts +6 -5
  123. package/dist/vendor/testserver-sdk/proxy/proxy.d.ts +10 -1
  124. package/dist/vendor/testserver-sdk/proxy/proxy.js +5 -3
  125. package/dist/vendor/testserver-sdk/proxy/records.d.ts +17 -17
  126. package/dist/vendor/testserver-sdk/proxy/records.js +18 -17
  127. package/dist/vendor/testserver-sdk/records/body.d.ts +7 -9
  128. package/dist/vendor/testserver-sdk/records/body.js +10 -15
  129. package/dist/vendor/testserver-sdk/records/headers.d.ts +79 -0
  130. package/dist/vendor/testserver-sdk/records/headers.js +162 -0
  131. package/dist/vendor/testserver-sdk/records/index.d.ts +2 -1
  132. package/dist/vendor/testserver-sdk/records/index.js +4 -2
  133. package/dist/vendor/testserver-sdk/records/records.d.ts +19 -10
  134. package/package.json +5 -4
  135. package/skills/overview.md +5 -5
  136. package/skills/testserver-builds.md +0 -82
@@ -3,7 +3,11 @@ import { createApplication } from "@vercel/clinkr";
3
3
  import { stormCommands } from "./command-tree.js";
4
4
  import { stormHelpLogo } from "./help-logo.js";
5
5
  import { extensionMounts } from "./extension-commands.js";
6
- const DESCRIPTION = "Run a command, in a runner sandbox or unsandboxed on this machine, with the resources it needs.";
6
+ const DESCRIPTION = [
7
+ "Run a command, in a runner sandbox or unsandboxed on this machine, with the resources it needs.",
8
+ "",
9
+ "Docs: https://storm.playground-vercel.tools/",
10
+ ].join("\n");
7
11
  /**
8
12
  * Discovers the `storm` command tree under `commands/` in `root`, and mounts each extension's own command tree under
9
13
  * its `ext` group (`extensionMounts`, from `extension-commands.ts`, which loads no extension's resources), at
package/dist/bin/storm.js CHANGED
@@ -72,7 +72,11 @@ function extensionMounts(root2) {
72
72
  }
73
73
 
74
74
  // src/application.ts
75
- var DESCRIPTION = "Run a command, in a runner sandbox or unsandboxed on this machine, with the resources it needs.";
75
+ var DESCRIPTION = [
76
+ "Run a command, in a runner sandbox or unsandboxed on this machine, with the resources it needs.",
77
+ "",
78
+ "Docs: https://storm.playground-vercel.tools/"
79
+ ].join("\n");
76
80
  async function loadStormApplication(version2, options) {
77
81
  const { accessible: accessible2, root: root2 } = options;
78
82
  return await createApplication("storm", {
@@ -101,7 +105,7 @@ var exit = { status: void 0 };
101
105
  var accessible = process.env["VERCEL_ACCESSIBLE"] === "1";
102
106
  var status = await runNodeCli(await loadStormApplication(version, { accessible, root }), {
103
107
  app: async (host) => {
104
- const [{ liveStormApp }, built] = await Promise.all([import("../chunks/live-app-QFHS54SX.js"), commit()]);
108
+ const [{ liveStormApp }, built] = await Promise.all([import("../chunks/live-app-FBVWUUMT.js"), commit()]);
105
109
  return liveStormApp(host, { version: manifest.version, commit: built }, exit);
106
110
  }
107
111
  });
@@ -1,3 +1,3 @@
1
1
  // Written by scripts/write-build-info.js when the package was built.
2
- export const sha = "d80d9a1a270b";
2
+ export const sha = "36a0a0305429";
3
3
  export const dirty = false;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  redactSecrets
3
- } from "./chunk-ZDJLKF2G.js";
3
+ } from "./chunk-5ED3IDUJ.js";
4
4
 
5
5
  // src/commands/exec/redaction.ts
6
6
  function redactor(secrets) {
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  Credential,
3
3
  NOT_COUNTED,
4
+ booleanOption,
4
5
  defaultResourceKey,
5
6
  describeMintFailure,
6
7
  describeValue,
@@ -9,7 +10,7 @@ import {
9
10
  resourceCall,
10
11
  tokenRequestFailureFacts,
11
12
  tokenRequestFailureShape
12
- } from "./chunk-YT5OROR7.js";
13
+ } from "./chunk-RA4L2ACU.js";
13
14
  import {
14
15
  defineErrors,
15
16
  refused
@@ -2142,7 +2143,7 @@ function sandboxEnvironment(request2) {
2142
2143
  return {
2143
2144
  PATH: [...bins, request2.loginPath].filter((part) => part !== "").join(":"),
2144
2145
  NO_UPDATE_NOTIFIER: "1",
2145
- ...request2.color ? { FORCE_COLOR: "1" } : { NO_COLOR: "1" },
2146
+ ...request2.env["FORCE_COLOR"] !== void 0 || request2.env["NO_COLOR"] !== void 0 ? {} : request2.color ? { FORCE_COLOR: "1" } : { NO_COLOR: "1" },
2146
2147
  ...request2.env,
2147
2148
  [RUN_PAYLOAD_VARIABLE]: request2.runPayload
2148
2149
  };
@@ -2481,7 +2482,8 @@ function checkWith(schema, value) {
2481
2482
  var SETTING_CHECKS = {
2482
2483
  scope: (value) => checkWith(nonEmptyString, value),
2483
2484
  project: (value) => checkWith(nonEmptyString, value),
2484
- runner: checkRecipe
2485
+ runner: checkRecipe,
2486
+ testPlan: (value) => checkWith(booleanOption, value)
2485
2487
  };
2486
2488
  function isConfigSettingKey(key) {
2487
2489
  return Object.hasOwn(SETTING_CHECKS, key);
@@ -2737,7 +2739,8 @@ function resolveSettings(flags, file) {
2737
2739
  return {
2738
2740
  scope: pick(flags.scope, file?.scope),
2739
2741
  project: pick(flags.project, file?.project),
2740
- runner: pick(void 0, file?.runner)
2742
+ runner: pick(void 0, file?.runner),
2743
+ testPlan: pick(void 0, file?.testPlan)
2741
2744
  };
2742
2745
  }
2743
2746
  function optionSource(definition, option, file, flags) {
@@ -7,7 +7,7 @@ import {
7
7
  parseTestEvent,
8
8
  systemClock,
9
9
  systemTimer
10
- } from "./chunk-ZDJLKF2G.js";
10
+ } from "./chunk-5ED3IDUJ.js";
11
11
 
12
12
  // src/core/reports.ts
13
13
  var WARNINGS_HEADING = "Warnings";
@@ -2,7 +2,7 @@ import {
2
2
  DEFINITION_SET,
3
3
  EXTENSIONS,
4
4
  RESOURCES
5
- } from "./chunk-5UMJNVKT.js";
5
+ } from "./chunk-Z5OXOZD3.js";
6
6
  import {
7
7
  median,
8
8
  paint,
@@ -10,20 +10,20 @@ import {
10
10
  shortFile,
11
11
  truncate,
12
12
  visibleLength
13
- } from "./chunk-RTILVSYQ.js";
13
+ } from "./chunk-QBR5VHJ7.js";
14
14
  import {
15
15
  megabytesText,
16
16
  sameRow,
17
17
  setupPhaseKey,
18
18
  setupPhaseWords
19
- } from "./chunk-6EQKA7LI.js";
19
+ } from "./chunk-5TMHYH7G.js";
20
20
  import {
21
21
  CONFIG_FILE_NAME
22
- } from "./chunk-ZDJLKF2G.js";
22
+ } from "./chunk-5ED3IDUJ.js";
23
23
  import {
24
24
  defaultResourceKey,
25
25
  optionKeyPath
26
- } from "./chunk-YT5OROR7.js";
26
+ } from "./chunk-RA4L2ACU.js";
27
27
 
28
28
  // src/commands/exec/tests-summary.ts
29
29
  var SLOWEST_FILES = 3;
@@ -560,7 +560,11 @@ function resourceFlagValues(request) {
560
560
 
561
561
  // src/commands/exec/test-plan.ts
562
562
  function recordedPlan(testPlan, options) {
563
- return testPlan.kind === "counted" ? { tests: testPlan.tests, files: testPlan.files, options: options.map((option) => ({ ...option })) } : void 0;
563
+ return testPlan.kind === "counted" ? {
564
+ ...testPlan.tests === void 0 ? {} : { tests: testPlan.tests },
565
+ files: testPlan.files,
566
+ options: options.map((option) => ({ ...option }))
567
+ } : void 0;
564
568
  }
565
569
  function testPlanLine(plan) {
566
570
  return `Running ${testPlanText(plan)}`;
@@ -569,7 +573,8 @@ function testPlanText(plan) {
569
573
  return [countText(plan), ...plan.options.map(planOptionText)].join("; ");
570
574
  }
571
575
  function countText({ tests, files }) {
572
- return `${tests} ${tests === 1 ? "test" : "tests"} in ${files} ${files === 1 ? "file" : "files"}`;
576
+ const inFiles = `in ${files} ${files === 1 ? "file" : "files"}`;
577
+ return tests === void 0 ? `tests ${inFiles}` : `${tests} ${tests === 1 ? "test" : "tests"} ${inFiles}`;
573
578
  }
574
579
  function planOptionText({ path, value, from }) {
575
580
  return `${path} ${String(value)} (${fromText(path, from)})`;
@@ -2,7 +2,7 @@ import {
2
2
  booleanOption,
3
3
  mustBe,
4
4
  nonEmptyString
5
- } from "./chunk-YT5OROR7.js";
5
+ } from "./chunk-RA4L2ACU.js";
6
6
 
7
7
  // src/extensions/testserver/options/channels.ts
8
8
  var BUILD_CHANNELS = ["stable", "latest_main"];
@@ -132,17 +132,17 @@ var TTL = "a whole number of minutes or hours from 10m to 5h";
132
132
  var ttl = z.string(mustBe(TTL)).refine((value) => parseTtl(value) !== void 0, mustBe(TTL));
133
133
  var testserverPoolRules = {
134
134
  /**
135
- * How many Testserver sandboxes a run gets: 1 to 32; by default 1, or with `storm vitest` or `storm playwright` one
136
- * per 4 test files it counted, at most 8.
135
+ * How many Testserver sandboxes a run gets: 1 to 32; by default 1, or one per 4 test files `storm vitest` or
136
+ * `storm playwright` counted, at most 8, for a run that counts (`testPlan`).
137
137
  */
138
138
  sandboxes: {
139
139
  schema: sandboxCount,
140
- // `storm vitest` and `storm playwright` size the run from its tests; a run that counts none, such as
141
- // `storm exec`'s, asks for one.
140
+ // `storm vitest` and `storm playwright` size the run from its test files where the config file sets `testPlan`; a
141
+ // run that counts none, such as `storm exec`'s, asks for one.
142
142
  default: ({ testPlan }) => testPlan.kind === "counted" ? sandboxesForTests(testPlan.files) : MIN_SANDBOXES,
143
143
  flag: {
144
144
  valueLabel: "N",
145
- description: "How many Testserver sandboxes the command gets, 1 to 32, overriding resources.testserverPool.sandboxes in storm.config.ts; default 1, or with storm vitest or storm playwright one per 4 test files it counted, at most 8. Gives the run the Testserver pool."
145
+ description: "How many Testserver sandboxes the command gets, 1 to 32, overriding resources.testserverPool.sandboxes in storm.config.ts; default 1, or one per 4 test files when storm vitest or storm playwright counts them (testPlan in storm.config.ts), at most 8. Gives the run the Testserver pool."
146
146
  }
147
147
  },
148
148
  /**
@@ -2,7 +2,7 @@ import {
2
2
  RESOURCE_FLAG_HELP,
3
3
  RESOURCE_USAGE_FLAGS,
4
4
  resourceRunExamples
5
- } from "./chunk-AX4EQZUS.js";
5
+ } from "./chunk-BFLYGMG3.js";
6
6
 
7
7
  // src/commands/exec/run-metadata.ts
8
8
  var RUN_USAGE_FLAGS = `${RESOURCE_USAGE_FLAGS} [--credential <SOURCE>] [--scope <TEAM> --project <PROJECT>] [--unsandboxed | [--show-output] [--keep-sandbox <DURATION>]] [--verbose]`;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runHelp
3
- } from "./chunk-DOFB2ACU.js";
3
+ } from "./chunk-HOKDKP5A.js";
4
4
  import {
5
5
  RAN_DESCRIPTION,
6
6
  RUN_CLI_OPTIONS,
@@ -8,17 +8,21 @@ import {
8
8
  RUN_REQUEST_FIELDS,
9
9
  canceledBeforeStart,
10
10
  checkoutFailedRefusal,
11
+ ranRenderer,
11
12
  ranSchema,
12
- renderRan,
13
13
  runCommand,
14
14
  runProblems
15
- } from "./chunk-Q4TKRILH.js";
15
+ } from "./chunk-YBPTMJUM.js";
16
+ import {
17
+ recordedPlan
18
+ } from "./chunk-BFLYGMG3.js";
16
19
  import {
17
20
  planSchema
18
- } from "./chunk-YGS5VRQT.js";
21
+ } from "./chunk-RKONDLPS.js";
19
22
  import {
20
- DRIVER_PLAN_FAILURE_KINDS
21
- } from "./chunk-YT5OROR7.js";
23
+ DRIVER_PLAN_FAILURE_KINDS,
24
+ NOT_COUNTED
25
+ } from "./chunk-RA4L2ACU.js";
22
26
  import {
23
27
  stormCommands
24
28
  } from "./chunk-43MWZLJR.js";
@@ -47,8 +51,10 @@ async function findRunBin(app, name, where) {
47
51
  }
48
52
 
49
53
  // src/commands/exec/driver-plan.ts
50
- async function planDriverCommand(app, driver, errors, args, where, signal) {
54
+ async function planDriverCommand(app, driver, errors, args, count, where, signal) {
51
55
  const { bin: name } = driver.program;
56
+ if (count === void 0 && where.kind === "runner")
57
+ return { ok: true, argv: driver.launch(name, args), testPlan: NOT_COUNTED.testPlan };
52
58
  const bin = await findRunBin(app, name, where);
53
59
  if (bin.kind === "checkout-failed") return refused(checkoutFailedRefusal(bin.failure));
54
60
  const planned = { args, cwd: bin.cwd };
@@ -59,16 +65,26 @@ async function planDriverCommand(app, driver, errors, args, where, signal) {
59
65
  planned
60
66
  )
61
67
  );
68
+ if (count === void 0) return { ok: true, argv: driver.launch(bin.runs, args), testPlan: NOT_COUNTED.testPlan };
62
69
  const contexts = app.driverContexts;
63
- const answer = await driver.plan(contexts[driver.name])({ ...planned, bin: bin.counts, signal });
70
+ const answer = await driver.plan(contexts[driver.name])({
71
+ ...planned,
72
+ bin: bin.counts,
73
+ countTests: count.countTests,
74
+ signal
75
+ });
64
76
  if (!answer.ok) {
65
77
  const { kind, message } = answer;
66
78
  if (kind === "canceled") return refused(canceledBeforeStart());
67
79
  return refused(errors.planFailed({ kind, message }, planned));
68
80
  }
69
81
  const { tests, files } = answer.plan;
70
- if (tests === 0) return refused(errors.noMatchingTests(planned));
71
- return { ok: true, argv: driver.launch(bin.runs, args), testPlan: { kind: "counted", tests, files } };
82
+ if ((tests ?? files) === 0) return refused(errors.noMatchingTests(planned));
83
+ return {
84
+ ok: true,
85
+ argv: driver.launch(bin.runs, args),
86
+ testPlan: { kind: "counted", ...tests === void 0 ? {} : { tests }, files }
87
+ };
72
88
  }
73
89
 
74
90
  // src/commands/exec/driver-refusals.ts
@@ -78,7 +94,7 @@ var plannedShape = {
78
94
  driver: z.string().min(1),
79
95
  /** The arguments given to the driver's program, which its plan step was given too. */
80
96
  args: z.array(z.string()),
81
- /** The directory the tests were counted in, on this machine. */
97
+ /** The directory the run was planned in, on this machine: where its program was looked for and its tests counted. */
82
98
  cwd: z.string()
83
99
  };
84
100
  function driverRefusals({ name, refusals }) {
@@ -105,7 +121,7 @@ function driverRefusals({ name, refusals }) {
105
121
  cwd: plannedShape.cwd
106
122
  }),
107
123
  render: ({ kind, message, cwd }) => ({
108
- message: `Couldn't count the tests in ${cwd}: ${/[.!?]$/.test(message) ? message : `${message}.`} The command didn't run.`,
124
+ message: `Couldn't plan the run in ${cwd}: ${/[.!?]$/.test(message) ? message : `${message}.`} The command didn't run.`,
109
125
  next: [{ type: "text", text: refusals.planFailed.next[kind] }]
110
126
  })
111
127
  }
@@ -130,31 +146,55 @@ function defineRunCommand(driver) {
130
146
  ran: {
131
147
  schema: ranSchema.extend({
132
148
  /**
133
- * The test plan: what the driver's plan step counted before the run, and each resource option whose default
134
- * is a function of it, with its value and where that came from.
149
+ * The test plan of a run that counted: what the driver's plan step counted before the run, and each resource
150
+ * option whose default is a function of it, with its value and where that came from. Absent for a run that
151
+ * counted nothing.
135
152
  */
136
- plan: planSchema
153
+ plan: planSchema.exactOptional()
137
154
  }),
138
155
  description: RAN_DESCRIPTION,
139
- render: renderRan
156
+ render: ranRenderer(driver.hints)
140
157
  }
141
158
  },
142
159
  errors: { ...RUN_ERRORS, ...errors.errors }
143
160
  });
161
+ const help = runHelp(driver.help, "args", { driver: driver.name });
144
162
  return stormCommands.define({
145
- requestSchema: z2.object({ ...RUN_REQUEST_FIELDS, args: z2.array(z2.string()).default([]) }),
163
+ requestSchema: z2.object({
164
+ ...RUN_REQUEST_FIELDS,
165
+ ...countTestsField(driver),
166
+ args: z2.array(z2.string()).default([])
167
+ }),
146
168
  cli: { options: RUN_CLI_OPTIONS, positionals: ["args"] },
147
- help: runHelp(driver.help, "args", { driver: driver.name }),
169
+ help: driver.countTests === void 0 ? help : { ...help, fields: { ...help.fields, countTests: { description: driver.countTests.description } } },
148
170
  response: counted,
149
171
  validate: runProblems,
150
172
  handler: async (context, request) => await runCommand(context, request, {
151
173
  name: driver.name,
152
174
  hints: driver.hints,
153
- planCommand: async (where, signal) => await planDriverCommand(context.app, driver, errors, request.args, where, signal),
154
- ran: (facts, { testPlan, options }) => counted.ran({ ...facts, plan: { tests: testPlan.tests, files: testPlan.files, options: [...options] } })
175
+ planCommand: async (where, signal, { testPlan }) => await planDriverCommand(
176
+ context.app,
177
+ driver,
178
+ errors,
179
+ request.args,
180
+ driverCount(driver, testPlan, request.countTests === true),
181
+ where,
182
+ signal
183
+ ),
184
+ ran: (facts, { testPlan, options }) => {
185
+ const plan = recordedPlan(testPlan, options);
186
+ return counted.ran({ ...facts, ...plan === void 0 ? {} : { plan } });
187
+ }
155
188
  })
156
189
  });
157
190
  }
191
+ function driverCount(driver, testPlan, countTests) {
192
+ if (!testPlan && !countTests) return void 0;
193
+ return { countTests: driver.countTests === void 0 || countTests };
194
+ }
195
+ function countTestsField(driver) {
196
+ return driver.countTests === void 0 ? {} : { countTests: z2.boolean().default(false) };
197
+ }
158
198
 
159
199
  export {
160
200
  defineRunCommand
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  secondsOf,
3
3
  secondsText
4
- } from "./chunk-6EQKA7LI.js";
4
+ } from "./chunk-5TMHYH7G.js";
5
5
 
6
6
  // src/commands/exec/text.ts
7
7
  function seconds(ms) {
@@ -214,8 +214,18 @@ function defineResource(spec) {
214
214
  // src/sdk/extension/driver.ts
215
215
  var DRIVER_PLAN_FAILURE_KINDS = ["start-failed", "timed-out", "exited", "unreadable-output"];
216
216
  function defineDriver(spec) {
217
- const { name, program, context, launch, plan, help, hints, refusals } = spec;
218
- const driver = { name, program, context, launch, plan, help, hints, refusals };
217
+ const { name, program, context, launch, plan, countTests, help, hints, refusals } = spec;
218
+ const driver = {
219
+ name,
220
+ program,
221
+ context,
222
+ launch,
223
+ plan,
224
+ ...countTests === void 0 ? {} : { countTests },
225
+ help,
226
+ hints,
227
+ refusals
228
+ };
219
229
  return driver;
220
230
  }
221
231
  function argsText(args) {
@@ -2,11 +2,11 @@ import {
2
2
  EMPTY_RUN_STATE,
3
3
  commandExitStatus,
4
4
  observeAll
5
- } from "./chunk-6EQKA7LI.js";
5
+ } from "./chunk-5TMHYH7G.js";
6
6
  import {
7
7
  parseTestEvent,
8
8
  testEventLine
9
- } from "./chunk-ZDJLKF2G.js";
9
+ } from "./chunk-5ED3IDUJ.js";
10
10
 
11
11
  // src/run-directory/run-directory.ts
12
12
  import { join } from "node:path";
@@ -63,9 +63,12 @@ var planOptionSchema = z.object({
63
63
  from: z.enum(["flag", "file", "default"])
64
64
  });
65
65
  var planSchema = z.object({
66
- /** How many tests `vitest list --json <args>` or `playwright test <args> --list` counted. */
67
- tests: z.number().int().nonnegative(),
68
- /** How many distinct test files they are in. */
66
+ /**
67
+ * How many tests `vitest list <args> --json` or `playwright test <args> --list` counted; absent when the run counted
68
+ * only the test files, as `storm vitest` does without `--count-tests`.
69
+ */
70
+ tests: z.number().int().nonnegative().optional(),
71
+ /** How many distinct test files the run counted. */
69
72
  files: z.number().int().nonnegative(),
70
73
  /**
71
74
  * Each resource option whose default is a function of the test plan, with its value and where that came from; empty
@@ -21,13 +21,13 @@ import {
21
21
  testserverPoolRules,
22
22
  ttlMinutes,
23
23
  unavailablePoolStoreGateway
24
- } from "./chunk-LQKNI3EG.js";
24
+ } from "./chunk-BRUIATTR.js";
25
25
  import {
26
26
  defineResource,
27
27
  describeCredentialFailure,
28
28
  optionKeyPath,
29
29
  tokenRequestFailureFacts
30
- } from "./chunk-YT5OROR7.js";
30
+ } from "./chunk-RA4L2ACU.js";
31
31
 
32
32
  // src/extensions/testserver/credential-facts.ts
33
33
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  short
3
- } from "./chunk-RTILVSYQ.js";
3
+ } from "./chunk-QBR5VHJ7.js";
4
4
 
5
5
  // src/commands/exec/snapshot-text.ts
6
6
  var REJECTIONS_SHOWN = 5;