@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
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
redactingObserver,
|
|
7
7
|
redactingTerminal,
|
|
8
8
|
redactor
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-27P2QSIM.js";
|
|
10
10
|
import {
|
|
11
11
|
criticalPathStep,
|
|
12
12
|
recordedPlan,
|
|
@@ -17,26 +17,23 @@ import {
|
|
|
17
17
|
testsChart,
|
|
18
18
|
testsSummaryLines,
|
|
19
19
|
waterfallLines
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-BFLYGMG3.js";
|
|
21
21
|
import {
|
|
22
22
|
builtAtText,
|
|
23
|
-
noSaveText,
|
|
24
23
|
rejectionLines,
|
|
25
24
|
snapshotCacheNoteText
|
|
26
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-XPCUINWS.js";
|
|
27
26
|
import {
|
|
28
27
|
DEFINITION_SET,
|
|
29
28
|
RESOURCES
|
|
30
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-Z5OXOZD3.js";
|
|
31
30
|
import {
|
|
32
31
|
sandboxConnectPage
|
|
33
32
|
} from "./chunk-NMVODY3P.js";
|
|
34
33
|
import {
|
|
35
|
-
noSaveReasonSchema,
|
|
36
34
|
recordRun,
|
|
37
|
-
saveSchema,
|
|
38
35
|
timelineSchema
|
|
39
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-RKONDLPS.js";
|
|
40
37
|
import {
|
|
41
38
|
isoSecondsText,
|
|
42
39
|
keepTimeText,
|
|
@@ -49,7 +46,7 @@ import {
|
|
|
49
46
|
truncate,
|
|
50
47
|
visibleLength,
|
|
51
48
|
withArticle
|
|
52
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-QBR5VHJ7.js";
|
|
53
50
|
import {
|
|
54
51
|
EMPTY_RUN_STATE,
|
|
55
52
|
cleanupProblems,
|
|
@@ -62,12 +59,11 @@ import {
|
|
|
62
59
|
setupPhaseWords,
|
|
63
60
|
timedProgress,
|
|
64
61
|
warningTally
|
|
65
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-5TMHYH7G.js";
|
|
66
63
|
import {
|
|
67
64
|
RUNNER_SECRET_MIN_LENGTH,
|
|
68
65
|
configErrors,
|
|
69
66
|
credentialErrors,
|
|
70
|
-
devSnapshotsTrusted,
|
|
71
67
|
fileSettings,
|
|
72
68
|
invalidConfig,
|
|
73
69
|
loadSettingsFile,
|
|
@@ -79,11 +75,11 @@ import {
|
|
|
79
75
|
requireTarget,
|
|
80
76
|
settleCredential,
|
|
81
77
|
settleRunResources
|
|
82
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-5ED3IDUJ.js";
|
|
83
79
|
import {
|
|
84
80
|
describeMintFailure,
|
|
85
81
|
isCi
|
|
86
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-RA4L2ACU.js";
|
|
87
83
|
import {
|
|
88
84
|
NodeSignalCancellation
|
|
89
85
|
} from "./chunk-BW2ADH7U.js";
|
|
@@ -94,6 +90,38 @@ import {
|
|
|
94
90
|
renderOutcome
|
|
95
91
|
} from "./chunk-YM6TZV4L.js";
|
|
96
92
|
|
|
93
|
+
// src/commands/exec/exec-words.ts
|
|
94
|
+
var EXEC_HELP = {
|
|
95
|
+
usage: "-- <command...>",
|
|
96
|
+
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.",
|
|
97
|
+
verbose: "which asks the command to print what each test does as it happens, for passing tests too",
|
|
98
|
+
examples: [
|
|
99
|
+
{
|
|
100
|
+
argv: "-- pnpm test",
|
|
101
|
+
description: "Run the package's test script in a runner sandbox, with the runner recipe, team, project and resources from storm.config.ts."
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
argv: "--keep-sandbox 2h -- pnpm test",
|
|
105
|
+
description: "Run the tests in a runner sandbox and keep it running 2 hours after the run, to debug in it."
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
argv: "--unsandboxed -- node scripts/smoke.mjs",
|
|
109
|
+
description: "Run a Node.js script on this machine, with the resources storm.config.ts declares, if any."
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
};
|
|
113
|
+
var EXEC_HINTS = {
|
|
114
|
+
// The command's test runner reported no final result. Which one it is the launcher can't tell, so the hint names
|
|
115
|
+
// storm's reporter for each: the Vitest one and the Playwright one, by their published paths.
|
|
116
|
+
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)",
|
|
117
|
+
// 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
|
|
118
|
+
// runner, under either npm name.
|
|
119
|
+
addReporter: [
|
|
120
|
+
`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".`,
|
|
121
|
+
"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."
|
|
122
|
+
]
|
|
123
|
+
};
|
|
124
|
+
|
|
97
125
|
// src/commands/exec/cleanup.ts
|
|
98
126
|
import { z } from "zod";
|
|
99
127
|
var notStoppedSchema = z.object({
|
|
@@ -196,6 +224,19 @@ function runnerCleanupOf(report) {
|
|
|
196
224
|
// src/commands/exec/outcomes.ts
|
|
197
225
|
import { z as z4 } from "zod";
|
|
198
226
|
|
|
227
|
+
// src/commands/exec/final-results.ts
|
|
228
|
+
function lacksFinalResults(exitCode, read) {
|
|
229
|
+
return exitCode === 0 && read.collected && read.finalResults === 0 && !read.partial;
|
|
230
|
+
}
|
|
231
|
+
var 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.";
|
|
232
|
+
function noFinalResultsContent(noFinalTestResults, hints) {
|
|
233
|
+
if (!noFinalTestResults) return { warnings: [], next: [] };
|
|
234
|
+
return {
|
|
235
|
+
warnings: [{ reason: "no_final_test_results", message: NO_FINAL_RESULTS_MESSAGE }],
|
|
236
|
+
next: hints.addReporter.map((text) => ({ type: "text", text }))
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
|
|
199
240
|
// src/commands/exec/mint-failed.ts
|
|
200
241
|
import { z as z2 } from "zod";
|
|
201
242
|
var mintFailedErrors = defineErrors({
|
|
@@ -376,18 +417,10 @@ var ranSchema = z4.object({
|
|
|
376
417
|
runner: z4.object({
|
|
377
418
|
/** The runner snapshot it started from. */
|
|
378
419
|
snapshotId: z4.string(),
|
|
379
|
-
/** The runner snapshot's base, a full SHA. */
|
|
420
|
+
/** The runner snapshot's base, a full SHA: the commit it was built at. */
|
|
380
421
|
base: z4.string(),
|
|
381
|
-
/**
|
|
382
|
-
|
|
383
|
-
/** For a dev snapshot, the HEAD commit of the run that saved it, a full SHA; null for a base snapshot. */
|
|
384
|
-
snapshotHead: z4.string().nullable(),
|
|
385
|
-
/** The runner snapshot's kind: a base snapshot, built from its base, or a dev snapshot, saved from a run. */
|
|
386
|
-
snapshotKind: z4.enum(["base", "dev"]),
|
|
387
|
-
/** The commit the runner snapshot was built at, a full SHA: a base snapshot's base, or the commit that saved a dev snapshot. */
|
|
388
|
-
snapshotBuiltAt: z4.string(),
|
|
389
|
-
/** 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. */
|
|
390
|
-
builtBehind: z4.number().nullable(),
|
|
422
|
+
/** How many commits HEAD has that the snapshot's base lacks, 0 for a snapshot built at HEAD's commit. */
|
|
423
|
+
builtBehind: z4.number(),
|
|
391
424
|
/** How many bytes of changes the run uploaded on top of the snapshot's base. */
|
|
392
425
|
uploadBytes: z4.number(),
|
|
393
426
|
/** Whether this run built the runner snapshot. */
|
|
@@ -396,19 +429,25 @@ var ranSchema = z4.object({
|
|
|
396
429
|
region: z4.string(),
|
|
397
430
|
runtime: z4.string(),
|
|
398
431
|
/** How long the build step took, in milliseconds. */
|
|
399
|
-
buildMs: z4.number()
|
|
400
|
-
/** How saving the runner sandbox as a dev snapshot ended; null when the run started no save. */
|
|
401
|
-
save: saveSchema.nullable(),
|
|
402
|
-
/** Why the run, whose command ended on its own, started no save of a dev snapshot; null when it started one. */
|
|
403
|
-
noSaveReason: noSaveReasonSchema.nullable()
|
|
432
|
+
buildMs: z4.number()
|
|
404
433
|
}).nullable(),
|
|
405
434
|
/** 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. */
|
|
406
435
|
timeline: timelineSchema,
|
|
407
436
|
/** The run's run directory's run id, which `storm runs show` takes; null when the run couldn't make one. */
|
|
408
|
-
runId: z4.string().nullable()
|
|
437
|
+
runId: z4.string().nullable(),
|
|
438
|
+
/**
|
|
439
|
+
* Whether the run saved no final test result though its command exited 0: storm handed the command a test events
|
|
440
|
+
* file and read every line of it, and none was a final result. Then the result warns `no_final_test_results`, whose
|
|
441
|
+
* next steps add storm's reporter to the test runner's config.
|
|
442
|
+
*/
|
|
443
|
+
noFinalTestResults: z4.boolean()
|
|
409
444
|
});
|
|
410
|
-
var 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.";
|
|
411
|
-
function
|
|
445
|
+
var 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.";
|
|
446
|
+
function ranRenderer(hints) {
|
|
447
|
+
return (ran) => renderRan(ran, hints);
|
|
448
|
+
}
|
|
449
|
+
function renderRan(ran, hints) {
|
|
450
|
+
const noFinal = noFinalResultsContent(ran.noFinalTestResults, hints);
|
|
412
451
|
const warnings = [
|
|
413
452
|
...DEFINITION_SET.reports.ranWarnings(ran.resources),
|
|
414
453
|
...ran.runner !== null && ran.command.exitCode === null && ran.command.signal === null ? [
|
|
@@ -418,12 +457,14 @@ function renderRan(ran) {
|
|
|
418
457
|
}
|
|
419
458
|
] : [],
|
|
420
459
|
...runnerCleanupWarnings(ran.cleanup.runner),
|
|
421
|
-
...DEFINITION_SET.reports.cleanupWarnings(ran.cleanup.resources)
|
|
460
|
+
...DEFINITION_SET.reports.cleanupWarnings(ran.cleanup.resources),
|
|
461
|
+
...noFinal.warnings
|
|
422
462
|
];
|
|
423
463
|
const kept = ran.cleanup.runner?.kept ?? null;
|
|
424
464
|
return renderOutcome({
|
|
425
465
|
...kept === null ? {} : { message: keptText(kept) },
|
|
426
|
-
...warnings.length === 0 ? {} : { warnings }
|
|
466
|
+
...warnings.length === 0 ? {} : { warnings },
|
|
467
|
+
...noFinal.next.length === 0 ? {} : { next: [...noFinal.next] }
|
|
427
468
|
});
|
|
428
469
|
}
|
|
429
470
|
var runErrors = defineErrors({
|
|
@@ -446,25 +487,6 @@ var runErrors = defineErrors({
|
|
|
446
487
|
]
|
|
447
488
|
})
|
|
448
489
|
},
|
|
449
|
-
devSnapshotsNotTrusted: {
|
|
450
|
-
exitCode: 2,
|
|
451
|
-
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.",
|
|
452
|
-
schema: z4.object({
|
|
453
|
-
/** The flag given, as typed. */
|
|
454
|
-
flag: z4.string(),
|
|
455
|
-
/** The config file that gave the runner recipe; null when none did. */
|
|
456
|
-
configFile: z4.string().nullable()
|
|
457
|
-
}),
|
|
458
|
-
render: ({ flag, configFile }) => ({
|
|
459
|
-
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.`,
|
|
460
|
-
next: [
|
|
461
|
-
{
|
|
462
|
-
type: "text",
|
|
463
|
-
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.`
|
|
464
|
-
}
|
|
465
|
-
]
|
|
466
|
-
})
|
|
467
|
-
},
|
|
468
490
|
missingRunner: {
|
|
469
491
|
exitCode: 2,
|
|
470
492
|
description: "A sandboxed run (no --unsandboxed) needs a runner recipe, and no storm.config.ts gives a runner key.",
|
|
@@ -635,7 +657,7 @@ var RUN_ERRORS = {
|
|
|
635
657
|
...runErrors
|
|
636
658
|
};
|
|
637
659
|
var outcomes = defineOutcomes({
|
|
638
|
-
results: { ran: { schema: ranSchema, description: RAN_DESCRIPTION, render:
|
|
660
|
+
results: { ran: { schema: ranSchema, description: RAN_DESCRIPTION, render: ranRenderer(EXEC_HINTS) } },
|
|
639
661
|
errors: RUN_ERRORS
|
|
640
662
|
});
|
|
641
663
|
|
|
@@ -665,6 +687,7 @@ function plainRenderer(options) {
|
|
|
665
687
|
lanesStartedAt: void 0,
|
|
666
688
|
readyAt: { runner: void 0, resources: {} },
|
|
667
689
|
cleanupStartedAt: void 0,
|
|
690
|
+
mergeBase: void 0,
|
|
668
691
|
folded: false
|
|
669
692
|
};
|
|
670
693
|
const resources = DEFINITION_SET.presentations.plain({ verbose: options.verbose === true });
|
|
@@ -751,7 +774,7 @@ function eventLines(event, now, state, line, options) {
|
|
|
751
774
|
return [line("command", `${event.command} ${commandEnd(event.outcome)} after ${seconds(event.ms)}`)];
|
|
752
775
|
case "cleanup-started":
|
|
753
776
|
state.cleanupStartedAt = now;
|
|
754
|
-
return [line("cleanup", cleanupText(event.
|
|
777
|
+
return [line("cleanup", cleanupText(event.keepMs, releaseText(event.resources, false)))];
|
|
755
778
|
case "cleanup-finished": {
|
|
756
779
|
const problems = [
|
|
757
780
|
...event.notStopped === 0 ? [] : [`${event.notStopped} not stopped`],
|
|
@@ -766,6 +789,7 @@ function eventLines(event, now, state, line, options) {
|
|
|
766
789
|
];
|
|
767
790
|
}
|
|
768
791
|
case "runner-prepared":
|
|
792
|
+
state.mergeBase = event.base;
|
|
769
793
|
return [
|
|
770
794
|
line("runner", `merge-base ${short(event.base)}, of HEAD and ${event.baseRef}`),
|
|
771
795
|
...preparedNoteTexts(event).map((text) => line("runner", text))
|
|
@@ -783,7 +807,7 @@ function eventLines(event, now, state, line, options) {
|
|
|
783
807
|
function runnerLines(event, state, line, options) {
|
|
784
808
|
switch (event.kind) {
|
|
785
809
|
case "snapshot-reused":
|
|
786
|
-
return [line("runner", snapshotReusedText(event))];
|
|
810
|
+
return [line("runner", snapshotReusedText(event, state.mergeBase))];
|
|
787
811
|
case "snapshot-build-started":
|
|
788
812
|
return snapshotBuildTexts(event).map((text) => line("runner", text));
|
|
789
813
|
case "runner-sandbox-starting":
|
|
@@ -844,21 +868,10 @@ function runnerLines(event, state, line, options) {
|
|
|
844
868
|
];
|
|
845
869
|
case "sandbox-kept":
|
|
846
870
|
return [line("cleanup", `kept the runner sandbox ${event.name} running until ${isoSecondsText(event.stopsAt)}`)];
|
|
847
|
-
// The cleanup line says the run saves a dev snapshot.
|
|
848
|
-
case "dev-snapshot-saving":
|
|
849
|
-
return [];
|
|
850
|
-
case "dev-snapshot-saved":
|
|
851
|
-
case "dev-snapshot-not-saved":
|
|
852
|
-
return [line("cleanup", devSnapshotSaveText(event))];
|
|
853
|
-
case "dev-snapshot-skipped":
|
|
854
|
-
return [line("cleanup", devSnapshotSkippedText(event))];
|
|
855
|
-
case "dev-snapshots-dropped":
|
|
856
|
-
case "dev-snapshots-not-dropped":
|
|
857
|
-
return [line("runner", devSnapshotsDropText(event))];
|
|
858
871
|
}
|
|
859
872
|
}
|
|
860
|
-
function snapshotReusedText(event) {
|
|
861
|
-
return `snapshot ${event.snapshotId}, ${builtAtText({
|
|
873
|
+
function snapshotReusedText(event, mergeBase) {
|
|
874
|
+
return `snapshot ${event.snapshotId}, ${builtAtText({ base: event.base, builtBehind: event.builtBehind, mergeBase })}`;
|
|
862
875
|
}
|
|
863
876
|
function snapshotBuildTexts(event) {
|
|
864
877
|
const building = `building a base snapshot at ${short(event.base)}`;
|
|
@@ -872,37 +885,11 @@ function snapshotBuildTexts(event) {
|
|
|
872
885
|
return [`${building} (${SNAPSHOT_BUILD_REASON_TEXT[why.kind]}); ${tail}`];
|
|
873
886
|
}
|
|
874
887
|
}
|
|
875
|
-
function devSnapshotSkippedText(event) {
|
|
876
|
-
return `no new dev snapshot: ${noSaveText(event.reason)}`;
|
|
877
|
-
}
|
|
878
|
-
function devSnapshotSaveText(event) {
|
|
879
|
-
if (event.kind === "dev-snapshot-saved") {
|
|
880
|
-
return `saved dev snapshot ${event.snapshotId} for ${headText(event.branch)} at ${short(event.head)} in ${seconds(event.ms)} (${megabytesText(event.sizeBytes)})`;
|
|
881
|
-
}
|
|
882
|
-
return `not saving a dev snapshot: ${notSavedReason(event.save)}`;
|
|
883
|
-
}
|
|
884
|
-
function headText(branch) {
|
|
885
|
-
return branch ?? "a detached HEAD";
|
|
886
|
-
}
|
|
887
|
-
function notSavedReason(save) {
|
|
888
|
-
switch (save.kind) {
|
|
889
|
-
case "failed":
|
|
890
|
-
return `the ${save.step === "scrub" ? "scrub" : "save"} failed: ${save.message}`;
|
|
891
|
-
case "stopped":
|
|
892
|
-
return "the run is stopping";
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
888
|
var SNAPSHOT_BUILD_REASON_TEXT = {
|
|
896
889
|
"no-snapshot": "no cached snapshot fits",
|
|
897
890
|
full: "--full",
|
|
898
891
|
base: "the cache has no base snapshot at that commit"
|
|
899
892
|
};
|
|
900
|
-
function devSnapshotsDropText(event) {
|
|
901
|
-
if (event.kind === "dev-snapshots-not-dropped")
|
|
902
|
-
return `couldn't drop a dev snapshot built on the replaced base snapshot from the cache: ${event.message}; a later run may start from it`;
|
|
903
|
-
const count = event.snapshotIds.length;
|
|
904
|
-
return `dropped ${count} dev ${count === 1 ? "snapshot" : "snapshots"} built on the replaced base snapshot from the cache: ${event.snapshotIds.join(", ")}`;
|
|
905
|
-
}
|
|
906
893
|
function releasingText(instances) {
|
|
907
894
|
const release = releaseText(
|
|
908
895
|
instances.map(({ resource }) => resource),
|
|
@@ -915,11 +902,9 @@ function closeFold(state) {
|
|
|
915
902
|
state.folded = false;
|
|
916
903
|
return ["::endgroup::"];
|
|
917
904
|
}
|
|
918
|
-
function cleanupText(
|
|
919
|
-
if (
|
|
920
|
-
|
|
921
|
-
return `saving a dev snapshot of ${headText(sandbox.branch)}${release === void 0 ? "" : ` while ${release}`}\u2026`;
|
|
922
|
-
const sandboxes = sandbox.ms > 0 ? `keeping the runner sandbox running ${keepTimeText(sandbox.ms)}` : "stopping and deleting the runner's sandboxes";
|
|
905
|
+
function cleanupText(keepMs, release) {
|
|
906
|
+
if (keepMs === null) return release === void 0 ? "nothing to release" : `${release}\u2026`;
|
|
907
|
+
const sandboxes = keepMs > 0 ? `keeping the runner sandbox running ${keepTimeText(keepMs)}` : "stopping and deleting the runner's sandboxes";
|
|
923
908
|
return `${sandboxes}${release === void 0 ? "" : `, then ${release}`}\u2026`;
|
|
924
909
|
}
|
|
925
910
|
function commandEnd(outcome) {
|
|
@@ -1141,7 +1126,7 @@ function lanesRecord(state, view) {
|
|
|
1141
1126
|
const snapshot = runner.steps.find(({ name }) => name === "snapshot");
|
|
1142
1127
|
const parts = [
|
|
1143
1128
|
...runner.sandbox === void 0 ? [] : [`${runner.sandbox.name} \xB7 ${runner.sandbox.region} \xB7 ${runner.sandbox.vcpus} vCPU`],
|
|
1144
|
-
...snapshot === void 0 || snapshot.status === "pending" ? [] : [snapshotText(snapshot, runner)],
|
|
1129
|
+
...snapshot === void 0 || snapshot.status === "pending" ? [] : [snapshotText(snapshot, runner, state.base?.sha)],
|
|
1145
1130
|
...runner.status === "failed" || runner.status === "stopped" ? [runner.status] : []
|
|
1146
1131
|
];
|
|
1147
1132
|
lines.push(
|
|
@@ -1158,11 +1143,11 @@ function lanesRecord(state, view) {
|
|
|
1158
1143
|
function runnerGlyph(runner, view) {
|
|
1159
1144
|
return view.glyph(runner.steps.some(({ status }) => status === "failed") ? "failed" : runner.status);
|
|
1160
1145
|
}
|
|
1161
|
-
function snapshotText(step, runner) {
|
|
1146
|
+
function snapshotText(step, runner, mergeBase) {
|
|
1162
1147
|
if (runner.snapshot?.kind === "built") return "snapshot built";
|
|
1163
1148
|
if (runner.snapshot?.kind === "reused") {
|
|
1164
|
-
const {
|
|
1165
|
-
return `snapshot ${builtAtText({
|
|
1149
|
+
const { base, builtBehind } = runner.snapshot;
|
|
1150
|
+
return `snapshot ${builtAtText({ base, builtBehind, mergeBase })}`;
|
|
1166
1151
|
}
|
|
1167
1152
|
return `snapshot build ${step.status === "running" ? "stopped" : step.status}`;
|
|
1168
1153
|
}
|
|
@@ -1283,8 +1268,8 @@ function waitingText(waiting) {
|
|
|
1283
1268
|
function cleanupLine(cleanup, runner, view, record) {
|
|
1284
1269
|
const done = record || cleanup.status !== "running";
|
|
1285
1270
|
const release = releaseText(cleanup.resources, done);
|
|
1286
|
-
const {
|
|
1287
|
-
const text = !done && cleanup.waiting ? `${WAITING_FOR_SNAPSHOT}\u2026` :
|
|
1271
|
+
const { keepMs } = cleanup;
|
|
1272
|
+
const text = !done && cleanup.waiting ? `${WAITING_FOR_SNAPSHOT}\u2026` : keepMs === null ? release ?? "nothing to release" : `${runnerSandboxText(keepMs, runner, done)}${release === void 0 ? "" : `, ${release}`}`;
|
|
1288
1273
|
const leftBehind = cleanupProblems(cleanup);
|
|
1289
1274
|
const ending = done ? leftBehind === 0 ? "" : `: ${leftBehind} left behind` : "\u2026";
|
|
1290
1275
|
return view.row(
|
|
@@ -1292,19 +1277,11 @@ function cleanupLine(cleanup, runner, view, record) {
|
|
|
1292
1277
|
elapsed(view, cleanup.startedAt, cleanup.endedAt)
|
|
1293
1278
|
);
|
|
1294
1279
|
}
|
|
1295
|
-
function runnerSandboxText(
|
|
1280
|
+
function runnerSandboxText(keepMs, runner, done) {
|
|
1296
1281
|
const kept = runner?.kept;
|
|
1297
1282
|
if (kept !== void 0) return `kept the runner sandbox until ${isoSecondsText(kept.stopsAt)}`;
|
|
1298
1283
|
const removed = `${done ? "stopped and deleted" : "stopping and deleting"} the runner sandbox`;
|
|
1299
|
-
|
|
1300
|
-
case "keep":
|
|
1301
|
-
return !done && sandbox.ms > 0 ? `keeping the runner sandbox running ${keepTimeText(sandbox.ms)}` : removed;
|
|
1302
|
-
case "save": {
|
|
1303
|
-
const save = runner?.save;
|
|
1304
|
-
if (save?.kind === "saved") return `saved dev snapshot ${save.id} of ${headText(save.branch)}`;
|
|
1305
|
-
return !done && save?.kind !== "not-saved" ? `saving a dev snapshot of ${headText(sandbox.branch)}` : removed;
|
|
1306
|
-
}
|
|
1307
|
-
}
|
|
1284
|
+
return !done && keepMs > 0 ? `keeping the runner sandbox running ${keepTimeText(keepMs)}` : removed;
|
|
1308
1285
|
}
|
|
1309
1286
|
function statusGlyph(status, now, paint2) {
|
|
1310
1287
|
switch (status) {
|
|
@@ -1465,14 +1442,6 @@ function runnerNoticeLines(event, line) {
|
|
|
1465
1442
|
switch (event.kind) {
|
|
1466
1443
|
case "snapshot-entry-not-written":
|
|
1467
1444
|
return [line("runner", cacheWriteFailureText(event.failure))];
|
|
1468
|
-
case "dev-snapshots-dropped":
|
|
1469
|
-
case "dev-snapshots-not-dropped":
|
|
1470
|
-
return [line("runner", devSnapshotsDropText(event))];
|
|
1471
|
-
case "dev-snapshot-saved":
|
|
1472
|
-
case "dev-snapshot-not-saved":
|
|
1473
|
-
return [line("cleanup", devSnapshotSaveText(event))];
|
|
1474
|
-
case "dev-snapshot-skipped":
|
|
1475
|
-
return [line("cleanup", devSnapshotSkippedText(event))];
|
|
1476
1445
|
// The runner row shows the build; its reasons, when a cached snapshot didn't fit, are lines of their own.
|
|
1477
1446
|
case "snapshot-build-started":
|
|
1478
1447
|
return event.why.kind === "no-snapshot" && event.why.rejected.length > 0 ? snapshotBuildTexts(event).map((text) => line("runner", text)) : [];
|
|
@@ -1494,7 +1463,6 @@ function runnerNoticeLines(event, line) {
|
|
|
1494
1463
|
case "stopping":
|
|
1495
1464
|
case "waiting-for-snapshot":
|
|
1496
1465
|
case "sandbox-kept":
|
|
1497
|
-
case "dev-snapshot-saving":
|
|
1498
1466
|
return [];
|
|
1499
1467
|
}
|
|
1500
1468
|
}
|
|
@@ -1525,7 +1493,7 @@ async function planRun(app, lifecycles, request, planCommand, signal) {
|
|
|
1525
1493
|
}
|
|
1526
1494
|
const merged = settleRunResources(file, request.given);
|
|
1527
1495
|
if (!merged.ok) return merged;
|
|
1528
|
-
const command = await planCommand(where, signal);
|
|
1496
|
+
const command = await planCommand(where, signal, { testPlan: settings.testPlan?.value === true });
|
|
1529
1497
|
if (signal.aborted) return refused(canceledBeforeStart());
|
|
1530
1498
|
if (!command.ok) {
|
|
1531
1499
|
const secrets = [
|
|
@@ -1576,8 +1544,6 @@ var OWN_RUN_FIELDS = {
|
|
|
1576
1544
|
project: z5.string().min(1).optional(),
|
|
1577
1545
|
credential: z5.enum(["mint", "github-actions"]).optional(),
|
|
1578
1546
|
unsandboxed: z5.boolean().default(false),
|
|
1579
|
-
saveDevSnapshot: z5.boolean().optional(),
|
|
1580
|
-
noReuseDevSnapshot: z5.boolean().default(false),
|
|
1581
1547
|
showOutput: z5.boolean().default(false),
|
|
1582
1548
|
keepSandbox: z5.string().optional(),
|
|
1583
1549
|
verbose: z5.boolean().default(false)
|
|
@@ -1639,6 +1605,7 @@ async function runCommand({ app, ui, signal }, request, spec) {
|
|
|
1639
1605
|
});
|
|
1640
1606
|
const observer = recording.observer(view.observer);
|
|
1641
1607
|
const terminal = recording.terminal(view.runnerTerminal);
|
|
1608
|
+
const collected = run.runner !== void 0 || recording.testEvents !== void 0;
|
|
1642
1609
|
let outcome;
|
|
1643
1610
|
try {
|
|
1644
1611
|
const ended = await executeRun(
|
|
@@ -1656,11 +1623,18 @@ async function runCommand({ app, ui, signal }, request, spec) {
|
|
|
1656
1623
|
throw error;
|
|
1657
1624
|
}
|
|
1658
1625
|
sigterm.release();
|
|
1659
|
-
const ran = await summarize(app, {
|
|
1626
|
+
const { timeline: ran, finalResults } = await summarize(app, {
|
|
1627
|
+
command: spec.name,
|
|
1628
|
+
hints: spec.hints,
|
|
1629
|
+
view,
|
|
1630
|
+
recording,
|
|
1631
|
+
outcome
|
|
1632
|
+
});
|
|
1660
1633
|
switch (outcome.kind) {
|
|
1661
1634
|
case "ran": {
|
|
1662
|
-
app.exit.status = commandExitStatus(outcome.command);
|
|
1663
1635
|
const { command } = outcome;
|
|
1636
|
+
const runId = recording.opened.ok ? recording.opened.id : null;
|
|
1637
|
+
app.exit.status = commandExitStatus(outcome.command);
|
|
1664
1638
|
return spec.ran(
|
|
1665
1639
|
{
|
|
1666
1640
|
version: app.version,
|
|
@@ -1672,22 +1646,20 @@ async function runCommand({ app, ui, signal }, request, spec) {
|
|
|
1672
1646
|
runner: outcome.runner === void 0 ? null : {
|
|
1673
1647
|
snapshotId: outcome.runner.snapshotId,
|
|
1674
1648
|
base: outcome.runner.base,
|
|
1675
|
-
|
|
1676
|
-
snapshotHead: outcome.runner.snapshotHead,
|
|
1677
|
-
snapshotKind: outcome.runner.snapshot.kind,
|
|
1678
|
-
snapshotBuiltAt: outcome.runner.snapshot.builtAt,
|
|
1679
|
-
builtBehind: outcome.runner.snapshot.builtBehind,
|
|
1649
|
+
builtBehind: outcome.runner.builtBehind,
|
|
1680
1650
|
uploadBytes: outcome.runner.uploadBytes,
|
|
1681
1651
|
built: outcome.runner.built,
|
|
1682
1652
|
vcpus: outcome.runner.vcpus,
|
|
1683
1653
|
region: outcome.runner.region,
|
|
1684
1654
|
runtime: outcome.runner.runtime,
|
|
1685
|
-
buildMs: outcome.runner.buildMs
|
|
1686
|
-
save: outcome.runner.save,
|
|
1687
|
-
noSaveReason: outcome.runner.noSave
|
|
1655
|
+
buildMs: outcome.runner.buildMs
|
|
1688
1656
|
},
|
|
1689
1657
|
timeline: ran,
|
|
1690
|
-
runId
|
|
1658
|
+
runId,
|
|
1659
|
+
noFinalTestResults: lacksFinalResults(command.kind === "exited" ? command.code : null, {
|
|
1660
|
+
...finalResults,
|
|
1661
|
+
collected
|
|
1662
|
+
})
|
|
1691
1663
|
},
|
|
1692
1664
|
{ testPlan, options: planOptions }
|
|
1693
1665
|
);
|
|
@@ -1727,7 +1699,7 @@ async function runCommand({ app, ui, signal }, request, spec) {
|
|
|
1727
1699
|
}
|
|
1728
1700
|
}
|
|
1729
1701
|
function runProblems(request) {
|
|
1730
|
-
const { credential, unsandboxed,
|
|
1702
|
+
const { credential, unsandboxed, showOutput, keepSandbox } = request;
|
|
1731
1703
|
return [
|
|
1732
1704
|
...resourceFlagProblems(request),
|
|
1733
1705
|
...!unsandboxed && credential === "github-actions" ? [
|
|
@@ -1753,18 +1725,6 @@ function runProblems(request) {
|
|
|
1753
1725
|
field: "keepSandbox",
|
|
1754
1726
|
message: "--keep-sandbox keeps a sandboxed run's runner sandbox; drop it or --unsandboxed."
|
|
1755
1727
|
}
|
|
1756
|
-
] : [],
|
|
1757
|
-
...saveDevSnapshot === true && unsandboxed ? [
|
|
1758
|
-
{
|
|
1759
|
-
field: "saveDevSnapshot",
|
|
1760
|
-
message: "--save-dev-snapshot saves a sandboxed run's runner sandbox; drop it or --unsandboxed."
|
|
1761
|
-
}
|
|
1762
|
-
] : [],
|
|
1763
|
-
...saveDevSnapshot === true && keepsSandbox(keepSandbox) ? [
|
|
1764
|
-
{
|
|
1765
|
-
field: "saveDevSnapshot",
|
|
1766
|
-
message: "--save-dev-snapshot saves the runner sandbox instead of keeping it; drop --keep-sandbox or set it to 0."
|
|
1767
|
-
}
|
|
1768
1728
|
] : []
|
|
1769
1729
|
];
|
|
1770
1730
|
}
|
|
@@ -1779,17 +1739,11 @@ async function runRequestFor(app, options) {
|
|
|
1779
1739
|
};
|
|
1780
1740
|
return { ok: true, run: run2 };
|
|
1781
1741
|
}
|
|
1782
|
-
if (request.saveDevSnapshot && !devSnapshotsTrusted(where.recipe))
|
|
1783
|
-
return {
|
|
1784
|
-
ok: false,
|
|
1785
|
-
refusal: runErrors.devSnapshotsNotTrusted({ flag: "--save-dev-snapshot", configFile })
|
|
1786
|
-
};
|
|
1787
1742
|
const prepared = await prepareRunner(app.context, {
|
|
1788
1743
|
cwd: app.cwd,
|
|
1789
1744
|
recipe: where.recipe,
|
|
1790
1745
|
// The recipe's `vcpus` reads each of the run's resources by its definition: one its `beforeRun` skipped isn't.
|
|
1791
|
-
vcpusRun: recipeRun(recipeResources(used.requests))
|
|
1792
|
-
reuseDevSnapshots: !request.noReuseDevSnapshot && where.recipe.reuseDevSnapshot
|
|
1746
|
+
vcpusRun: recipeRun(recipeResources(used.requests))
|
|
1793
1747
|
});
|
|
1794
1748
|
if (prepared.kind !== "ok") {
|
|
1795
1749
|
const refusal = prepareRefusal(prepared, configFile);
|
|
@@ -1809,7 +1763,6 @@ async function runRequestFor(app, options) {
|
|
|
1809
1763
|
target: where.target,
|
|
1810
1764
|
user: app.user,
|
|
1811
1765
|
secrets: where.secrets,
|
|
1812
|
-
save: saveMode(request, where.recipe, app.env),
|
|
1813
1766
|
keepMs
|
|
1814
1767
|
}
|
|
1815
1768
|
};
|
|
@@ -1865,7 +1818,13 @@ async function summarize(app, run) {
|
|
|
1865
1818
|
]
|
|
1866
1819
|
})
|
|
1867
1820
|
);
|
|
1868
|
-
return
|
|
1821
|
+
return {
|
|
1822
|
+
timeline,
|
|
1823
|
+
finalResults: {
|
|
1824
|
+
finalResults: tests.events.filter((event) => event.kind === "test-result").length,
|
|
1825
|
+
partial: tests.unreadable > 0 || tests.incomplete !== void 0
|
|
1826
|
+
}
|
|
1827
|
+
};
|
|
1869
1828
|
}
|
|
1870
1829
|
function workerClock({ timeline, workerOffsetMs }) {
|
|
1871
1830
|
const tests = timeline.rows.find((row) => row.name === "tests");
|
|
@@ -1901,21 +1860,6 @@ function recipeResources(requests) {
|
|
|
1901
1860
|
})
|
|
1902
1861
|
);
|
|
1903
1862
|
}
|
|
1904
|
-
function keepsSandbox(flag) {
|
|
1905
|
-
return flag !== void 0 && (parseKeepTime(flag) ?? 0) > 0;
|
|
1906
|
-
}
|
|
1907
|
-
function saveMode(request, recipe, env) {
|
|
1908
|
-
const flag = request.saveDevSnapshot;
|
|
1909
|
-
if (flag !== void 0) return flag ? { kind: "always" } : { kind: "never", reason: "no-save-flag" };
|
|
1910
|
-
if (keepsSandbox(request.keepSandbox)) return { kind: "never", reason: "keep-sandbox" };
|
|
1911
|
-
if (recipe.saveDevSnapshot !== void 0)
|
|
1912
|
-
return recipe.saveDevSnapshot ? { kind: "always" } : { kind: "never", reason: "recipe" };
|
|
1913
|
-
if (isCi(env)) return { kind: "never", reason: "ci" };
|
|
1914
|
-
return devSnapshotsTrusted(recipe) ? { kind: "new-head" } : { kind: "never", reason: "not-trusted" };
|
|
1915
|
-
}
|
|
1916
|
-
function runSaveDefault(recipe, env) {
|
|
1917
|
-
return saveMode({}, recipe, env);
|
|
1918
|
-
}
|
|
1919
1863
|
var DEFAULT_KEEP_SANDBOX_MINUTES = 30;
|
|
1920
1864
|
function keepSandboxMinutes(flag, recipe, env) {
|
|
1921
1865
|
const fromFlag = flag === void 0 ? void 0 : parseKeepTime(flag);
|
|
@@ -1969,18 +1913,18 @@ function runnerCleanupLines({ kept, notKept, notStopped, notDeleted }) {
|
|
|
1969
1913
|
}
|
|
1970
1914
|
|
|
1971
1915
|
export {
|
|
1916
|
+
EXEC_HELP,
|
|
1917
|
+
EXEC_HINTS,
|
|
1972
1918
|
notStoppedText,
|
|
1973
1919
|
notDeletedText,
|
|
1974
1920
|
RUN_CLEANUP,
|
|
1975
1921
|
ranSchema,
|
|
1976
1922
|
RAN_DESCRIPTION,
|
|
1977
|
-
|
|
1923
|
+
ranRenderer,
|
|
1978
1924
|
runErrors,
|
|
1979
1925
|
RUN_ERRORS,
|
|
1980
1926
|
outcomes,
|
|
1981
1927
|
lineProgress,
|
|
1982
|
-
progressLine,
|
|
1983
|
-
headText,
|
|
1984
1928
|
canceledBeforeStart,
|
|
1985
1929
|
RUN_REQUEST_FIELDS,
|
|
1986
1930
|
RUN_CLI_OPTIONS,
|
|
@@ -1988,6 +1932,5 @@ export {
|
|
|
1988
1932
|
runProblems,
|
|
1989
1933
|
prepareRefusal,
|
|
1990
1934
|
checkoutFailedRefusal,
|
|
1991
|
-
runSaveDefault,
|
|
1992
1935
|
runnerFailureFacts
|
|
1993
1936
|
};
|