@cnc-tools/storm 0.12.0 → 0.14.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.
- package/dist/application.js +5 -1
- package/dist/bin/storm.js +6 -2
- package/dist/build-info.js +1 -1
- package/dist/chunks/{chunk-FK4RLDEK.js → chunk-27P2QSIM.js} +1 -1
- package/dist/chunks/{chunk-ODQHQJLE.js → chunk-5ED3IDUJ.js} +749 -1121
- package/dist/chunks/{chunk-FSP3SJ35.js → chunk-5TMHYH7G.js} +16 -46
- package/dist/chunks/{chunk-Y3BUNNRG.js → chunk-BFLYGMG3.js} +12 -7
- package/dist/chunks/{chunk-LQKNI3EG.js → chunk-BRUIATTR.js} +6 -6
- package/dist/chunks/{chunk-RYRJNHL7.js → chunk-HOKDKP5A.js} +3 -9
- package/dist/chunks/{chunk-SXW6XN4R.js → chunk-IVRRGGCD.js} +60 -20
- package/dist/chunks/{chunk-TMQQYHUX.js → chunk-QBR5VHJ7.js} +1 -1
- package/dist/chunks/{chunk-YT5OROR7.js → chunk-RA4L2ACU.js} +12 -2
- package/dist/chunks/{chunk-TEEZL3GA.js → chunk-RKONDLPS.js} +17 -71
- package/dist/chunks/{chunk-IYM44FUX.js → chunk-UC6DULWY.js} +2 -2
- package/dist/chunks/{chunk-4XT5RC5T.js → chunk-XPCUINWS.js} +6 -42
- package/dist/chunks/{chunk-U7M3ZB3Z.js → chunk-YBPTMJUM.js} +123 -180
- package/dist/chunks/{chunk-ISGQJIQM.js → chunk-Z5OXOZD3.js} +125 -83
- package/dist/chunks/{chunk-7D6LC5JY.js → chunk-ZH5R7W4A.js} +7 -39
- package/dist/chunks/{live-app-AZ5N5HBD.js → live-app-FBVWUUMT.js} +7 -7
- package/dist/commands/exec/command.d.ts +4 -90
- package/dist/commands/exec/command.js +15 -41
- package/dist/commands/exec/define-run-command.d.ts +19 -100
- 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/live-view.js +18 -22
- package/dist/commands/exec/metadata.js +1 -1
- package/dist/commands/exec/outcomes.d.ts +15 -109
- package/dist/commands/exec/outcomes.js +25 -39
- package/dist/commands/exec/plan-run.d.ts +11 -3
- package/dist/commands/exec/plan-run.js +3 -2
- package/dist/commands/exec/progress.d.ts +3 -19
- package/dist/commands/exec/progress.js +16 -60
- package/dist/commands/exec/run-command.d.ts +5 -24
- package/dist/commands/exec/run-command.js +32 -84
- package/dist/commands/exec/run-metadata.d.ts +0 -6
- package/dist/commands/exec/run-metadata.js +2 -8
- package/dist/commands/exec/snapshot-text.d.ts +7 -16
- package/dist/commands/exec/snapshot-text.js +9 -49
- 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/view.js +2 -12
- package/dist/commands/exec/worker-chart.d.ts +1 -1
- package/dist/commands/playwright/command.d.ts +12 -97
- package/dist/commands/playwright/command.js +14 -14
- package/dist/commands/playwright/metadata.js +2 -2
- package/dist/commands/runs/facts.d.ts +1 -37
- package/dist/commands/runs/facts.js +4 -36
- package/dist/commands/runs/list/command.d.ts +0 -72
- package/dist/commands/runs/list/command.js +6 -6
- package/dist/commands/runs/list/outcomes.d.ts +0 -36
- package/dist/commands/runs/logs/command.js +6 -6
- package/dist/commands/runs/show/command.d.ts +2 -74
- package/dist/commands/runs/show/command.js +16 -43
- package/dist/commands/runs/show/metadata.js +1 -1
- package/dist/commands/runs/show/outcomes.d.ts +1 -37
- package/dist/commands/runs/show/outcomes.js +8 -42
- package/dist/commands/snapshots/build/command.d.ts +14 -411
- package/dist/commands/snapshots/build/command.js +59 -234
- package/dist/commands/snapshots/build/metadata.js +10 -7
- package/dist/commands/snapshots/build/outcomes.d.ts +11 -241
- package/dist/commands/snapshots/build/outcomes.js +29 -196
- package/dist/commands/snapshots/list/command.d.ts +2 -36
- package/dist/commands/snapshots/list/command.js +20 -56
- package/dist/commands/snapshots/list/metadata.js +1 -1
- package/dist/commands/snapshots/list/outcomes.d.ts +2 -37
- package/dist/commands/snapshots/list/outcomes.js +13 -53
- package/dist/commands/vitest/command.d.ts +14 -98
- 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/core/events.d.ts +5 -6
- package/dist/core/run-state.d.ts +7 -29
- package/dist/core/run-state.js +3 -26
- package/dist/core/run.d.ts +6 -14
- package/dist/core/run.js +17 -28
- 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/index.d.ts +1 -0
- package/dist/extensions/testserver/vercel-cli/index.js +1 -0
- 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 +16 -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 +5 -4
- package/dist/extensions/testserver/vitest/diagnostics.js +15 -8
- package/dist/extensions/testserver/vitest/fixtures.d.ts +10 -1
- package/dist/extensions/testserver/vitest/fixtures.js +36 -10
- package/dist/extensions/testserver/vitest/types.d.ts +9 -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/index.d.ts +1 -1
- package/dist/run-directory/index.js +0 -1
- package/dist/run-directory/plan.d.ts +3 -2
- package/dist/run-directory/plan.js +6 -3
- package/dist/run-directory/recording.js +2 -2
- package/dist/run-directory/run-record.d.ts +18 -135
- package/dist/run-directory/run-record.js +8 -68
- package/dist/runner/build-snapshots.d.ts +50 -114
- package/dist/runner/build-snapshots.js +70 -159
- package/dist/runner/events.d.ts +4 -88
- package/dist/runner/gateways.d.ts +5 -23
- package/dist/runner/index.d.ts +5 -6
- package/dist/runner/index.js +1 -1
- package/dist/runner/live/snapshot-records.js +7 -18
- package/dist/runner/prepare.d.ts +11 -22
- package/dist/runner/prepare.js +6 -17
- package/dist/runner/ready.d.ts +16 -45
- package/dist/runner/ready.js +34 -59
- package/dist/runner/recipe.d.ts +5 -45
- package/dist/runner/recipe.js +0 -41
- package/dist/runner/sandboxed-command.d.ts +5 -3
- package/dist/runner/sandboxed-command.js +10 -4
- package/dist/runner/scope.d.ts +8 -25
- package/dist/runner/scope.js +4 -8
- package/dist/runner/session.d.ts +18 -65
- package/dist/runner/session.js +15 -83
- package/dist/runner/snapshot-build.d.ts +2 -2
- package/dist/runner/snapshot-cache.d.ts +22 -74
- package/dist/runner/snapshot-cache.js +15 -107
- package/dist/runner/snapshot-inspect.d.ts +9 -13
- package/dist/runner/snapshot-inspect.js +48 -57
- package/dist/runner/snapshot-key.d.ts +9 -14
- package/dist/runner/snapshot-key.js +15 -22
- 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/read-run-output.md +8 -9
- package/dist/runner/snapshot-save.d.ts +0 -70
- package/dist/runner/snapshot-save.js +0 -160
- package/dist/runner/snapshot-start.d.ts +0 -25
- package/dist/runner/snapshot-start.js +0 -16
- package/skills/testserver-builds.md +0 -82
|
@@ -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
|
+
}
|
|
@@ -8,7 +8,7 @@ import { cleanupProblems, megabytesText, setupPhaseKey, setupPhaseWords, } from
|
|
|
8
8
|
import { mintTargetText } from "../../credential/index.js";
|
|
9
9
|
import { DEFINITION_SET } from "../../extensions.js";
|
|
10
10
|
import { versionText } from "../../version.js";
|
|
11
|
-
import { commandEnd,
|
|
11
|
+
import { commandEnd, LANE_WIDTH } from "./progress.js";
|
|
12
12
|
import { builtAtText } from "./snapshot-text.js";
|
|
13
13
|
import { isoSecondsText, keepTimeText, releaseText, seconds, short, shortFile, spread, truncate, visibleLength, withArticle, } from "./text.js";
|
|
14
14
|
/** Spinner frames, one each tick. */
|
|
@@ -195,7 +195,9 @@ function lanesRecord(state, view) {
|
|
|
195
195
|
...(runner.sandbox === undefined
|
|
196
196
|
? []
|
|
197
197
|
: [`${runner.sandbox.name} · ${runner.sandbox.region} · ${runner.sandbox.vcpus} vCPU`]),
|
|
198
|
-
...(snapshot === undefined || snapshot.status === "pending"
|
|
198
|
+
...(snapshot === undefined || snapshot.status === "pending"
|
|
199
|
+
? []
|
|
200
|
+
: [snapshotText(snapshot, runner, state.base?.sha)]),
|
|
199
201
|
...(runner.status === "failed" || runner.status === "stopped" ? [runner.status] : []),
|
|
200
202
|
];
|
|
201
203
|
lines.push(view.row(`${laneHead(runnerGlyph(runner, view), "runner")}${parts.join(" · ")}`, elapsed(view, runner.startedAt, runner.endedAt)));
|
|
@@ -209,14 +211,17 @@ function lanesRecord(state, view) {
|
|
|
209
211
|
function runnerGlyph(runner, view) {
|
|
210
212
|
return view.glyph(runner.steps.some(({ status }) => status === "failed") ? "failed" : runner.status);
|
|
211
213
|
}
|
|
212
|
-
/**
|
|
213
|
-
|
|
214
|
+
/**
|
|
215
|
+
* What the runner did with its runner snapshot, for the runner's final form: whether a reused one was built at the
|
|
216
|
+
* run's merge-base (`mergeBase`) is compared with the merge-base the run said.
|
|
217
|
+
*/
|
|
218
|
+
function snapshotText(step, runner, mergeBase) {
|
|
214
219
|
// A snapshot the run built says so; one it reused says where it was built, in commits a person knows.
|
|
215
220
|
if (runner.snapshot?.kind === "built")
|
|
216
221
|
return "snapshot built";
|
|
217
222
|
if (runner.snapshot?.kind === "reused") {
|
|
218
|
-
const {
|
|
219
|
-
return `snapshot ${builtAtText({
|
|
223
|
+
const { base, builtBehind } = runner.snapshot;
|
|
224
|
+
return `snapshot ${builtAtText({ base, builtBehind, mergeBase })}`;
|
|
220
225
|
}
|
|
221
226
|
return `snapshot build ${step.status === "running" ? "stopped" : step.status}`;
|
|
222
227
|
}
|
|
@@ -394,40 +399,31 @@ function waitingText(waiting) {
|
|
|
394
399
|
}
|
|
395
400
|
/**
|
|
396
401
|
* The cleanup row: what it does while it runs, what it did in its final form, with the runner sandbox it kept
|
|
397
|
-
* running, if it kept one
|
|
402
|
+
* running, if it kept one.
|
|
398
403
|
*/
|
|
399
404
|
function cleanupLine(cleanup, runner, view, record) {
|
|
400
405
|
const done = record || cleanup.status !== "running";
|
|
401
406
|
const release = releaseText(cleanup.resources, done);
|
|
402
|
-
const {
|
|
407
|
+
const { keepMs } = cleanup;
|
|
403
408
|
const text = !done && cleanup.waiting
|
|
404
409
|
? `${WAITING_FOR_SNAPSHOT}…`
|
|
405
|
-
:
|
|
410
|
+
: keepMs === null
|
|
406
411
|
? (release ?? "nothing to release")
|
|
407
|
-
: `${runnerSandboxText(
|
|
412
|
+
: `${runnerSandboxText(keepMs, runner, done)}${release === undefined ? "" : `, ${release}`}`;
|
|
408
413
|
const leftBehind = cleanupProblems(cleanup);
|
|
409
414
|
const ending = done ? (leftBehind === 0 ? "" : `: ${leftBehind} left behind`) : "…";
|
|
410
415
|
return view.row(` ${view.glyph(cleanup.status)} cleanup ${text}${!done && cleanup.waiting ? "" : ending}`, elapsed(view, cleanup.startedAt, cleanup.endedAt));
|
|
411
416
|
}
|
|
412
417
|
/**
|
|
413
418
|
* What cleanup does with the runner sandbox, as the cleanup row says: kept it running, keeps it running while cleanup
|
|
414
|
-
* runs
|
|
419
|
+
* runs, or else stops and deletes it.
|
|
415
420
|
*/
|
|
416
|
-
function runnerSandboxText(
|
|
421
|
+
function runnerSandboxText(keepMs, runner, done) {
|
|
417
422
|
const kept = runner?.kept;
|
|
418
423
|
if (kept !== undefined)
|
|
419
424
|
return `kept the runner sandbox until ${isoSecondsText(kept.stopsAt)}`;
|
|
420
425
|
const removed = `${done ? "stopped and deleted" : "stopping and deleting"} the runner sandbox`;
|
|
421
|
-
|
|
422
|
-
case "keep":
|
|
423
|
-
return !done && sandbox.ms > 0 ? `keeping the runner sandbox running ${keepTimeText(sandbox.ms)}` : removed;
|
|
424
|
-
case "save": {
|
|
425
|
-
const save = runner?.save;
|
|
426
|
-
if (save?.kind === "saved")
|
|
427
|
-
return `saved dev snapshot ${save.id} of ${headText(save.branch)}`;
|
|
428
|
-
return !done && save?.kind !== "not-saved" ? `saving a dev snapshot of ${headText(sandbox.branch)}` : removed;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
426
|
+
return !done && keepMs > 0 ? `keeping the runner sandbox running ${keepTimeText(keepMs)}` : removed;
|
|
431
427
|
}
|
|
432
428
|
function statusGlyph(status, now, paint) {
|
|
433
429
|
switch (status) {
|
|
@@ -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;
|
|
@@ -13,48 +14,13 @@ export declare const ranSchema: z.ZodObject<{
|
|
|
13
14
|
runner: z.ZodNullable<z.ZodObject<{
|
|
14
15
|
snapshotId: z.ZodString;
|
|
15
16
|
base: z.ZodString;
|
|
16
|
-
|
|
17
|
-
snapshotHead: z.ZodNullable<z.ZodString>;
|
|
18
|
-
snapshotKind: z.ZodEnum<{
|
|
19
|
-
base: "base";
|
|
20
|
-
dev: "dev";
|
|
21
|
-
}>;
|
|
22
|
-
snapshotBuiltAt: z.ZodString;
|
|
23
|
-
builtBehind: z.ZodNullable<z.ZodNumber>;
|
|
17
|
+
builtBehind: z.ZodNumber;
|
|
24
18
|
uploadBytes: z.ZodNumber;
|
|
25
19
|
built: z.ZodBoolean;
|
|
26
20
|
vcpus: z.ZodNumber;
|
|
27
21
|
region: z.ZodString;
|
|
28
22
|
runtime: z.ZodString;
|
|
29
23
|
buildMs: z.ZodNumber;
|
|
30
|
-
save: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
31
|
-
kind: z.ZodLiteral<"saved">;
|
|
32
|
-
snapshotId: z.ZodString;
|
|
33
|
-
base: z.ZodString;
|
|
34
|
-
branch: z.ZodNullable<z.ZodString>;
|
|
35
|
-
head: z.ZodString;
|
|
36
|
-
ms: z.ZodNumber;
|
|
37
|
-
sizeBytes: z.ZodNumber;
|
|
38
|
-
entryWritten: z.ZodBoolean;
|
|
39
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
40
|
-
kind: z.ZodLiteral<"failed">;
|
|
41
|
-
step: z.ZodEnum<{
|
|
42
|
-
"save-snapshot": "save-snapshot";
|
|
43
|
-
scrub: "scrub";
|
|
44
|
-
}>;
|
|
45
|
-
message: z.ZodString;
|
|
46
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
47
|
-
kind: z.ZodLiteral<"stopped">;
|
|
48
|
-
}, z.core.$strip>], "kind">>;
|
|
49
|
-
noSaveReason: z.ZodNullable<z.ZodEnum<{
|
|
50
|
-
"already-saved": "already-saved";
|
|
51
|
-
ci: "ci";
|
|
52
|
-
"command-failed": "command-failed";
|
|
53
|
-
"keep-sandbox": "keep-sandbox";
|
|
54
|
-
"no-save-flag": "no-save-flag";
|
|
55
|
-
"not-trusted": "not-trusted";
|
|
56
|
-
recipe: "recipe";
|
|
57
|
-
}>>;
|
|
58
24
|
}, z.core.$strip>>;
|
|
59
25
|
timeline: z.ZodObject<{
|
|
60
26
|
startedAt: z.ZodString;
|
|
@@ -99,13 +65,21 @@ export declare const ranSchema: z.ZodObject<{
|
|
|
99
65
|
}, z.core.$strip>>;
|
|
100
66
|
}, z.core.$strip>;
|
|
101
67
|
runId: z.ZodNullable<z.ZodString>;
|
|
68
|
+
noFinalTestResults: z.ZodBoolean;
|
|
102
69
|
}, z.core.$strip>;
|
|
103
70
|
/** What a `ran` outcome is, for its description. */
|
|
104
|
-
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.";
|
|
105
|
-
/**
|
|
106
|
-
|
|
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<{
|
|
107
77
|
message?: string;
|
|
108
78
|
warnings?: import("../../sdk/extension/reports.ts").Warning<string>[];
|
|
79
|
+
next?: {
|
|
80
|
+
readonly type: "text";
|
|
81
|
+
readonly text: string;
|
|
82
|
+
}[];
|
|
109
83
|
}>;
|
|
110
84
|
/** The errors only a run ends with, beside the config's, the credential's, the resources' and the mint's. */
|
|
111
85
|
export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
|
|
@@ -113,10 +87,6 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
|
|
|
113
87
|
flags: z.ZodArray<z.ZodString>;
|
|
114
88
|
configFile: z.ZodNullable<z.ZodString>;
|
|
115
89
|
}, z.core.$strip>;
|
|
116
|
-
devSnapshotsNotTrusted: z.ZodObject<{
|
|
117
|
-
flag: z.ZodString;
|
|
118
|
-
configFile: z.ZodNullable<z.ZodString>;
|
|
119
|
-
}, z.core.$strip>;
|
|
120
90
|
missingRunner: z.ZodObject<{
|
|
121
91
|
configFile: z.ZodNullable<z.ZodString>;
|
|
122
92
|
}, z.core.$strip>;
|
|
@@ -204,24 +174,6 @@ export declare const runErrors: import("@vercel/clinkr").SharedErrors<{
|
|
|
204
174
|
}[];
|
|
205
175
|
};
|
|
206
176
|
};
|
|
207
|
-
readonly devSnapshotsNotTrusted: {
|
|
208
|
-
readonly exitCode: 2;
|
|
209
|
-
readonly description: "--save-dev-snapshot was given to a sandboxed run whose runner recipe's install or build step names a runner secret, and the recipe doesn't set trustDevSnapshots: true. A dev snapshot holds what a command wrote, and those steps run on top of it in later runs with their secrets, so only the recipe grants that trust. Nothing was minted, acquired or created.";
|
|
210
|
-
readonly schema: z.ZodObject<{
|
|
211
|
-
flag: z.ZodString;
|
|
212
|
-
configFile: z.ZodNullable<z.ZodString>;
|
|
213
|
-
}, z.core.$strip>;
|
|
214
|
-
readonly render: ({ flag, configFile }: {
|
|
215
|
-
flag: string;
|
|
216
|
-
configFile: string | null;
|
|
217
|
-
}) => {
|
|
218
|
-
message: string;
|
|
219
|
-
next: {
|
|
220
|
-
type: "text";
|
|
221
|
-
text: string;
|
|
222
|
-
}[];
|
|
223
|
-
};
|
|
224
|
-
};
|
|
225
177
|
readonly missingRunner: {
|
|
226
178
|
readonly exitCode: 2;
|
|
227
179
|
readonly description: "A sandboxed run (no --unsandboxed) needs a runner recipe, and no storm.config.ts gives a runner key.";
|
|
@@ -428,10 +380,6 @@ export declare const RUN_ERRORS: {
|
|
|
428
380
|
flags: string[];
|
|
429
381
|
configFile: string | null;
|
|
430
382
|
}]>;
|
|
431
|
-
devSnapshotsNotTrusted: import("@vercel/clinkr").SharedError<"dev_snapshots_not_trusted", [data: {
|
|
432
|
-
flag: string;
|
|
433
|
-
configFile: string | null;
|
|
434
|
-
}]>;
|
|
435
383
|
invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
|
|
436
384
|
file: string;
|
|
437
385
|
problems: {
|
|
@@ -550,48 +498,13 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
550
498
|
runner: z.ZodNullable<z.ZodObject<{
|
|
551
499
|
snapshotId: z.ZodString;
|
|
552
500
|
base: z.ZodString;
|
|
553
|
-
|
|
554
|
-
snapshotHead: z.ZodNullable<z.ZodString>;
|
|
555
|
-
snapshotKind: z.ZodEnum<{
|
|
556
|
-
base: "base";
|
|
557
|
-
dev: "dev";
|
|
558
|
-
}>;
|
|
559
|
-
snapshotBuiltAt: z.ZodString;
|
|
560
|
-
builtBehind: z.ZodNullable<z.ZodNumber>;
|
|
501
|
+
builtBehind: z.ZodNumber;
|
|
561
502
|
uploadBytes: z.ZodNumber;
|
|
562
503
|
built: z.ZodBoolean;
|
|
563
504
|
vcpus: z.ZodNumber;
|
|
564
505
|
region: z.ZodString;
|
|
565
506
|
runtime: z.ZodString;
|
|
566
507
|
buildMs: z.ZodNumber;
|
|
567
|
-
save: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
568
|
-
kind: z.ZodLiteral<"saved">;
|
|
569
|
-
snapshotId: z.ZodString;
|
|
570
|
-
base: z.ZodString;
|
|
571
|
-
branch: z.ZodNullable<z.ZodString>;
|
|
572
|
-
head: z.ZodString;
|
|
573
|
-
ms: z.ZodNumber;
|
|
574
|
-
sizeBytes: z.ZodNumber;
|
|
575
|
-
entryWritten: z.ZodBoolean;
|
|
576
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
577
|
-
kind: z.ZodLiteral<"failed">;
|
|
578
|
-
step: z.ZodEnum<{
|
|
579
|
-
"save-snapshot": "save-snapshot";
|
|
580
|
-
scrub: "scrub";
|
|
581
|
-
}>;
|
|
582
|
-
message: z.ZodString;
|
|
583
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
584
|
-
kind: z.ZodLiteral<"stopped">;
|
|
585
|
-
}, z.core.$strip>], "kind">>;
|
|
586
|
-
noSaveReason: z.ZodNullable<z.ZodEnum<{
|
|
587
|
-
"already-saved": "already-saved";
|
|
588
|
-
ci: "ci";
|
|
589
|
-
"command-failed": "command-failed";
|
|
590
|
-
"keep-sandbox": "keep-sandbox";
|
|
591
|
-
"no-save-flag": "no-save-flag";
|
|
592
|
-
"not-trusted": "not-trusted";
|
|
593
|
-
recipe: "recipe";
|
|
594
|
-
}>>;
|
|
595
508
|
}, z.core.$strip>>;
|
|
596
509
|
timeline: z.ZodObject<{
|
|
597
510
|
startedAt: z.ZodString;
|
|
@@ -636,6 +549,7 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
636
549
|
}, z.core.$strip>>;
|
|
637
550
|
}, z.core.$strip>;
|
|
638
551
|
runId: z.ZodNullable<z.ZodString>;
|
|
552
|
+
noFinalTestResults: z.ZodBoolean;
|
|
639
553
|
}, z.core.$strip>;
|
|
640
554
|
}, {
|
|
641
555
|
ran: unknown;
|
|
@@ -644,10 +558,6 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
644
558
|
flags: string[];
|
|
645
559
|
configFile: string | null;
|
|
646
560
|
}]>;
|
|
647
|
-
devSnapshotsNotTrusted: import("@vercel/clinkr").SharedError<"dev_snapshots_not_trusted", [data: {
|
|
648
|
-
flag: string;
|
|
649
|
-
configFile: string | null;
|
|
650
|
-
}]>;
|
|
651
561
|
invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
|
|
652
562
|
file: string;
|
|
653
563
|
problems: {
|
|
@@ -755,10 +665,6 @@ export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
|
755
665
|
flags: string[];
|
|
756
666
|
configFile: string | null;
|
|
757
667
|
}]>;
|
|
758
|
-
devSnapshotsNotTrusted: import("@vercel/clinkr").SharedError<"dev_snapshots_not_trusted", [data: {
|
|
759
|
-
flag: string;
|
|
760
|
-
configFile: string | null;
|
|
761
|
-
}]>;
|
|
762
668
|
invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
|
|
763
669
|
file: string;
|
|
764
670
|
problems: {
|
|
@@ -3,9 +3,11 @@ import { z } from "zod";
|
|
|
3
3
|
import { DEFINITION_SET } from "../../extensions.js";
|
|
4
4
|
import { configErrors, credentialErrors } from "../../config/index.js";
|
|
5
5
|
import { keptText, RUN_CLEANUP, runnerCleanupWarnings } from "./cleanup.js";
|
|
6
|
+
import { EXEC_HINTS } from "./exec-words.js";
|
|
7
|
+
import { noFinalResultsContent } from "./final-results.js";
|
|
6
8
|
import { mintFailedErrors } from "./mint-failed.js";
|
|
7
9
|
import { resourceRefusalErrors } from "./resource-refusals.js";
|
|
8
|
-
import {
|
|
10
|
+
import { timelineSchema } from "../../run-directory/index.js";
|
|
9
11
|
/** Why the runner couldn't run the command. */
|
|
10
12
|
const runnerFailureSchema = z.union([
|
|
11
13
|
z.object({
|
|
@@ -114,18 +116,10 @@ export const ranSchema = z.object({
|
|
|
114
116
|
.object({
|
|
115
117
|
/** The runner snapshot it started from. */
|
|
116
118
|
snapshotId: z.string(),
|
|
117
|
-
/** The runner snapshot's base, a full SHA. */
|
|
119
|
+
/** The runner snapshot's base, a full SHA: the commit it was built at. */
|
|
118
120
|
base: z.string(),
|
|
119
|
-
/**
|
|
120
|
-
|
|
121
|
-
/** For a dev snapshot, the HEAD commit of the run that saved it, a full SHA; null for a base snapshot. */
|
|
122
|
-
snapshotHead: z.string().nullable(),
|
|
123
|
-
/** The runner snapshot's kind: a base snapshot, built from its base, or a dev snapshot, saved from a run. */
|
|
124
|
-
snapshotKind: z.enum(["base", "dev"]),
|
|
125
|
-
/** The commit the runner snapshot was built at, a full SHA: a base snapshot's base, or the commit that saved a dev snapshot. */
|
|
126
|
-
snapshotBuiltAt: z.string(),
|
|
127
|
-
/** How many commits HEAD has that the snapshot's built-at commit lacks, 0 for a snapshot built at HEAD's commit; null when storm couldn't count them. */
|
|
128
|
-
builtBehind: z.number().nullable(),
|
|
121
|
+
/** How many commits HEAD has that the snapshot's base lacks, 0 for a snapshot built at HEAD's commit. */
|
|
122
|
+
builtBehind: z.number(),
|
|
129
123
|
/** How many bytes of changes the run uploaded on top of the snapshot's base. */
|
|
130
124
|
uploadBytes: z.number(),
|
|
131
125
|
/** Whether this run built the runner snapshot. */
|
|
@@ -135,21 +129,30 @@ export const ranSchema = z.object({
|
|
|
135
129
|
runtime: z.string(),
|
|
136
130
|
/** How long the build step took, in milliseconds. */
|
|
137
131
|
buildMs: z.number(),
|
|
138
|
-
/** How saving the runner sandbox as a dev snapshot ended; null when the run started no save. */
|
|
139
|
-
save: saveSchema.nullable(),
|
|
140
|
-
/** Why the run, whose command ended on its own, started no save of a dev snapshot; null when it started one. */
|
|
141
|
-
noSaveReason: noSaveReasonSchema.nullable(),
|
|
142
132
|
})
|
|
143
133
|
.nullable(),
|
|
144
134
|
/** The run's waterfall, as the run directory's timeline.json holds it: each lane's label, span and steps in milliseconds since the run started, how they ended, idle time, and the critical path. */
|
|
145
135
|
timeline: timelineSchema,
|
|
146
136
|
/** The run's run directory's run id, which `storm runs show` takes; null when the run couldn't make one. */
|
|
147
137
|
runId: z.string().nullable(),
|
|
138
|
+
/**
|
|
139
|
+
* Whether the run saved no final test result though its command exited 0: storm handed the command a test events
|
|
140
|
+
* file and read every line of it, and none was a final result. Then the result warns `no_final_test_results`, whose
|
|
141
|
+
* next steps add storm's reporter to the test runner's config.
|
|
142
|
+
*/
|
|
143
|
+
noFinalTestResults: z.boolean(),
|
|
148
144
|
});
|
|
149
145
|
/** What a `ran` outcome is, for its description. */
|
|
150
|
-
export 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.";
|
|
151
|
-
/**
|
|
152
|
-
|
|
146
|
+
export 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.";
|
|
147
|
+
/**
|
|
148
|
+
* How a `ran` outcome renders: its warnings, and the runner sandbox the run kept running, if any; with
|
|
149
|
+
* `noFinalTestResults`, the `no_final_test_results` warning and `hints.addReporter` as its next steps.
|
|
150
|
+
*/
|
|
151
|
+
export function ranRenderer(hints) {
|
|
152
|
+
return (ran) => renderRan(ran, hints);
|
|
153
|
+
}
|
|
154
|
+
function renderRan(ran, hints) {
|
|
155
|
+
const noFinal = noFinalResultsContent(ran.noFinalTestResults, hints);
|
|
153
156
|
const warnings = [
|
|
154
157
|
...DEFINITION_SET.reports.ranWarnings(ran.resources),
|
|
155
158
|
...(ran.runner !== null && ran.command.exitCode === null && ran.command.signal === null
|
|
@@ -162,6 +165,7 @@ export function renderRan(ran) {
|
|
|
162
165
|
: []),
|
|
163
166
|
...runnerCleanupWarnings(ran.cleanup.runner),
|
|
164
167
|
...DEFINITION_SET.reports.cleanupWarnings(ran.cleanup.resources),
|
|
168
|
+
...noFinal.warnings,
|
|
165
169
|
];
|
|
166
170
|
// The waterfall, which the run prints on stderr before this, is the human summary; the kept runner sandbox
|
|
167
171
|
// follows it, so a person sees where to connect last.
|
|
@@ -169,6 +173,7 @@ export function renderRan(ran) {
|
|
|
169
173
|
return renderOutcome({
|
|
170
174
|
...(kept === null ? {} : { message: keptText(kept) }),
|
|
171
175
|
...(warnings.length === 0 ? {} : { warnings }),
|
|
176
|
+
...(noFinal.next.length === 0 ? {} : { next: [...noFinal.next] }),
|
|
172
177
|
});
|
|
173
178
|
}
|
|
174
179
|
/** The errors only a run ends with, beside the config's, the credential's, the resources' and the mint's. */
|
|
@@ -192,25 +197,6 @@ export const runErrors = defineErrors({
|
|
|
192
197
|
],
|
|
193
198
|
}),
|
|
194
199
|
},
|
|
195
|
-
devSnapshotsNotTrusted: {
|
|
196
|
-
exitCode: 2,
|
|
197
|
-
description: "--save-dev-snapshot was given to a sandboxed run whose runner recipe's install or build step names a runner secret, and the recipe doesn't set trustDevSnapshots: true. A dev snapshot holds what a command wrote, and those steps run on top of it in later runs with their secrets, so only the recipe grants that trust. Nothing was minted, acquired or created.",
|
|
198
|
-
schema: z.object({
|
|
199
|
-
/** The flag given, as typed. */
|
|
200
|
-
flag: z.string(),
|
|
201
|
-
/** The config file that gave the runner recipe; null when none did. */
|
|
202
|
-
configFile: z.string().nullable(),
|
|
203
|
-
}),
|
|
204
|
-
render: ({ flag, configFile }) => ({
|
|
205
|
-
message: `${flag} saves a dev snapshot, and the runner recipe${configFile === null ? "" : ` in ${configFile}`} doesn't trust dev snapshots: its install or build step names a runner secret.`,
|
|
206
|
-
next: [
|
|
207
|
-
{
|
|
208
|
-
type: "text",
|
|
209
|
-
text: `Drop ${flag}, or set trustDevSnapshots: true under the runner key of storm.config.ts, which trusts every command run from a checkout with those secrets.`,
|
|
210
|
-
},
|
|
211
|
-
],
|
|
212
|
-
}),
|
|
213
|
-
},
|
|
214
200
|
missingRunner: {
|
|
215
201
|
exitCode: 2,
|
|
216
202
|
description: "A sandboxed run (no --unsandboxed) needs a runner recipe, and no storm.config.ts gives a runner key.",
|
|
@@ -393,6 +379,6 @@ export const RUN_ERRORS = {
|
|
|
393
379
|
};
|
|
394
380
|
/** How `exec` ends. No outcome carries the credential. */
|
|
395
381
|
export const outcomes = defineOutcomes({
|
|
396
|
-
results: { ran: { schema: ranSchema, description: RAN_DESCRIPTION, render:
|
|
382
|
+
results: { ran: { schema: ranSchema, description: RAN_DESCRIPTION, render: ranRenderer(EXEC_HINTS) } },
|
|
397
383
|
errors: RUN_ERRORS,
|
|
398
384
|
});
|
|
@@ -18,19 +18,26 @@ export type PlannedWhere = {
|
|
|
18
18
|
readonly target: MintTarget;
|
|
19
19
|
readonly secrets: RunnerSecrets;
|
|
20
20
|
};
|
|
21
|
-
/** A command's part of planning its run: the argv the run runs, and what it counted before the run. */
|
|
21
|
+
/** A command's part of planning its run: the argv the run runs, and what it counted before the run, if anything. */
|
|
22
22
|
export interface PlannedCommand<TTestPlan extends RunTestPlan> {
|
|
23
23
|
readonly ok: true;
|
|
24
24
|
readonly argv: readonly string[];
|
|
25
25
|
readonly testPlan: TTestPlan;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* What the config file says to a command's part of planning: whether it plans the tests (`testPlan`), which only a
|
|
29
|
+
* command with a driver reads.
|
|
30
|
+
*/
|
|
31
|
+
export interface PlannedSettings {
|
|
32
|
+
readonly testPlan: boolean;
|
|
33
|
+
}
|
|
27
34
|
/**
|
|
28
35
|
* A command's part of planning its run, once storm knows where the run runs and before it resolves the resources'
|
|
29
36
|
* options: the argv, and what the command counted, which the options' defaults get; or a refusal, which ends the run
|
|
30
37
|
* there, with the run's secrets hidden. Nothing is minted, acquired or started yet. Once `signal`, the invocation's,
|
|
31
38
|
* aborts, it stops what it started as soon as it can; the run then cancels, whatever it answers.
|
|
32
39
|
*/
|
|
33
|
-
export type PlanCommand<TTestPlan extends RunTestPlan, TRefusal> = (where: PlannedWhere, signal: AbortSignal) => Promise<PlannedCommand<TTestPlan> | {
|
|
40
|
+
export type PlanCommand<TTestPlan extends RunTestPlan, TRefusal> = (where: PlannedWhere, signal: AbortSignal, settings: PlannedSettings) => Promise<PlannedCommand<TTestPlan> | {
|
|
34
41
|
readonly ok: false;
|
|
35
42
|
readonly refusal: TRefusal;
|
|
36
43
|
}>;
|
|
@@ -62,7 +69,8 @@ export interface PlanRequest {
|
|
|
62
69
|
* 3. Merges each resource's options once (`settleRunResources`): a required option nothing gives is
|
|
63
70
|
* `invalid_resource_options`. The merged options, each function default given `NOT_COUNTED`, name each resource's
|
|
64
71
|
* secrets.
|
|
65
|
-
* 4. Asks the command for its part (`planCommand`)
|
|
72
|
+
* 4. Asks the command for its part (`planCommand`), with the file's `testPlan`: its argv, and what it counted, such
|
|
73
|
+
* as `vitest`'s tests when the file sets `testPlan`; or
|
|
66
74
|
* its refusal, with the runner secrets and the resources' secrets hidden, from each resource's pure `secrets` over
|
|
67
75
|
* the merged options. A signal by then cancels the run (`canceledBeforeStart`).
|
|
68
76
|
* 5. Plans the merged options for the planned run (`plan`), each function default given the planned run once, and
|
|
@@ -17,7 +17,8 @@ import { resourceRefusedBeforeRun } from "./resource-refusals.js";
|
|
|
17
17
|
* 3. Merges each resource's options once (`settleRunResources`): a required option nothing gives is
|
|
18
18
|
* `invalid_resource_options`. The merged options, each function default given `NOT_COUNTED`, name each resource's
|
|
19
19
|
* secrets.
|
|
20
|
-
* 4. Asks the command for its part (`planCommand`)
|
|
20
|
+
* 4. Asks the command for its part (`planCommand`), with the file's `testPlan`: its argv, and what it counted, such
|
|
21
|
+
* as `vitest`'s tests when the file sets `testPlan`; or
|
|
21
22
|
* its refusal, with the runner secrets and the resources' secrets hidden, from each resource's pure `secrets` over
|
|
22
23
|
* the merged options. A signal by then cancels the run (`canceledBeforeStart`).
|
|
23
24
|
* 5. Plans the merged options for the planned run (`plan`), each function default given the planned run once, and
|
|
@@ -54,7 +55,7 @@ export async function planRun(app, lifecycles, request, planCommand, signal) {
|
|
|
54
55
|
const merged = settleRunResources(file, request.given);
|
|
55
56
|
if (!merged.ok)
|
|
56
57
|
return merged;
|
|
57
|
-
const command = await planCommand(where, signal);
|
|
58
|
+
const command = await planCommand(where, signal, { testPlan: settings.testPlan?.value === true });
|
|
58
59
|
if (signal.aborted)
|
|
59
60
|
return refused(canceledBeforeStart());
|
|
60
61
|
if (!command.ok) {
|
|
@@ -37,11 +37,12 @@ export declare function progressLine(elapsedMs: number, lane: ProgressLane, text
|
|
|
37
37
|
export declare const LANE_WIDTH: number;
|
|
38
38
|
/**
|
|
39
39
|
* The line that says which runner snapshot the run starts from: its id, and where it was built, in commits a person
|
|
40
|
-
* knows
|
|
40
|
+
* knows: at HEAD's commit, at the run's merge-base (`mergeBase`, undefined when the run didn't say it), or some commits
|
|
41
|
+
* before HEAD.
|
|
41
42
|
*/
|
|
42
43
|
export declare function snapshotReusedText(event: Extract<RunnerEvent, {
|
|
43
44
|
readonly kind: "snapshot-reused";
|
|
44
|
-
}
|
|
45
|
+
}>, mergeBase: string | undefined): string;
|
|
45
46
|
/**
|
|
46
47
|
* The lines that say the run builds a base snapshot: where and why, then why each cached snapshot of the recipe
|
|
47
48
|
* doesn't fit.
|
|
@@ -49,23 +50,6 @@ export declare function snapshotReusedText(event: Extract<RunnerEvent, {
|
|
|
49
50
|
export declare function snapshotBuildTexts(event: Extract<RunnerEvent, {
|
|
50
51
|
readonly kind: "snapshot-build-started";
|
|
51
52
|
}>): string[];
|
|
52
|
-
/** Why a run whose command ended on its own saves no dev snapshot, as its line says. */
|
|
53
|
-
export declare function devSnapshotSkippedText(event: Extract<RunnerEvent, {
|
|
54
|
-
readonly kind: "dev-snapshot-skipped";
|
|
55
|
-
}>): string;
|
|
56
|
-
/** How saving a dev snapshot ended, as its line says. */
|
|
57
|
-
export declare function devSnapshotSaveText(event: Extract<RunnerEvent, {
|
|
58
|
-
readonly kind: "dev-snapshot-saved" | "dev-snapshot-not-saved";
|
|
59
|
-
}>): string;
|
|
60
|
-
/** HEAD as a save's lines name it: its branch, or that it is detached. */
|
|
61
|
-
export declare function headText(branch: string | null): string;
|
|
62
|
-
/**
|
|
63
|
-
* What `storm snapshots build --full` did to the entries of the dev snapshots built on the base snapshot it replaced,
|
|
64
|
-
* as its line says.
|
|
65
|
-
*/
|
|
66
|
-
export declare function devSnapshotsDropText(event: Extract<RunnerEvent, {
|
|
67
|
-
readonly kind: "dev-snapshots-dropped" | "dev-snapshots-not-dropped";
|
|
68
|
-
}>): string;
|
|
69
53
|
/** How a command ended, as its end line and the live view say. */
|
|
70
54
|
export declare function commandEnd(outcome: RanCommand): string;
|
|
71
55
|
/** A warning a resource instance reported, as a line in its lane: `warning: <message>`. */
|