@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.
- package/dist/application.js +5 -1
- package/dist/bin/storm.js +6 -2
- package/dist/build-info.js +1 -1
- package/dist/chunks/{chunk-N7E6DAUE.js → chunk-27P2QSIM.js} +1 -1
- package/dist/chunks/{chunk-ZDJLKF2G.js → chunk-5ED3IDUJ.js} +7 -4
- package/dist/chunks/{chunk-6EQKA7LI.js → chunk-5TMHYH7G.js} +1 -1
- package/dist/chunks/{chunk-AX4EQZUS.js → chunk-BFLYGMG3.js} +12 -7
- package/dist/chunks/{chunk-LQKNI3EG.js → chunk-BRUIATTR.js} +6 -6
- package/dist/chunks/{chunk-DOFB2ACU.js → chunk-HOKDKP5A.js} +1 -1
- package/dist/chunks/{chunk-EGNP3S6C.js → chunk-IVRRGGCD.js} +60 -20
- package/dist/chunks/{chunk-RTILVSYQ.js → chunk-QBR5VHJ7.js} +1 -1
- package/dist/chunks/{chunk-YT5OROR7.js → chunk-RA4L2ACU.js} +12 -2
- package/dist/chunks/{chunk-YGS5VRQT.js → chunk-RKONDLPS.js} +8 -5
- package/dist/chunks/{chunk-IYM44FUX.js → chunk-UC6DULWY.js} +2 -2
- package/dist/chunks/{chunk-2NZXL6OH.js → chunk-XPCUINWS.js} +1 -1
- package/dist/chunks/{chunk-Q4TKRILH.js → chunk-YBPTMJUM.js} +98 -21
- package/dist/chunks/{chunk-5UMJNVKT.js → chunk-Z5OXOZD3.js} +125 -83
- package/dist/chunks/{chunk-X4WBJIOF.js → chunk-ZH5R7W4A.js} +1 -1
- package/dist/chunks/{live-app-QFHS54SX.js → live-app-FBVWUUMT.js} +7 -7
- package/dist/commands/exec/command.d.ts +2 -0
- package/dist/commands/exec/command.js +15 -41
- package/dist/commands/exec/define-run-command.d.ts +17 -10
- package/dist/commands/exec/define-run-command.js +48 -15
- package/dist/commands/exec/driver-plan.d.ts +24 -16
- package/dist/commands/exec/driver-plan.js +34 -15
- package/dist/commands/exec/driver-refusals.js +7 -6
- package/dist/commands/exec/exec-words.d.ts +1 -1
- package/dist/commands/exec/exec-words.js +8 -2
- package/dist/commands/exec/final-results.d.ts +39 -0
- package/dist/commands/exec/final-results.js +29 -0
- package/dist/commands/exec/metadata.js +1 -1
- package/dist/commands/exec/outcomes.d.ts +13 -3
- package/dist/commands/exec/outcomes.js +21 -4
- package/dist/commands/exec/plan-run.d.ts +11 -3
- package/dist/commands/exec/plan-run.js +3 -2
- package/dist/commands/exec/run-command.d.ts +1 -1
- package/dist/commands/exec/run-command.js +27 -5
- package/dist/commands/exec/test-plan.d.ts +2 -1
- package/dist/commands/exec/test-plan.js +13 -4
- package/dist/commands/exec/tests-summary.d.ts +2 -2
- package/dist/commands/exec/worker-chart.d.ts +1 -1
- package/dist/commands/playwright/command.d.ts +10 -7
- package/dist/commands/playwright/command.js +14 -14
- package/dist/commands/playwright/metadata.js +2 -2
- package/dist/commands/runs/list/command.js +6 -6
- package/dist/commands/runs/logs/command.js +6 -6
- package/dist/commands/runs/show/command.d.ts +2 -2
- package/dist/commands/runs/show/command.js +11 -11
- package/dist/commands/runs/show/outcomes.d.ts +1 -1
- package/dist/commands/snapshots/build/command.js +12 -12
- package/dist/commands/snapshots/list/command.js +9 -9
- package/dist/commands/vitest/command.d.ts +12 -8
- package/dist/commands/vitest/command.js +14 -14
- package/dist/commands/vitest/metadata.js +2 -2
- package/dist/config/resolve.d.ts +1 -1
- package/dist/config/resolve.js +2 -1
- package/dist/config/schema.d.ts +8 -0
- package/dist/config/schema.js +5 -4
- package/dist/extensions/playwright/driver.js +17 -10
- package/dist/extensions/testserver/commands/pool/create/command.js +4 -4
- package/dist/extensions/testserver/commands/pool/list/command.js +2 -2
- package/dist/extensions/testserver/definition.d.ts +1 -1
- package/dist/extensions/testserver/extension.d.ts +1 -1
- package/dist/extensions/testserver/options/rules.d.ts +3 -3
- package/dist/extensions/testserver/options/rules.js +5 -5
- package/dist/extensions/testserver/resource.d.ts +1 -1
- package/dist/extensions/testserver/vercel-cli/arguments.d.ts +10 -4
- package/dist/extensions/testserver/vercel-cli/arguments.js +17 -6
- package/dist/extensions/testserver/vercel-cli/environment.d.ts +12 -1
- package/dist/extensions/testserver/vercel-cli/environment.js +35 -5
- package/dist/extensions/testserver/vercel-cli/index.d.ts +1 -0
- package/dist/extensions/testserver/vercel-cli/index.js +1 -0
- package/dist/extensions/testserver/vercel-cli/invoker.d.ts +28 -13
- package/dist/extensions/testserver/vercel-cli/invoker.js +81 -67
- package/dist/extensions/testserver/vercel-cli/live/process-gateway.js +4 -10
- package/dist/extensions/testserver/vercel-cli/report.js +5 -2
- package/dist/extensions/testserver/vercel-cli/session-id.d.ts +8 -0
- package/dist/extensions/testserver/vercel-cli/session-id.js +17 -0
- package/dist/extensions/testserver/vitest/config.d.ts +2 -2
- package/dist/extensions/testserver/vitest/config.js +2 -2
- package/dist/extensions/testserver/vitest/container-scope.d.ts +25 -16
- package/dist/extensions/testserver/vitest/container-scope.js +32 -13
- package/dist/extensions/testserver/vitest/diagnostics.d.ts +14 -12
- package/dist/extensions/testserver/vitest/diagnostics.js +29 -21
- package/dist/extensions/testserver/vitest/fixtures.d.ts +14 -1
- package/dist/extensions/testserver/vitest/fixtures.js +41 -12
- package/dist/extensions/testserver/vitest/types.d.ts +16 -0
- package/dist/extensions/vitest/driver.js +28 -14
- package/dist/extensions/vitest/plan/gateways.d.ts +28 -5
- package/dist/extensions/vitest/plan/gateways.js +2 -2
- package/dist/extensions/vitest/plan/list-output.d.ts +5 -0
- package/dist/extensions/vitest/plan/list-output.js +23 -9
- package/dist/extensions/vitest/plan/live/list-gateway.d.ts +3 -2
- package/dist/extensions/vitest/plan/live/list-gateway.js +77 -64
- package/dist/extensions/vitest/plan/plan-over.d.ts +19 -7
- package/dist/extensions/vitest/plan/plan-over.js +18 -7
- package/dist/extensions/vitest/plan/plan.d.ts +14 -5
- package/dist/extensions/vitest/plan/plan.js +23 -9
- package/dist/extensions.d.ts +2 -2
- package/dist/run-directory/plan.d.ts +3 -2
- package/dist/run-directory/plan.js +6 -3
- package/dist/run-directory/run-record.d.ts +4 -3
- package/dist/runner/recipe.d.ts +5 -1
- package/dist/runner/sandboxed-command.d.ts +5 -3
- package/dist/runner/sandboxed-command.js +10 -4
- package/dist/sdk/extension/driver.d.ts +32 -6
- package/dist/sdk/extension/driver.js +12 -2
- package/dist/sdk/extension/index.d.ts +1 -1
- package/dist/sdk/extension/index.js +2 -1
- package/dist/sdk/extension/resource-definition.d.ts +6 -5
- package/dist/vendor/testserver-sdk/container/api-request.d.ts +2 -3
- package/dist/vendor/testserver-sdk/container/api-request.js +2 -3
- package/dist/vendor/testserver-sdk/container/container.d.ts +12 -2
- package/dist/vendor/testserver-sdk/container/container.js +10 -7
- package/dist/vendor/testserver-sdk/container/recorder.d.ts +29 -7
- package/dist/vendor/testserver-sdk/container/recorder.js +26 -14
- package/dist/vendor/testserver-sdk/index.d.ts +1 -1
- package/dist/vendor/testserver-sdk/index.js +1 -1
- package/dist/vendor/testserver-sdk/proxy/exchange.d.ts +24 -5
- package/dist/vendor/testserver-sdk/proxy/exchange.js +43 -25
- package/dist/vendor/testserver-sdk/proxy/faulted-exchange.js +15 -10
- package/dist/vendor/testserver-sdk/proxy/faults.d.ts +6 -5
- package/dist/vendor/testserver-sdk/proxy/proxy.d.ts +10 -1
- package/dist/vendor/testserver-sdk/proxy/proxy.js +5 -3
- package/dist/vendor/testserver-sdk/proxy/records.d.ts +17 -17
- package/dist/vendor/testserver-sdk/proxy/records.js +18 -17
- package/dist/vendor/testserver-sdk/records/body.d.ts +7 -9
- package/dist/vendor/testserver-sdk/records/body.js +10 -15
- package/dist/vendor/testserver-sdk/records/headers.d.ts +79 -0
- package/dist/vendor/testserver-sdk/records/headers.js +162 -0
- package/dist/vendor/testserver-sdk/records/index.d.ts +2 -1
- package/dist/vendor/testserver-sdk/records/index.js +4 -2
- package/dist/vendor/testserver-sdk/records/records.d.ts +19 -10
- package/package.json +5 -4
- package/skills/overview.md +5 -5
- package/skills/testserver-builds.md +0 -82
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runHelp
|
|
3
|
-
} from "../../chunks/chunk-
|
|
3
|
+
} from "../../chunks/chunk-HOKDKP5A.js";
|
|
4
4
|
import {
|
|
5
|
+
EXEC_HELP,
|
|
6
|
+
EXEC_HINTS,
|
|
5
7
|
RUN_CLI_OPTIONS,
|
|
6
8
|
RUN_REQUEST_FIELDS,
|
|
7
9
|
outcomes,
|
|
8
10
|
runCommand,
|
|
9
11
|
runProblems
|
|
10
|
-
} from "../../chunks/chunk-
|
|
12
|
+
} from "../../chunks/chunk-YBPTMJUM.js";
|
|
11
13
|
import "../../chunks/chunk-I5GZLOLQ.js";
|
|
12
|
-
import "../../chunks/chunk-
|
|
13
|
-
import "../../chunks/chunk-
|
|
14
|
-
import "../../chunks/chunk-
|
|
15
|
-
import "../../chunks/chunk-
|
|
16
|
-
import "../../chunks/chunk-
|
|
17
|
-
import "../../chunks/chunk-
|
|
14
|
+
import "../../chunks/chunk-27P2QSIM.js";
|
|
15
|
+
import "../../chunks/chunk-BFLYGMG3.js";
|
|
16
|
+
import "../../chunks/chunk-XPCUINWS.js";
|
|
17
|
+
import "../../chunks/chunk-Z5OXOZD3.js";
|
|
18
|
+
import "../../chunks/chunk-UC6DULWY.js";
|
|
19
|
+
import "../../chunks/chunk-BRUIATTR.js";
|
|
18
20
|
import "../../chunks/chunk-NMVODY3P.js";
|
|
19
|
-
import "../../chunks/chunk-
|
|
20
|
-
import "../../chunks/chunk-
|
|
21
|
-
import "../../chunks/chunk-
|
|
22
|
-
import "../../chunks/chunk-
|
|
21
|
+
import "../../chunks/chunk-RKONDLPS.js";
|
|
22
|
+
import "../../chunks/chunk-QBR5VHJ7.js";
|
|
23
|
+
import "../../chunks/chunk-5TMHYH7G.js";
|
|
24
|
+
import "../../chunks/chunk-5ED3IDUJ.js";
|
|
23
25
|
import {
|
|
24
26
|
NOT_COUNTED
|
|
25
|
-
} from "../../chunks/chunk-
|
|
27
|
+
} from "../../chunks/chunk-RA4L2ACU.js";
|
|
26
28
|
import "../../chunks/chunk-BW2ADH7U.js";
|
|
27
29
|
import "../../chunks/chunk-GQIL3AHY.js";
|
|
28
30
|
import "../../chunks/chunk-GSC6SRTW.js";
|
|
@@ -33,34 +35,6 @@ import "../../chunks/chunk-YM6TZV4L.js";
|
|
|
33
35
|
|
|
34
36
|
// src/commands/exec/command.ts
|
|
35
37
|
import { z } from "zod";
|
|
36
|
-
|
|
37
|
-
// src/commands/exec/exec-words.ts
|
|
38
|
-
var EXEC_HELP = {
|
|
39
|
-
usage: "-- <command...>",
|
|
40
|
-
args: "The command to run, after --, as an argument list with no shell. Unsandboxed, it gets this machine's working directory and environment, less the launcher variables its resources hide, plus STORM_RUN and FORCE_COLOR or NO_COLOR; in a sandboxed run, the runner recipe's cwd, its env, the runner's PATH and STORM_RUN, with paths under the repository's root rewritten.",
|
|
41
|
-
verbose: "which asks the command to print what each test does as it happens, for passing tests too",
|
|
42
|
-
examples: [
|
|
43
|
-
{
|
|
44
|
-
argv: "-- pnpm test",
|
|
45
|
-
description: "Run the package's test script in a runner sandbox, with the runner recipe, team, project and resources from storm.config.ts."
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
argv: "--keep-sandbox 2h -- pnpm test",
|
|
49
|
-
description: "Run the tests in a runner sandbox and keep it running 2 hours after the run, to debug in it."
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
argv: "--unsandboxed -- node scripts/smoke.mjs",
|
|
53
|
-
description: "Run a Node.js script on this machine, with the resources storm.config.ts declares, if any."
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
};
|
|
57
|
-
var EXEC_HINTS = {
|
|
58
|
-
// The command's test runner reported no final result. Which one it is the launcher can't tell, so the hint names
|
|
59
|
-
// storm's reporter for each: the Vitest one and the Playwright one, by their published paths.
|
|
60
|
-
noFinalResults: "add storm's reporter to the test runner's config (stormReporter() from @vercel/storm/vitest/config for Vitest, @vercel/storm/playwright/reporter for Playwright)"
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
// src/commands/exec/command.ts
|
|
64
38
|
var command_default = stormCommands.define({
|
|
65
39
|
requestSchema: z.object({
|
|
66
40
|
...RUN_REQUEST_FIELDS,
|
|
@@ -5,11 +5,15 @@ import type { Driver } from "../../sdk/extension/index.ts";
|
|
|
5
5
|
* driver's arguments, and runs the driver's command in a run (`runCommand`).
|
|
6
6
|
*
|
|
7
7
|
* It takes any arguments (`args`), which go to the driver's program unchanged, in order, those after `--` among
|
|
8
|
-
* them, which Clinkr reads into the same field
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* them, which Clinkr reads into the same field, and `--count-tests` (`countTests`) for a driver that counts only the
|
|
9
|
+
* test files unless asked (`Driver.countTests`), with the driver's help for it. Its part of planning the run finds the
|
|
10
|
+
* program and, when the config file sets `testPlan` or the run takes `--count-tests`, counts its tests, or their files,
|
|
11
|
+
* before anything is minted, acquired or started (`planDriverCommand`). The count is the run's test plan, which sizes
|
|
12
|
+
* any resource option whose default is a function of it, and which its `ran` carries as `plan`; a run that counts
|
|
13
|
+
* nothing has no plan, as `storm exec`'s has none. Beside every run's
|
|
11
14
|
* errors it ends with the driver's two refusals, `no_matching_tests` and `driver_plan_failed`, in the driver's words
|
|
12
|
-
* (`driverRefusals`).
|
|
15
|
+
* (`driverRefusals`). Its `ran` warns `no_final_test_results` when its program exited 0 and saved no final test
|
|
16
|
+
* result, with the driver's steps that add storm's reporter as its next steps (`ranRenderer`).
|
|
13
17
|
*/
|
|
14
18
|
export declare function defineRunCommand(driver: Driver): import("@vercel/clinkr").CommandDefinition<z.ZodObject<{
|
|
15
19
|
scope: z.ZodOptional<z.ZodString>;
|
|
@@ -23,6 +27,7 @@ export declare function defineRunCommand(driver: Driver): import("@vercel/clinkr
|
|
|
23
27
|
keepSandbox: z.ZodOptional<z.ZodString>;
|
|
24
28
|
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
25
29
|
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
30
|
+
countTests?: z.ZodDefault<z.ZodBoolean>;
|
|
26
31
|
}, z.core.$strip>, import("@vercel/clinkr").Outcomes<{
|
|
27
32
|
ran: z.ZodObject<{
|
|
28
33
|
version: z.ZodString;
|
|
@@ -88,8 +93,9 @@ export declare function defineRunCommand(driver: Driver): import("@vercel/clinkr
|
|
|
88
93
|
}, z.core.$strip>>;
|
|
89
94
|
}, z.core.$strip>;
|
|
90
95
|
runId: z.ZodNullable<z.ZodString>;
|
|
91
|
-
|
|
92
|
-
|
|
96
|
+
noFinalTestResults: z.ZodBoolean;
|
|
97
|
+
plan: z.ZodExactOptional<z.ZodObject<{
|
|
98
|
+
tests: z.ZodOptional<z.ZodNumber>;
|
|
93
99
|
files: z.ZodNumber;
|
|
94
100
|
options: z.ZodArray<z.ZodObject<{
|
|
95
101
|
path: z.ZodString;
|
|
@@ -100,7 +106,7 @@ export declare function defineRunCommand(driver: Driver): import("@vercel/clinkr
|
|
|
100
106
|
flag: "flag";
|
|
101
107
|
}>;
|
|
102
108
|
}, z.core.$strip>>;
|
|
103
|
-
}, z.core.$strip
|
|
109
|
+
}, z.core.$strip>>;
|
|
104
110
|
}, z.core.$strip>;
|
|
105
111
|
}, {
|
|
106
112
|
ran: unknown;
|
|
@@ -407,8 +413,9 @@ export declare function defineRunCommand(driver: Driver): import("@vercel/clinkr
|
|
|
407
413
|
}, z.core.$strip>>;
|
|
408
414
|
}, z.core.$strip>;
|
|
409
415
|
runId: z.ZodNullable<z.ZodString>;
|
|
410
|
-
|
|
411
|
-
|
|
416
|
+
noFinalTestResults: z.ZodBoolean;
|
|
417
|
+
plan: z.ZodExactOptional<z.ZodObject<{
|
|
418
|
+
tests: z.ZodOptional<z.ZodNumber>;
|
|
412
419
|
files: z.ZodNumber;
|
|
413
420
|
options: z.ZodArray<z.ZodObject<{
|
|
414
421
|
path: z.ZodString;
|
|
@@ -419,7 +426,7 @@ export declare function defineRunCommand(driver: Driver): import("@vercel/clinkr
|
|
|
419
426
|
flag: "flag";
|
|
420
427
|
}>;
|
|
421
428
|
}, z.core.$strip>>;
|
|
422
|
-
}, z.core.$strip
|
|
429
|
+
}, z.core.$strip>>;
|
|
423
430
|
}, z.core.$strip>;
|
|
424
431
|
}, {
|
|
425
432
|
ran: unknown;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// A driver's run command: `defineRunCommand` makes the command that starts a run from a driver (`GLOSSARY.md`,
|
|
2
2
|
// **Driver**), the one an extension brings, which the registry gives by name (`driverNamed`, `src/extensions.ts`), so
|
|
3
3
|
// `storm vitest` and `storm playwright` are one implementation and differ only in their driver. The driver gives the
|
|
4
|
-
// command's word, its part of the leaf help, how to find its program, count its tests
|
|
5
|
-
// run's summary says to do next (its hints); everything else is the run every run command shares (`runCommand`,
|
|
4
|
+
// command's word, its part of the leaf help, how to find its program, count its tests when the run counts, and start
|
|
5
|
+
// it, and what its run's summary says to do next (its hints); everything else is the run every run command shares (`runCommand`,
|
|
6
6
|
// `run-command.ts`), which `storm exec` is made from directly too (`command.ts`).
|
|
7
7
|
import { defineOutcomes } from "@vercel/clinkr";
|
|
8
8
|
import { z } from "zod";
|
|
@@ -10,19 +10,24 @@ import { stormCommands } from "../../command-tree.js";
|
|
|
10
10
|
import { planSchema } from "../../run-directory/index.js";
|
|
11
11
|
import { planDriverCommand } from "./driver-plan.js";
|
|
12
12
|
import { driverRefusals } from "./driver-refusals.js";
|
|
13
|
-
import { RAN_DESCRIPTION, RUN_ERRORS,
|
|
13
|
+
import { RAN_DESCRIPTION, RUN_ERRORS, ranRenderer, ranSchema } from "./outcomes.js";
|
|
14
14
|
import { RUN_CLI_OPTIONS, RUN_REQUEST_FIELDS, runCommand, runProblems } from "./run-command.js";
|
|
15
15
|
import { runHelp } from "./run-metadata.js";
|
|
16
|
+
import { recordedPlan } from "./test-plan.js";
|
|
16
17
|
/**
|
|
17
18
|
* The run command of `driver`, which its `command.ts` default-exports. It takes the flags every run takes, then the
|
|
18
19
|
* driver's arguments, and runs the driver's command in a run (`runCommand`).
|
|
19
20
|
*
|
|
20
21
|
* It takes any arguments (`args`), which go to the driver's program unchanged, in order, those after `--` among
|
|
21
|
-
* them, which Clinkr reads into the same field
|
|
22
|
-
*
|
|
23
|
-
*
|
|
22
|
+
* them, which Clinkr reads into the same field, and `--count-tests` (`countTests`) for a driver that counts only the
|
|
23
|
+
* test files unless asked (`Driver.countTests`), with the driver's help for it. Its part of planning the run finds the
|
|
24
|
+
* program and, when the config file sets `testPlan` or the run takes `--count-tests`, counts its tests, or their files,
|
|
25
|
+
* before anything is minted, acquired or started (`planDriverCommand`). The count is the run's test plan, which sizes
|
|
26
|
+
* any resource option whose default is a function of it, and which its `ran` carries as `plan`; a run that counts
|
|
27
|
+
* nothing has no plan, as `storm exec`'s has none. Beside every run's
|
|
24
28
|
* errors it ends with the driver's two refusals, `no_matching_tests` and `driver_plan_failed`, in the driver's words
|
|
25
|
-
* (`driverRefusals`).
|
|
29
|
+
* (`driverRefusals`). Its `ran` warns `no_final_test_results` when its program exited 0 and saved no final test
|
|
30
|
+
* result, with the driver's steps that add storm's reporter as its next steps (`ranRenderer`).
|
|
26
31
|
*/
|
|
27
32
|
export function defineRunCommand(driver) {
|
|
28
33
|
const errors = driverRefusals(driver);
|
|
@@ -31,28 +36,56 @@ export function defineRunCommand(driver) {
|
|
|
31
36
|
ran: {
|
|
32
37
|
schema: ranSchema.extend({
|
|
33
38
|
/**
|
|
34
|
-
* The test plan: what the driver's plan step counted before the run, and each resource
|
|
35
|
-
* is a function of it, with its value and where that came from.
|
|
39
|
+
* The test plan of a run that counted: what the driver's plan step counted before the run, and each resource
|
|
40
|
+
* option whose default is a function of it, with its value and where that came from. Absent for a run that
|
|
41
|
+
* counted nothing.
|
|
36
42
|
*/
|
|
37
|
-
plan: planSchema,
|
|
43
|
+
plan: planSchema.exactOptional(),
|
|
38
44
|
}),
|
|
39
45
|
description: RAN_DESCRIPTION,
|
|
40
|
-
render:
|
|
46
|
+
render: ranRenderer(driver.hints),
|
|
41
47
|
},
|
|
42
48
|
},
|
|
43
49
|
errors: { ...RUN_ERRORS, ...errors.errors },
|
|
44
50
|
});
|
|
51
|
+
const help = runHelp(driver.help, "args", { driver: driver.name });
|
|
45
52
|
return stormCommands.define({
|
|
46
|
-
requestSchema: z.object({
|
|
53
|
+
requestSchema: z.object({
|
|
54
|
+
...RUN_REQUEST_FIELDS,
|
|
55
|
+
...countTestsField(driver),
|
|
56
|
+
args: z.array(z.string()).default([]),
|
|
57
|
+
}),
|
|
47
58
|
cli: { options: RUN_CLI_OPTIONS, positionals: ["args"] },
|
|
48
|
-
help:
|
|
59
|
+
help: driver.countTests === undefined
|
|
60
|
+
? help
|
|
61
|
+
: { ...help, fields: { ...help.fields, countTests: { description: driver.countTests.description } } },
|
|
49
62
|
response: counted,
|
|
50
63
|
validate: runProblems,
|
|
51
64
|
handler: async (context, request) => await runCommand(context, request, {
|
|
52
65
|
name: driver.name,
|
|
53
66
|
hints: driver.hints,
|
|
54
|
-
planCommand: async (where, signal) => await planDriverCommand(context.app, driver, errors, request.args, where, signal),
|
|
55
|
-
ran: (facts, { testPlan, options }) =>
|
|
67
|
+
planCommand: async (where, signal, { testPlan }) => await planDriverCommand(context.app, driver, errors, request.args, driverCount(driver, testPlan, request.countTests === true), where, signal),
|
|
68
|
+
ran: (facts, { testPlan, options }) => {
|
|
69
|
+
const plan = recordedPlan(testPlan, options);
|
|
70
|
+
return counted.ran({ ...facts, ...(plan === undefined ? {} : { plan }) });
|
|
71
|
+
},
|
|
56
72
|
}),
|
|
57
73
|
});
|
|
58
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* What `driver`'s run counts: nothing unless the config file sets `testPlan` or the run takes `--count-tests`; then
|
|
77
|
+
* each test with `--count-tests` or for a driver with no `countTests`, which always counts each test, and otherwise only
|
|
78
|
+
* the test files.
|
|
79
|
+
*/
|
|
80
|
+
function driverCount(driver, testPlan, countTests) {
|
|
81
|
+
if (!testPlan && !countTests)
|
|
82
|
+
return undefined;
|
|
83
|
+
return { countTests: driver.countTests === undefined || countTests };
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The request field of `--count-tests` for a driver that counts only the test files unless asked (`Driver.countTests`);
|
|
87
|
+
* none for a driver that always counts each test, so the field is optional in the request's type.
|
|
88
|
+
*/
|
|
89
|
+
function countTestsField(driver) {
|
|
90
|
+
return driver.countTests === undefined ? {} : { countTests: z.boolean().default(false) };
|
|
91
|
+
}
|
|
@@ -1,30 +1,38 @@
|
|
|
1
1
|
import type { StormApp } from "../../context.ts";
|
|
2
|
-
import type
|
|
2
|
+
import { type Driver, type RunTestPlan } from "../../sdk/extension/index.ts";
|
|
3
3
|
import type { DriverRefusals } from "./driver-refusals.ts";
|
|
4
4
|
import { canceledBeforeStart, type PlannedCommand, type PlannedWhere } from "./plan-run.ts";
|
|
5
5
|
import { checkoutFailedRefusal } from "./run-command.ts";
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Whether a run counts before it starts, and what: `undefined` counts nothing; otherwise the plan step counts each
|
|
8
|
+
* test, or only the test files where the driver can (`countTests`).
|
|
9
|
+
*/
|
|
10
|
+
export type DriverCount = {
|
|
11
|
+
readonly countTests: boolean;
|
|
12
|
+
} | undefined;
|
|
10
13
|
/** How a driver's part of planning ends a run before it starts. */
|
|
11
14
|
export type DriverPlanRefusal = ReturnType<typeof canceledBeforeStart> | ReturnType<typeof checkoutFailedRefusal> | ReturnType<DriverRefusals["planFailed"]> | ReturnType<DriverRefusals["noMatchingTests"]>;
|
|
12
15
|
/**
|
|
13
|
-
* `driver`'s part of planning a run, before anything is minted, acquired or started
|
|
16
|
+
* `driver`'s part of planning a run, before anything is minted, acquired or started. `count` says whether the run
|
|
17
|
+
* counts (`DriverCount`):
|
|
14
18
|
*
|
|
15
|
-
* 1.
|
|
19
|
+
* 1. A run with a runner that counts nothing asks nothing of this machine: its command is the driver's argv over the
|
|
20
|
+
* program's bare name, which the runner's `PATH` finds.
|
|
21
|
+
* 2. Finds the driver's program where the run runs (`findRunBin`): the directory on this machine the run is planned
|
|
16
22
|
* in, and its binary in `node_modules/.bin` of that directory or one above it. No binary is `driver_plan_failed`
|
|
17
|
-
* (`start-failed`), naming each directory searched. A repository root git can't say is `runner_failed`.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
23
|
+
* (`start-failed`), naming each directory searched. A repository root git can't say is `runner_failed`. A run with
|
|
24
|
+
* no runner that counts nothing starts the binary found.
|
|
25
|
+
* 3. For a run that counts, asks the driver's plan step, over the driver's own Context (`app.driverContexts`, by the
|
|
26
|
+
* driver's name), what the program would run there, with the binary found and this machine's environment, counting
|
|
27
|
+
* each test or only the test files as `count.countTests` says: `driver_plan_failed` when it fails, with the message
|
|
28
|
+
* the plan step worded, and `no_matching_tests` when it counts no test, or no test file when it counted only the
|
|
29
|
+
* files. `signal` aborting stops it, and the run cancels (`canceledBeforeStart`).
|
|
22
30
|
*
|
|
23
|
-
* What the plan step counted is the run's test plan,
|
|
24
|
-
*
|
|
25
|
-
* the ones its command's outcomes list, which `driver.refusals`, the driver's words, word.
|
|
31
|
+
* What the plan step counted is the run's test plan, `not-counted` for a run that counts nothing, and the command is
|
|
32
|
+
* the driver's argv (`launch`) over the binary the run starts. `errors` are the builders of the driver's two errors
|
|
33
|
+
* (`driverRefusals`), the ones its command's outcomes list, which `driver.refusals`, the driver's words, word.
|
|
26
34
|
*/
|
|
27
|
-
export declare function planDriverCommand(app: Pick<StormApp, "context" | "cwd" | "packageBins" | "driverContexts">, driver: Driver, errors: DriverRefusals, args: readonly string[], where: PlannedWhere, signal: AbortSignal): Promise<PlannedCommand<
|
|
35
|
+
export declare function planDriverCommand(app: Pick<StormApp, "context" | "cwd" | "packageBins" | "driverContexts">, driver: Driver, errors: DriverRefusals, args: readonly string[], count: DriverCount, where: PlannedWhere, signal: AbortSignal): Promise<PlannedCommand<RunTestPlan> | {
|
|
28
36
|
readonly ok: false;
|
|
29
37
|
readonly refusal: DriverPlanRefusal;
|
|
30
38
|
}>;
|
|
@@ -1,36 +1,51 @@
|
|
|
1
1
|
// A program driver's part of planning a run (`PlanCommand`, `plan-run.ts`): finding the program, asking the driver's
|
|
2
|
-
// plan step for the test plan, and the refusals that end the run there. Every driver of a program plans through it, so
|
|
2
|
+
// plan step for the test plan when the run counts, and the refusals that end the run there. Every driver of a program plans through it, so
|
|
3
3
|
// no command holds planning or refusal logic of its own.
|
|
4
4
|
import { refused } from "@vercel/clinkr";
|
|
5
|
+
import { NOT_COUNTED } from "../../sdk/extension/index.js";
|
|
5
6
|
import { canceledBeforeStart } from "./plan-run.js";
|
|
6
7
|
import { findRunBin } from "./run-bin.js";
|
|
7
8
|
import { checkoutFailedRefusal } from "./run-command.js";
|
|
8
9
|
/**
|
|
9
|
-
* `driver`'s part of planning a run, before anything is minted, acquired or started
|
|
10
|
+
* `driver`'s part of planning a run, before anything is minted, acquired or started. `count` says whether the run
|
|
11
|
+
* counts (`DriverCount`):
|
|
10
12
|
*
|
|
11
|
-
* 1.
|
|
13
|
+
* 1. A run with a runner that counts nothing asks nothing of this machine: its command is the driver's argv over the
|
|
14
|
+
* program's bare name, which the runner's `PATH` finds.
|
|
15
|
+
* 2. Finds the driver's program where the run runs (`findRunBin`): the directory on this machine the run is planned
|
|
12
16
|
* in, and its binary in `node_modules/.bin` of that directory or one above it. No binary is `driver_plan_failed`
|
|
13
|
-
* (`start-failed`), naming each directory searched. A repository root git can't say is `runner_failed`.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
17
|
+
* (`start-failed`), naming each directory searched. A repository root git can't say is `runner_failed`. A run with
|
|
18
|
+
* no runner that counts nothing starts the binary found.
|
|
19
|
+
* 3. For a run that counts, asks the driver's plan step, over the driver's own Context (`app.driverContexts`, by the
|
|
20
|
+
* driver's name), what the program would run there, with the binary found and this machine's environment, counting
|
|
21
|
+
* each test or only the test files as `count.countTests` says: `driver_plan_failed` when it fails, with the message
|
|
22
|
+
* the plan step worded, and `no_matching_tests` when it counts no test, or no test file when it counted only the
|
|
23
|
+
* files. `signal` aborting stops it, and the run cancels (`canceledBeforeStart`).
|
|
18
24
|
*
|
|
19
|
-
* What the plan step counted is the run's test plan,
|
|
20
|
-
*
|
|
21
|
-
* the ones its command's outcomes list, which `driver.refusals`, the driver's words, word.
|
|
25
|
+
* What the plan step counted is the run's test plan, `not-counted` for a run that counts nothing, and the command is
|
|
26
|
+
* the driver's argv (`launch`) over the binary the run starts. `errors` are the builders of the driver's two errors
|
|
27
|
+
* (`driverRefusals`), the ones its command's outcomes list, which `driver.refusals`, the driver's words, word.
|
|
22
28
|
*/
|
|
23
|
-
export async function planDriverCommand(app, driver, errors, args, where, signal) {
|
|
29
|
+
export async function planDriverCommand(app, driver, errors, args, count, where, signal) {
|
|
24
30
|
const { bin: name } = driver.program;
|
|
31
|
+
if (count === undefined && where.kind === "runner")
|
|
32
|
+
return { ok: true, argv: driver.launch(name, args), testPlan: NOT_COUNTED.testPlan };
|
|
25
33
|
const bin = await findRunBin(app, name, where);
|
|
26
34
|
if (bin.kind === "checkout-failed")
|
|
27
35
|
return refused(checkoutFailedRefusal(bin.failure));
|
|
28
36
|
const planned = { args, cwd: bin.cwd };
|
|
29
37
|
if (bin.kind === "not-found")
|
|
30
38
|
return refused(errors.planFailed({ kind: "start-failed", message: `found no ${name} in node_modules/.bin of ${bin.searched.join(", ")}` }, planned));
|
|
39
|
+
if (count === undefined)
|
|
40
|
+
return { ok: true, argv: driver.launch(bin.runs, args), testPlan: NOT_COUNTED.testPlan };
|
|
31
41
|
// Each Context goes only to the plan step of the driver that built it, which `defineDriver`'s cast rests on.
|
|
32
42
|
const contexts = app.driverContexts;
|
|
33
|
-
const answer = await driver.plan(contexts[driver.name])({
|
|
43
|
+
const answer = await driver.plan(contexts[driver.name])({
|
|
44
|
+
...planned,
|
|
45
|
+
bin: bin.counts,
|
|
46
|
+
countTests: count.countTests,
|
|
47
|
+
signal,
|
|
48
|
+
});
|
|
34
49
|
if (!answer.ok) {
|
|
35
50
|
const { kind, message } = answer;
|
|
36
51
|
if (kind === "canceled")
|
|
@@ -38,7 +53,11 @@ export async function planDriverCommand(app, driver, errors, args, where, signal
|
|
|
38
53
|
return refused(errors.planFailed({ kind, message }, planned));
|
|
39
54
|
}
|
|
40
55
|
const { tests, files } = answer.plan;
|
|
41
|
-
if (tests === 0)
|
|
56
|
+
if ((tests ?? files) === 0)
|
|
42
57
|
return refused(errors.noMatchingTests(planned));
|
|
43
|
-
return {
|
|
58
|
+
return {
|
|
59
|
+
ok: true,
|
|
60
|
+
argv: driver.launch(bin.runs, args),
|
|
61
|
+
testPlan: { kind: "counted", ...(tests === undefined ? {} : { tests }), files },
|
|
62
|
+
};
|
|
44
63
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
// How a run ends when its driver's
|
|
2
|
-
// program shares, as every resource's refusals share `resource_refused` (`resource-refusals.ts`).
|
|
3
|
-
// is a plan step that counted no test,
|
|
4
|
-
//
|
|
1
|
+
// How a run ends when its driver's part of planning gives it no command: two errors of storm's own, which every driver
|
|
2
|
+
// of a program shares, as every resource's refusals share `resource_refused` (`resource-refusals.ts`).
|
|
3
|
+
// `no_matching_tests` is a plan step that counted no test, for a run that counts, and
|
|
4
|
+
// `driver_plan_failed` a program the launcher didn't find or a plan step that failed. Each carries the driver's name
|
|
5
|
+
// (`driver`) beside the arguments and the directory the run was planned in,
|
|
5
6
|
// and `driver_plan_failed` how the plan step failed (`kind`) and what went wrong (`message`), which holds the timeout,
|
|
6
7
|
// the exit code or the signal: no field of its own carries them. The driver words both: each error's description and
|
|
7
8
|
// the next step (`DriverRefusalWords`, `src/sdk/extension/driver.ts`), and what went wrong, which its plan step answers
|
|
@@ -16,7 +17,7 @@ const plannedShape = {
|
|
|
16
17
|
driver: z.string().min(1),
|
|
17
18
|
/** The arguments given to the driver's program, which its plan step was given too. */
|
|
18
19
|
args: z.array(z.string()),
|
|
19
|
-
/** The directory the
|
|
20
|
+
/** The directory the run was planned in, on this machine: where its program was looked for and its tests counted. */
|
|
20
21
|
cwd: z.string(),
|
|
21
22
|
};
|
|
22
23
|
/**
|
|
@@ -47,7 +48,7 @@ export function driverRefusals({ name, refusals }) {
|
|
|
47
48
|
cwd: plannedShape.cwd,
|
|
48
49
|
}),
|
|
49
50
|
render: ({ kind, message, cwd }) => ({
|
|
50
|
-
message: `Couldn't
|
|
51
|
+
message: `Couldn't plan the run in ${cwd}: ${/[.!?]$/.test(message) ? message : `${message}.`} The command didn't run.`,
|
|
51
52
|
next: [{ type: "text", text: refusals.planFailed.next[kind] }],
|
|
52
53
|
}),
|
|
53
54
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DriverHelp, DriverHints } from "../../sdk/extension/index.ts";
|
|
2
2
|
/** `exec`'s part of its leaf help: its usage after the run flags, its arguments, `--verbose`'s ending and its examples. */
|
|
3
3
|
export declare const EXEC_HELP: DriverHelp;
|
|
4
|
-
/** What an `exec` run
|
|
4
|
+
/** What an `exec` run says to do next. */
|
|
5
5
|
export declare const EXEC_HINTS: DriverHints;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/** `exec`'s part of its leaf help: its usage after the run flags, its arguments, `--verbose`'s ending and its examples. */
|
|
7
7
|
export const EXEC_HELP = {
|
|
8
8
|
usage: "-- <command...>",
|
|
9
|
-
args: "The command to run, after --, as an argument list with no shell. Unsandboxed, it gets this machine's working directory and environment, less the launcher variables its resources hide, plus STORM_RUN and FORCE_COLOR or NO_COLOR; in a sandboxed run, the runner recipe's cwd, its env, the runner's PATH and
|
|
9
|
+
args: "The command to run, after --, as an argument list with no shell. Unsandboxed, it gets this machine's working directory and environment, less the launcher variables its resources hide, plus STORM_RUN, and FORCE_COLOR or NO_COLOR when neither is set; in a sandboxed run, the runner recipe's cwd, its env, the runner's PATH, STORM_RUN, and FORCE_COLOR or NO_COLOR when that env sets neither, with paths under the repository's root rewritten.",
|
|
10
10
|
verbose: "which asks the command to print what each test does as it happens, for passing tests too",
|
|
11
11
|
examples: [
|
|
12
12
|
{
|
|
@@ -23,9 +23,15 @@ export const EXEC_HELP = {
|
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
25
|
};
|
|
26
|
-
/** What an `exec` run
|
|
26
|
+
/** What an `exec` run says to do next. */
|
|
27
27
|
export const EXEC_HINTS = {
|
|
28
28
|
// The command's test runner reported no final result. Which one it is the launcher can't tell, so the hint names
|
|
29
29
|
// storm's reporter for each: the Vitest one and the Playwright one, by their published paths.
|
|
30
30
|
noFinalResults: "add storm's reporter to the test runner's config (stormReporter() from @vercel/storm/vitest/config for Vitest, @vercel/storm/playwright/reporter for Playwright)",
|
|
31
|
+
// The command may run no test at all, so the steps say they apply if it does, and name storm's reporter for each test
|
|
32
|
+
// runner, under either npm name.
|
|
33
|
+
addReporter: [
|
|
34
|
+
'If the command runs tests, add storm\'s reporter to its test runner\'s config: for Vitest, set test.reporters to stormReporters() from "@vercel/storm/vitest/config"; for Playwright, add ["@vercel/storm/playwright/reporter"] to the reporter list. In a package that installs storm as @cnc-tools/storm, use "@cnc-tools/storm/vitest/config" or "@cnc-tools/storm/playwright/reporter".',
|
|
35
|
+
"Remove any --reporter from the test runner's arguments, since it replaces the config's reporters, storm's among them. Then run the same storm exec command again.",
|
|
36
|
+
],
|
|
31
37
|
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { DriverHints } from "../../sdk/extension/index.ts";
|
|
2
|
+
/** What the run's tests said, as the run ended, which decides whether its `ran` result warns `no_final_test_results`. */
|
|
3
|
+
export interface FinalResultsRead {
|
|
4
|
+
/** How many final test results (`test-result` events) the run's test events hold. */
|
|
5
|
+
readonly finalResults: number;
|
|
6
|
+
/**
|
|
7
|
+
* Whether the final read of the test events failed or skipped lines it couldn't read: then storm can't say the
|
|
8
|
+
* command reported none.
|
|
9
|
+
*/
|
|
10
|
+
readonly partial: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the run handed its command a place to report its tests: a runner sandbox's test events file, which the
|
|
13
|
+
* runner follows, or, with no runner, the run directory's. A run with no runner whose run directory couldn't open
|
|
14
|
+
* hands it none, so even a reporter in the config reports nothing, and storm can't say the command reported none.
|
|
15
|
+
*/
|
|
16
|
+
readonly collected: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Whether a run whose command ended with `exitCode` and whose tests said `read` saved no final test result: its
|
|
20
|
+
* command exited 0, storm handed it a test events file, and storm read every line of its test events and found no
|
|
21
|
+
* final result in them.
|
|
22
|
+
*/
|
|
23
|
+
export declare function lacksFinalResults(exitCode: number | null, read: FinalResultsRead): boolean;
|
|
24
|
+
/** The `no_final_test_results` warning's message, the launcher's, which names no test runner. */
|
|
25
|
+
export declare const NO_FINAL_RESULTS_MESSAGE = "The command exited 0, but storm got no final test result from it, so the run saved no test results. A test runner reports them only with storm's reporter in its config, and a --reporter on its command line replaces the config's reporters.";
|
|
26
|
+
/**
|
|
27
|
+
* What a `ran` result with `noFinalTestResults` adds: the `no_final_test_results` warning, and `hints.addReporter` as
|
|
28
|
+
* its next steps. Nothing for any other run.
|
|
29
|
+
*/
|
|
30
|
+
export declare function noFinalResultsContent(noFinalTestResults: boolean, hints: Pick<DriverHints, "addReporter">): {
|
|
31
|
+
readonly warnings: readonly {
|
|
32
|
+
readonly reason: string;
|
|
33
|
+
readonly message: string;
|
|
34
|
+
}[];
|
|
35
|
+
readonly next: readonly {
|
|
36
|
+
readonly type: "text";
|
|
37
|
+
readonly text: string;
|
|
38
|
+
}[];
|
|
39
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// The `no_final_test_results` warning of a run whose command exited 0 but saved no final test result. Such a run looks
|
|
2
|
+
// passed while it saved nothing, which is a setup that looks correct and isn't: the test runner's config doesn't list
|
|
3
|
+
// storm's reporter, or a `--reporter` on its command line replaced it. So its `ran` result says so
|
|
4
|
+
// (`noFinalTestResults`), warns, and lists the steps that add storm's reporter as its next steps: the run's driver's
|
|
5
|
+
// (`DriverHints.addReporter`), which name the config file and the exact code, so an agent can follow them as written,
|
|
6
|
+
// or `storm exec`'s, which name storm's reporter for each test runner and say they apply if the command runs tests. The
|
|
7
|
+
// warning changes no exit code: storm exits with the command's. Its message is the launcher's and names no test runner.
|
|
8
|
+
/**
|
|
9
|
+
* Whether a run whose command ended with `exitCode` and whose tests said `read` saved no final test result: its
|
|
10
|
+
* command exited 0, storm handed it a test events file, and storm read every line of its test events and found no
|
|
11
|
+
* final result in them.
|
|
12
|
+
*/
|
|
13
|
+
export function lacksFinalResults(exitCode, read) {
|
|
14
|
+
return exitCode === 0 && read.collected && read.finalResults === 0 && !read.partial;
|
|
15
|
+
}
|
|
16
|
+
/** The `no_final_test_results` warning's message, the launcher's, which names no test runner. */
|
|
17
|
+
export const NO_FINAL_RESULTS_MESSAGE = "The command exited 0, but storm got no final test result from it, so the run saved no test results. A test runner reports them only with storm's reporter in its config, and a --reporter on its command line replaces the config's reporters.";
|
|
18
|
+
/**
|
|
19
|
+
* What a `ran` result with `noFinalTestResults` adds: the `no_final_test_results` warning, and `hints.addReporter` as
|
|
20
|
+
* its next steps. Nothing for any other run.
|
|
21
|
+
*/
|
|
22
|
+
export function noFinalResultsContent(noFinalTestResults, hints) {
|
|
23
|
+
if (!noFinalTestResults)
|
|
24
|
+
return { warnings: [], next: [] };
|
|
25
|
+
return {
|
|
26
|
+
warnings: [{ reason: "no_final_test_results", message: NO_FINAL_RESULTS_MESSAGE }],
|
|
27
|
+
next: hints.addReporter.map((text) => ({ type: "text", text })),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/commands/exec/metadata.ts
|
|
2
2
|
var metadata = {
|
|
3
|
-
description: "Run any command, the argument list after --, as it is, with the run payload in STORM_RUN. For vitest, use storm vitest, which
|
|
3
|
+
description: "Run any command, the argument list after --, as it is, with the run payload in STORM_RUN. For vitest, use storm vitest, which finds vitest and can count the tests and size the run first (testPlan in storm.config.ts); exec counts nothing and sizes nothing. In an unsandboxed run (--unsandboxed), the command runs on this machine in the working directory, with this machine's environment less the launcher environment variables the run's resources hide, plus STORM_RUN, and FORCE_COLOR or NO_COLOR when neither is set. In a sandboxed run, the default, it runs in a runner sandbox, a Vercel Sandbox readied from the runner recipe in storm.config.ts, in the recipe's cwd, with the runner sandbox's own environment, a PATH that starts with node_modules/.bin of that cwd and of the repository's root, the recipe's env, FORCE_COLOR or NO_COLOR only when that env sets neither (an env that sets FORCE_COLOR gets no NO_COLOR), and STORM_RUN, and nothing from this machine's environment; each recipe step that names a runner secret, never the command, also gets that launcher environment variable, one its secrets key declares, shown as <token> in what storm prints and writes, and a sandboxed run refuses before it starts when one of them is unset, holds a line break or is shorter than 8 characters; each path under the repository's root in its arguments points at the runner sandbox's copy, and each in its output back at this checkout. The run has each resource that storm.config.ts declares under resources or that one of the resource's own flags names, unless the resource skips itself: it first acquires each one, while a sandboxed run readies its runner sandbox, hands it to the command under the run payload's resources, and releases it once the command has stopped; without one, the run payload names no resource. Each resource's flags and examples are below, and its own commands are under storm ext. Shows on stderr what runs when and what runs at once, live on a terminal and one line at a time elsewhere, then a waterfall of the run's lanes naming its critical path, and exits with the command's code. A run whose command exits 0 but saves no final test result warns no_final_test_results, whose next steps say how to add storm's reporter if the command runs tests. Each run writes what it was and how it ended, its events, its steps' output, its command's output, its test events and its timeline to a run directory under ${XDG_STATE_HOME:-~/.local/state}/storm/runs/, named for its run id, keeping the newest 1000 completed ones and every one whose run is still going; the summary names the run id, storm runs show reads the run back, and storm runs logs prints its command's output and its steps' logs. A flag overrides storm.config.ts, found in the working directory or a parent up to the git worktree's root and checked whole, which overrides the built-in default. A secret a resource hands its command, such as a test-data token, shows as <token> in what the run prints and writes.",
|
|
4
4
|
summary: "Run any command, in a runner sandbox or unsandboxed."
|
|
5
5
|
};
|
|
6
6
|
export {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import type { DriverHints } from "../../sdk/extension/index.ts";
|
|
2
3
|
/** What a `ran` outcome says of a run whose command ran and ended. No field carries the credential. */
|
|
3
4
|
export declare const ranSchema: z.ZodObject<{
|
|
4
5
|
version: z.ZodString;
|
|
@@ -64,13 +65,21 @@ export declare const ranSchema: z.ZodObject<{
|
|
|
64
65
|
}, z.core.$strip>>;
|
|
65
66
|
}, z.core.$strip>;
|
|
66
67
|
runId: z.ZodNullable<z.ZodString>;
|
|
68
|
+
noFinalTestResults: z.ZodBoolean;
|
|
67
69
|
}, z.core.$strip>;
|
|
68
70
|
/** What a `ran` outcome is, for its description. */
|
|
69
|
-
export declare const RAN_DESCRIPTION = "The command ran and ended. storm exits with its code, or 128 + n when signal n ended it, whatever this result's exit code.";
|
|
70
|
-
/**
|
|
71
|
-
|
|
71
|
+
export declare const RAN_DESCRIPTION = "The command ran and ended. storm exits with its code, or 128 + n when signal n ended it, whatever this result's exit code. A run whose command exited 0 but saved no final test result warns no_final_test_results.";
|
|
72
|
+
/**
|
|
73
|
+
* How a `ran` outcome renders: its warnings, and the runner sandbox the run kept running, if any; with
|
|
74
|
+
* `noFinalTestResults`, the `no_final_test_results` warning and `hints.addReporter` as its next steps.
|
|
75
|
+
*/
|
|
76
|
+
export declare function ranRenderer(hints: Pick<DriverHints, "addReporter">): (ran: z.output<typeof ranSchema>) => import("@vercel/clinkr").Rendered<{
|
|
72
77
|
message?: string;
|
|
73
78
|
warnings?: import("../../sdk/extension/reports.ts").Warning<string>[];
|
|
79
|
+
next?: {
|
|
80
|
+
readonly type: "text";
|
|
81
|
+
readonly text: string;
|
|
82
|
+
}[];
|
|
74
83
|
}>;
|
|
75
84
|
/** The errors only a run ends with, beside the config's, the credential's, the resources' and the mint's. */
|
|
76
85
|
export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
|
|
@@ -540,6 +549,7 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
540
549
|
}, z.core.$strip>>;
|
|
541
550
|
}, z.core.$strip>;
|
|
542
551
|
runId: z.ZodNullable<z.ZodString>;
|
|
552
|
+
noFinalTestResults: z.ZodBoolean;
|
|
543
553
|
}, z.core.$strip>;
|
|
544
554
|
}, {
|
|
545
555
|
ran: unknown;
|