@cnc-tools/storm 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-info.js +1 -1
- package/dist/combine-errors.js +2 -2
- package/dist/commands/dashboard.js +1 -1
- package/dist/commands/{run → exec}/cleanup.d.ts +1 -1
- package/dist/commands/{run → exec}/cleanup.js +1 -1
- package/dist/commands/{run/outcomes.d.ts → exec/command.d.ts} +103 -112
- package/dist/commands/exec/command.js +23 -0
- package/dist/commands/{run → exec}/job-summary.d.ts +5 -1
- package/dist/commands/{run → exec}/job-summary.js +5 -2
- package/dist/commands/{run → exec}/live-view.js +29 -13
- package/dist/commands/exec/metadata.d.ts +69 -0
- package/dist/commands/exec/metadata.js +55 -0
- package/dist/commands/{run → exec}/mint-failed.js +4 -4
- package/dist/commands/exec/outcomes.d.ts +664 -0
- package/dist/commands/exec/outcomes.js +347 -0
- package/dist/commands/{run → exec}/progress.d.ts +14 -2
- package/dist/commands/{run → exec}/progress.js +54 -9
- package/dist/commands/exec/run-command.d.ts +227 -0
- package/dist/commands/exec/run-command.js +696 -0
- package/dist/commands/exec/run-metadata.d.ts +59 -0
- package/dist/commands/exec/run-metadata.js +61 -0
- package/dist/commands/{run → exec}/run-record.d.ts +110 -5
- package/dist/commands/{run → exec}/run-record.js +57 -1
- package/dist/commands/exec/testserver-flags.d.ts +48 -0
- package/dist/commands/exec/testserver-flags.js +80 -0
- package/dist/commands/{run → exec}/view.js +36 -4
- package/dist/commands/runs/facts.d.ts +25 -0
- package/dist/commands/runs/facts.js +38 -5
- package/dist/commands/runs/list/command.d.ts +25 -0
- package/dist/commands/runs/list/outcomes.d.ts +25 -0
- package/dist/commands/runs/logs/metadata.js +1 -1
- package/dist/commands/runs/logs/outcomes.js +4 -1
- package/dist/commands/runs/past-run.d.ts +2 -2
- package/dist/commands/runs/past-run.js +2 -2
- package/dist/commands/runs/show/command.d.ts +25 -0
- package/dist/commands/runs/show/metadata.js +2 -2
- package/dist/commands/runs/show/outcomes.d.ts +25 -0
- package/dist/commands/runs/show/outcomes.js +37 -5
- package/dist/commands/vitest/command.d.ts +325 -0
- package/dist/commands/vitest/command.js +138 -0
- package/dist/commands/vitest/metadata.d.ts +69 -0
- package/dist/commands/vitest/metadata.js +35 -0
- package/dist/commands/vitest/outcomes.d.ts +298 -0
- package/dist/commands/vitest/outcomes.js +77 -0
- package/dist/config/index.d.ts +2 -1
- package/dist/config/index.js +1 -0
- package/dist/config/resolve.d.ts +3 -3
- package/dist/config/resolve.js +3 -3
- package/dist/config/resource-config.d.ts +2 -2
- package/dist/config/schema.d.ts +1 -1
- package/dist/config/set.d.ts +15 -4
- package/dist/config/set.js +28 -12
- package/dist/config-file/define.d.ts +8 -6
- package/dist/context.d.ts +6 -3
- package/dist/context.js +4 -2
- package/dist/core/command-provider.d.ts +1 -1
- package/dist/core/events.d.ts +9 -7
- package/dist/core/presentation.js +1 -1
- package/dist/core/presentations.js +1 -1
- package/dist/core/run-state.d.ts +30 -6
- package/dist/core/run-state.js +19 -4
- package/dist/core/run.d.ts +17 -4
- package/dist/core/run.js +61 -25
- package/dist/resources/testserver/command.d.ts +1 -1
- package/dist/resources/testserver/command.js +1 -1
- package/dist/resources/testserver/config.d.ts +1 -1
- package/dist/resources/testserver/config.js +3 -2
- package/dist/resources/testserver/credential-facts.js +1 -1
- package/dist/resources/testserver/resource.d.ts +2 -2
- package/dist/resources/testserver/sandbox/create.d.ts +2 -2
- package/dist/resources/testserver/sandbox/create.js +2 -2
- package/dist/resources.d.ts +9 -6
- package/dist/resources.js +3 -3
- package/dist/runner/events.d.ts +64 -1
- package/dist/runner/gateways.d.ts +17 -6
- package/dist/runner/index.d.ts +5 -4
- package/dist/runner/index.js +4 -3
- package/dist/runner/live/snapshot-records.js +18 -4
- package/dist/runner/prepare.d.ts +23 -4
- package/dist/runner/prepare.js +13 -3
- package/dist/runner/ready.d.ts +7 -3
- package/dist/runner/ready.js +11 -5
- package/dist/runner/scope.d.ts +17 -1
- package/dist/runner/scope.js +4 -0
- package/dist/runner/snapshot-build.d.ts +3 -1
- package/dist/runner/snapshot-build.js +12 -2
- package/dist/runner/snapshot-cache.d.ts +46 -8
- package/dist/runner/snapshot-cache.js +60 -11
- package/dist/runner/snapshot-key.d.ts +12 -1
- package/dist/runner/snapshot-key.js +17 -1
- package/dist/runner/snapshot-save.d.ts +53 -0
- package/dist/runner/snapshot-save.js +148 -0
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/payload/payload.d.ts +2 -2
- package/dist/sdk/payload/payload.js +2 -2
- package/dist/story/align.d.ts +1 -1
- package/dist/story/align.js +1 -1
- package/dist/story/definition.d.ts +22 -15
- package/dist/story/definition.js +2 -2
- package/dist/story/errors.js +1 -1
- package/dist/story/gateways.d.ts +45 -25
- package/dist/story/gateways.js +2 -2
- package/dist/story/host.d.ts +11 -8
- package/dist/story/host.js +37 -37
- package/dist/story/index.d.ts +1 -1
- package/dist/story/index.js +4 -4
- package/dist/story/json.d.ts +1 -1
- package/dist/story/json.js +2 -2
- package/dist/story/live/recording-gateway.d.ts +2 -0
- package/dist/story/live/{artifact-gateway.js → recording-gateway.js} +33 -12
- package/dist/story/mode.d.ts +2 -2
- package/dist/story/mode.js +1 -1
- package/dist/story/orphans.d.ts +23 -5
- package/dist/story/orphans.js +44 -8
- package/dist/story/recording.d.ts +62 -0
- package/dist/story/{artifact.js → recording.js} +31 -27
- package/dist/story/report.d.ts +21 -9
- package/dist/story/report.js +37 -25
- package/dist/story/settle.d.ts +23 -21
- package/dist/story/settle.js +17 -16
- package/dist/story/{run.d.ts → start.d.ts} +18 -17
- package/dist/story/{run.js → start.js} +66 -43
- package/dist/vercel-cli/driver.d.ts +1 -1
- package/dist/vercel-cli/entry.d.ts +1 -1
- package/dist/vercel-cli/entry.js +1 -1
- package/dist/vercel-cli/verbose.d.ts +2 -2
- package/dist/vercel-cli/verbose.js +2 -2
- package/dist/vitest/config.d.ts +5 -5
- package/dist/vitest/config.js +5 -5
- package/dist/vitest/find-vitest.d.ts +7 -0
- package/dist/vitest/find-vitest.js +28 -0
- package/dist/vitest/fixtures.d.ts +2 -2
- package/dist/vitest/fixtures.js +3 -3
- package/dist/vitest/gateways.d.ts +37 -6
- package/dist/vitest/gateways.js +3 -2
- package/dist/vitest/live/list-gateway.d.ts +7 -3
- package/dist/vitest/live/list-gateway.js +55 -8
- package/dist/vitest/plan.d.ts +41 -8
- package/dist/vitest/plan.js +47 -16
- package/dist/vitest/sandbox.d.ts +1 -1
- package/dist/vitest/sandbox.js +1 -1
- package/dist/vitest/test-events.d.ts +2 -2
- package/dist/vitest/test-events.js +3 -3
- package/dist/vitest/test-results.d.ts +1 -1
- package/dist/vitest/test-results.js +1 -1
- package/dist/vitest/types.d.ts +1 -1
- package/package.json +2 -2
- package/skills/overview.md +5 -4
- package/skills/read-run-output.md +1 -1
- package/dist/commands/run/command.d.ts +0 -327
- package/dist/commands/run/command.js +0 -620
- package/dist/commands/run/metadata.d.ts +0 -47
- package/dist/commands/run/metadata.js +0 -83
- package/dist/commands/run/outcomes.js +0 -332
- package/dist/story/artifact.d.ts +0 -60
- package/dist/story/live/artifact-gateway.d.ts +0 -2
- /package/dist/commands/{run → exec}/live-view.d.ts +0 -0
- /package/dist/commands/{run → exec}/mint-failed.d.ts +0 -0
- /package/dist/commands/{run → exec}/redaction.d.ts +0 -0
- /package/dist/commands/{run → exec}/redaction.js +0 -0
- /package/dist/commands/{run → exec}/run-collector.d.ts +0 -0
- /package/dist/commands/{run → exec}/run-collector.js +0 -0
- /package/dist/commands/{run → exec}/tests-summary.d.ts +0 -0
- /package/dist/commands/{run → exec}/tests-summary.js +0 -0
- /package/dist/commands/{run → exec}/text.d.ts +0 -0
- /package/dist/commands/{run → exec}/text.js +0 -0
- /package/dist/commands/{run → exec}/view.d.ts +0 -0
- /package/dist/commands/{run → exec}/waterfall.d.ts +0 -0
- /package/dist/commands/{run → exec}/waterfall.js +0 -0
- /package/dist/commands/{run → exec}/worker-chart.d.ts +0 -0
- /package/dist/commands/{run → exec}/worker-chart.js +0 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** How `vitest` ends: as `exec` does, its `ran` with the test plan, or refused before the run when counting fails. */
|
|
3
|
+
export declare const outcomes: import("@vercel/clinkr").Outcomes<{
|
|
4
|
+
ran: z.ZodObject<{
|
|
5
|
+
version: z.ZodString;
|
|
6
|
+
commit: z.ZodNullable<z.ZodString>;
|
|
7
|
+
configFile: z.ZodNullable<z.ZodString>;
|
|
8
|
+
resources: z.ZodType<import("../../core/resource.ts").ResourceRanFacts<import("../../resources.ts").Resources>, import("../../core/resource.ts").ResourceRanFacts<import("../../resources.ts").Resources>, z.core.$ZodTypeInternals<import("../../core/resource.ts").ResourceRanFacts<import("../../resources.ts").Resources>, import("../../core/resource.ts").ResourceRanFacts<import("../../resources.ts").Resources>>>;
|
|
9
|
+
cleanup: z.ZodType<import("../exec/cleanup.ts").StormCleanupFacts, import("../exec/cleanup.ts").StormCleanupFacts, z.core.$ZodTypeInternals<import("../exec/cleanup.ts").StormCleanupFacts, import("../exec/cleanup.ts").StormCleanupFacts>>;
|
|
10
|
+
command: z.ZodObject<{
|
|
11
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
12
|
+
signal: z.ZodNullable<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
runner: z.ZodNullable<z.ZodObject<{
|
|
15
|
+
snapshotId: z.ZodString;
|
|
16
|
+
base: z.ZodString;
|
|
17
|
+
snapshotBranch: z.ZodNullable<z.ZodString>;
|
|
18
|
+
snapshotHead: z.ZodNullable<z.ZodString>;
|
|
19
|
+
built: z.ZodBoolean;
|
|
20
|
+
vcpus: z.ZodNumber;
|
|
21
|
+
region: z.ZodString;
|
|
22
|
+
runtime: z.ZodString;
|
|
23
|
+
buildMs: z.ZodNumber;
|
|
24
|
+
save: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
25
|
+
kind: z.ZodLiteral<"saved">;
|
|
26
|
+
snapshotId: z.ZodString;
|
|
27
|
+
base: z.ZodString;
|
|
28
|
+
branch: z.ZodString;
|
|
29
|
+
head: z.ZodString;
|
|
30
|
+
ms: z.ZodNumber;
|
|
31
|
+
sizeBytes: z.ZodNumber;
|
|
32
|
+
entryWritten: z.ZodBoolean;
|
|
33
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
34
|
+
kind: z.ZodLiteral<"skipped">;
|
|
35
|
+
reason: z.ZodLiteral<"detached-head">;
|
|
36
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
37
|
+
kind: z.ZodLiteral<"failed">;
|
|
38
|
+
step: z.ZodEnum<{
|
|
39
|
+
"save-snapshot": "save-snapshot";
|
|
40
|
+
scrub: "scrub";
|
|
41
|
+
}>;
|
|
42
|
+
message: z.ZodString;
|
|
43
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
44
|
+
kind: z.ZodLiteral<"stopped">;
|
|
45
|
+
}, z.core.$strip>], "kind">>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
timeline: z.ZodObject<{
|
|
48
|
+
startedAt: z.ZodString;
|
|
49
|
+
totalMs: z.ZodNumber;
|
|
50
|
+
rows: z.ZodArray<z.ZodObject<{
|
|
51
|
+
name: z.ZodEnum<{
|
|
52
|
+
cleanup: "cleanup";
|
|
53
|
+
mint: "mint";
|
|
54
|
+
runner: "runner";
|
|
55
|
+
tests: "tests";
|
|
56
|
+
testserver: "testserver";
|
|
57
|
+
}>;
|
|
58
|
+
startMs: z.ZodNumber;
|
|
59
|
+
endMs: z.ZodNumber;
|
|
60
|
+
outcome: z.ZodEnum<{
|
|
61
|
+
done: "done";
|
|
62
|
+
failed: "failed";
|
|
63
|
+
stopped: "stopped";
|
|
64
|
+
unfinished: "unfinished";
|
|
65
|
+
}>;
|
|
66
|
+
steps: z.ZodArray<z.ZodObject<{
|
|
67
|
+
name: z.ZodEnum<{
|
|
68
|
+
[x: string]: string;
|
|
69
|
+
}>;
|
|
70
|
+
startMs: z.ZodNumber;
|
|
71
|
+
endMs: z.ZodNumber;
|
|
72
|
+
outcome: z.ZodEnum<{
|
|
73
|
+
done: "done";
|
|
74
|
+
failed: "failed";
|
|
75
|
+
stopped: "stopped";
|
|
76
|
+
unfinished: "unfinished";
|
|
77
|
+
}>;
|
|
78
|
+
}, z.core.$strip>>;
|
|
79
|
+
idleMs: z.ZodNumber;
|
|
80
|
+
snapshot: z.ZodOptional<z.ZodEnum<{
|
|
81
|
+
built: "built";
|
|
82
|
+
reused: "reused";
|
|
83
|
+
}>>;
|
|
84
|
+
sandboxes: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
reused: z.ZodNumber;
|
|
86
|
+
created: z.ZodNumber;
|
|
87
|
+
}, z.core.$strip>>;
|
|
88
|
+
}, z.core.$strip>>;
|
|
89
|
+
criticalPath: z.ZodArray<z.ZodEnum<{
|
|
90
|
+
cleanup: "cleanup";
|
|
91
|
+
mint: "mint";
|
|
92
|
+
runner: "runner";
|
|
93
|
+
tests: "tests";
|
|
94
|
+
testserver: "testserver";
|
|
95
|
+
}>>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
runId: z.ZodNullable<z.ZodString>;
|
|
98
|
+
plan: z.ZodObject<{
|
|
99
|
+
tests: z.ZodNumber;
|
|
100
|
+
files: z.ZodNumber;
|
|
101
|
+
sandboxes: z.ZodNullable<z.ZodNumber>;
|
|
102
|
+
sandboxesFrom: z.ZodNullable<z.ZodEnum<{
|
|
103
|
+
auto: "auto";
|
|
104
|
+
file: "file";
|
|
105
|
+
flag: "flag";
|
|
106
|
+
}>>;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
}, {
|
|
110
|
+
ran: unknown;
|
|
111
|
+
}, {
|
|
112
|
+
noMatchingTests: z.ZodObject<{
|
|
113
|
+
args: z.ZodArray<z.ZodString>;
|
|
114
|
+
cwd: z.ZodString;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
vitestListFailed: z.ZodObject<{
|
|
117
|
+
args: z.ZodArray<z.ZodString>;
|
|
118
|
+
cwd: z.ZodString;
|
|
119
|
+
kind: z.ZodEnum<{
|
|
120
|
+
exited: "exited";
|
|
121
|
+
"start-failed": "start-failed";
|
|
122
|
+
"timed-out": "timed-out";
|
|
123
|
+
"unreadable-output": "unreadable-output";
|
|
124
|
+
}>;
|
|
125
|
+
message: z.ZodString;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
credentialRejected: import("@vercel/clinkr").SharedError<"credential_rejected", [{
|
|
128
|
+
origin: {
|
|
129
|
+
source: "mint";
|
|
130
|
+
team: string;
|
|
131
|
+
project: string;
|
|
132
|
+
} | {
|
|
133
|
+
source: "github-actions";
|
|
134
|
+
claims: {
|
|
135
|
+
aud: string;
|
|
136
|
+
repository: string;
|
|
137
|
+
} | null;
|
|
138
|
+
};
|
|
139
|
+
fix: string;
|
|
140
|
+
status: number;
|
|
141
|
+
vercelId: string | null;
|
|
142
|
+
ttlMinutes: number;
|
|
143
|
+
failedCreates: {
|
|
144
|
+
kind: "connect-failed" | "dropped" | "http-error" | "malformed" | "stream-ended" | "stream-error" | "timeout";
|
|
145
|
+
detail: string | null;
|
|
146
|
+
}[];
|
|
147
|
+
unpooled: {
|
|
148
|
+
testserverUrl: string;
|
|
149
|
+
path: string;
|
|
150
|
+
message: string;
|
|
151
|
+
}[];
|
|
152
|
+
sandboxMayExist: boolean;
|
|
153
|
+
} & {
|
|
154
|
+
readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
|
|
155
|
+
}]>;
|
|
156
|
+
credentialUnused: import("@vercel/clinkr").SharedError<"credential_unused", [data: {
|
|
157
|
+
flags: string[];
|
|
158
|
+
configFile: string | null;
|
|
159
|
+
}]>;
|
|
160
|
+
githubFixtureRepoUnavailable: import("@vercel/clinkr").SharedError<"github_fixture_repo_unavailable", [{
|
|
161
|
+
repo: string;
|
|
162
|
+
status: number | null;
|
|
163
|
+
message: string;
|
|
164
|
+
} & {
|
|
165
|
+
readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
|
|
166
|
+
}]>;
|
|
167
|
+
githubTokenMissing: import("@vercel/clinkr").SharedError<"github_token_missing", [data: {
|
|
168
|
+
tokenEnv: string;
|
|
169
|
+
repo: string;
|
|
170
|
+
configFile: string | null;
|
|
171
|
+
requiredBy: "config" | "set";
|
|
172
|
+
}]>;
|
|
173
|
+
invalidConfig: import("@vercel/clinkr").SharedError<"invalid_config", [data: {
|
|
174
|
+
file: string;
|
|
175
|
+
problems: {
|
|
176
|
+
key: string | null;
|
|
177
|
+
location: {
|
|
178
|
+
line: number;
|
|
179
|
+
column: number | null;
|
|
180
|
+
} | null;
|
|
181
|
+
problem: string;
|
|
182
|
+
}[];
|
|
183
|
+
}]>;
|
|
184
|
+
invalidResourceOptions: import("@vercel/clinkr").SharedError<"invalid_resource_options", [data: {
|
|
185
|
+
configFile: string | null;
|
|
186
|
+
problems: {
|
|
187
|
+
key: string;
|
|
188
|
+
problem: string;
|
|
189
|
+
values: {
|
|
190
|
+
key: string;
|
|
191
|
+
value: string;
|
|
192
|
+
source: "default" | "file" | "flag";
|
|
193
|
+
}[];
|
|
194
|
+
}[];
|
|
195
|
+
}]>;
|
|
196
|
+
mintFailed: import("@vercel/clinkr").SharedError<"mint_failed", [data: {
|
|
197
|
+
team: string;
|
|
198
|
+
project: string;
|
|
199
|
+
cause: string;
|
|
200
|
+
fix: string;
|
|
201
|
+
runner: boolean;
|
|
202
|
+
cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
|
|
203
|
+
}]>;
|
|
204
|
+
missingRunner: import("@vercel/clinkr").SharedError<"missing_runner", [data: {
|
|
205
|
+
configFile: string | null;
|
|
206
|
+
}]>;
|
|
207
|
+
missingTarget: import("@vercel/clinkr").SharedError<"missing_target", [data: {
|
|
208
|
+
missing: ("project" | "scope")[];
|
|
209
|
+
}]>;
|
|
210
|
+
noBaseRef: import("@vercel/clinkr").SharedError<"no_base_ref", [data: {
|
|
211
|
+
refs: {
|
|
212
|
+
ref: string;
|
|
213
|
+
reason: "missing" | "unrelated";
|
|
214
|
+
}[];
|
|
215
|
+
}]>;
|
|
216
|
+
noSandboxes: import("@vercel/clinkr").SharedError<"no_sandboxes", [{
|
|
217
|
+
requested: number;
|
|
218
|
+
ttlMinutes: number;
|
|
219
|
+
failedCreates: {
|
|
220
|
+
kind: "connect-failed" | "dropped" | "http-error" | "malformed" | "stream-ended" | "stream-error" | "timeout";
|
|
221
|
+
detail: string | null;
|
|
222
|
+
}[];
|
|
223
|
+
sandboxMayExist: boolean;
|
|
224
|
+
} & {
|
|
225
|
+
readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
|
|
226
|
+
}]>;
|
|
227
|
+
noUsableSandboxes: import("@vercel/clinkr").SharedError<"no_usable_sandboxes", [{
|
|
228
|
+
requested: number;
|
|
229
|
+
build: string;
|
|
230
|
+
} & {
|
|
231
|
+
readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
|
|
232
|
+
}]>;
|
|
233
|
+
poolUnavailable: import("@vercel/clinkr").SharedError<"pool_unavailable", [data: {
|
|
234
|
+
path: string;
|
|
235
|
+
message: string;
|
|
236
|
+
}]>;
|
|
237
|
+
poolUnreadable: import("@vercel/clinkr").SharedError<"pool_unreadable", [{
|
|
238
|
+
path: string;
|
|
239
|
+
message: string;
|
|
240
|
+
} & {
|
|
241
|
+
readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
|
|
242
|
+
}]>;
|
|
243
|
+
runnerFailed: import("@vercel/clinkr").SharedError<"runner_failed", [data: {
|
|
244
|
+
failure: {
|
|
245
|
+
kind: "apply-failed" | "build-failed" | "install-failed" | "snapshot-build-step-failed";
|
|
246
|
+
label: string;
|
|
247
|
+
exitCode: number | null;
|
|
248
|
+
tail: string[];
|
|
249
|
+
} | {
|
|
250
|
+
kind: "sandbox-api-failed";
|
|
251
|
+
operation: string;
|
|
252
|
+
status: number | null;
|
|
253
|
+
message: string;
|
|
254
|
+
} | {
|
|
255
|
+
kind: "checkout-failed";
|
|
256
|
+
message: string;
|
|
257
|
+
command: string | null;
|
|
258
|
+
} | {
|
|
259
|
+
kind: "credential-claims-missing";
|
|
260
|
+
team: string;
|
|
261
|
+
project: string;
|
|
262
|
+
};
|
|
263
|
+
cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
|
|
264
|
+
}]>;
|
|
265
|
+
snapshotGone: import("@vercel/clinkr").SharedError<"snapshot_gone", [data: {
|
|
266
|
+
snapshotId: string;
|
|
267
|
+
base: string;
|
|
268
|
+
removal: {
|
|
269
|
+
path: string;
|
|
270
|
+
message: string;
|
|
271
|
+
} | null;
|
|
272
|
+
cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
|
|
273
|
+
}]>;
|
|
274
|
+
spawnFailed: import("@vercel/clinkr").SharedError<"spawn_failed", [data: {
|
|
275
|
+
executable: string;
|
|
276
|
+
message: string;
|
|
277
|
+
cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
|
|
278
|
+
}]>;
|
|
279
|
+
submodulesRefused: import("@vercel/clinkr").SharedError<"submodules_refused", [data: {
|
|
280
|
+
paths: string[];
|
|
281
|
+
}]>;
|
|
282
|
+
tokenRequestFailed: import("@vercel/clinkr").SharedError<"token_request_failed", [{
|
|
283
|
+
cause: "request-failed" | "variables-missing";
|
|
284
|
+
missing: ("ACTIONS_ID_TOKEN_REQUEST_TOKEN" | "ACTIONS_ID_TOKEN_REQUEST_URL")[] | null;
|
|
285
|
+
status: number | null;
|
|
286
|
+
said: string | null;
|
|
287
|
+
detail: string;
|
|
288
|
+
fix: string;
|
|
289
|
+
ttlMinutes: number;
|
|
290
|
+
failedCreates: {
|
|
291
|
+
kind: "connect-failed" | "dropped" | "http-error" | "malformed" | "stream-ended" | "stream-error" | "timeout";
|
|
292
|
+
detail: string | null;
|
|
293
|
+
}[];
|
|
294
|
+
sandboxMayExist: boolean;
|
|
295
|
+
} & {
|
|
296
|
+
readonly cleanup: import("../exec/cleanup.ts").StormCleanupFacts;
|
|
297
|
+
}]>;
|
|
298
|
+
}>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { defineOutcomes } from "@vercel/clinkr";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { RAN_DESCRIPTION, RUN_ERRORS, ranSchema, renderRan } from "../exec/outcomes.js";
|
|
4
|
+
/** What `vitest list` counted before the run, and the Testserver sandbox count the run asked for. */
|
|
5
|
+
const planSchema = z.object({
|
|
6
|
+
/** How many tests `vitest list --json <args>` counted. */
|
|
7
|
+
tests: z.number(),
|
|
8
|
+
/** How many distinct test files they are in. */
|
|
9
|
+
files: z.number(),
|
|
10
|
+
/** How many Testserver sandboxes the run asked for; null without a Testserver side. */
|
|
11
|
+
sandboxes: z.number().nullable(),
|
|
12
|
+
/** Where that count came from: `--testserver-sandboxes` (`flag`), `resources.testserverPool.sandboxes` in storm.config.ts (`file`), or one per 4 test files, at most 8 (`auto`); null without a Testserver side. */
|
|
13
|
+
sandboxesFrom: z.enum(["flag", "file", "auto"]).nullable(),
|
|
14
|
+
});
|
|
15
|
+
/** Where `vitest list` ran and what it was given, which both refusals report. */
|
|
16
|
+
const listedShape = {
|
|
17
|
+
/** The arguments given to `vitest run`, which `vitest list --json` was given too. */
|
|
18
|
+
args: z.array(z.string()),
|
|
19
|
+
/** The directory `vitest list` ran in, on this machine. */
|
|
20
|
+
cwd: z.string(),
|
|
21
|
+
};
|
|
22
|
+
/** How `vitest` ends: as `exec` does, its `ran` with the test plan, or refused before the run when counting fails. */
|
|
23
|
+
export const outcomes = defineOutcomes({
|
|
24
|
+
results: {
|
|
25
|
+
ran: {
|
|
26
|
+
schema: ranSchema.extend({
|
|
27
|
+
/** The test plan: what `vitest list` counted before the run, and how many Testserver sandboxes the run asked for and why. */
|
|
28
|
+
plan: planSchema,
|
|
29
|
+
}),
|
|
30
|
+
description: RAN_DESCRIPTION,
|
|
31
|
+
render: renderRan,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
errors: {
|
|
35
|
+
...RUN_ERRORS,
|
|
36
|
+
noMatchingTests: {
|
|
37
|
+
exitCode: 1,
|
|
38
|
+
description: "vitest list found no test for the arguments given to vitest run, so nothing was minted, leased or started.",
|
|
39
|
+
schema: z.object(listedShape),
|
|
40
|
+
render: ({ args, cwd }) => ({
|
|
41
|
+
message: `vitest list found no test for vitest run ${argsText(args)} in ${cwd}. The command didn't run.`,
|
|
42
|
+
next: [
|
|
43
|
+
{
|
|
44
|
+
type: "text",
|
|
45
|
+
text: `Change the arguments given to vitest run (${argsText(args)}), then retry. Put vitest's own dash options after --.`,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
50
|
+
vitestListFailed: {
|
|
51
|
+
exitCode: 1,
|
|
52
|
+
description: "storm couldn't count the tests before the run: vitest wasn't found or failed to start, didn't finish within 60s, exited other than 0, or printed something other than a list of tests. Nothing was minted, leased or started.",
|
|
53
|
+
schema: z.object({
|
|
54
|
+
/** How listing failed: vitest wasn't found or couldn't start (`start-failed`), didn't finish (`timed-out`), exited other than 0 (`exited`), or printed something other than a list of tests (`unreadable-output`). */
|
|
55
|
+
kind: z.enum(["start-failed", "timed-out", "exited", "unreadable-output"]),
|
|
56
|
+
/** What went wrong, such as the directories searched for vitest, or the last line of vitest's stderr. */
|
|
57
|
+
message: z.string(),
|
|
58
|
+
...listedShape,
|
|
59
|
+
}),
|
|
60
|
+
render: ({ kind, message, cwd }) => ({
|
|
61
|
+
message: `Couldn't count the tests in ${cwd}: ${/[.!?]$/.test(message) ? message : `${message}.`} The command didn't run.`,
|
|
62
|
+
next: [{ type: "text", text: LIST_FAILED_NEXT[kind] }],
|
|
63
|
+
}),
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
/** The arguments as a person reads them: `(none)` when there are none. */
|
|
68
|
+
function argsText(args) {
|
|
69
|
+
return args.length === 0 ? "(none)" : args.join(" ");
|
|
70
|
+
}
|
|
71
|
+
/** What to do about each kind of listing failure. */
|
|
72
|
+
const LIST_FAILED_NEXT = {
|
|
73
|
+
"start-failed": "Install vitest in the package, or run the command with storm exec, which counts nothing.",
|
|
74
|
+
"timed-out": "Check why vitest list doesn't finish, such as a global setup that waits, then retry.",
|
|
75
|
+
exited: "Fix what vitest list reports, then retry. vitest list takes the arguments vitest run does, but refuses some run-only options.",
|
|
76
|
+
"unreadable-output": "Check that the package's vitest prints its list with --json, then retry.",
|
|
77
|
+
};
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { givenOptionsOf } from "./by-name.ts";
|
|
1
2
|
export { configErrors, configProblemLine, optionProblemLine } from "./errors.ts";
|
|
2
3
|
export type { ConfigGateway, ConfigImport, ConfigLocation } from "./gateways.ts";
|
|
3
4
|
export { liveConfigGateway } from "./live/config-gateway.ts";
|
|
@@ -5,5 +6,5 @@ export { type ConfigProblem, type ConfigValues, findConfigFile, type LoadedConfi
|
|
|
5
6
|
export { type AnyResourceConfig, type GivenOptions, type GivenResources, optionKeyPath, type OptionOf, type OptionProblem, type OptionRule, type OptionRules, type OptionSettings, type OptionsResolution, readBooleanText, readTextAsIs, readWholeNumberText, type ResolvedOf, type ResolvedResources, type ResourceConfig, type ResourceFactory, type Setting, type SettingSource, type SettingsOf, } from "./resource-config.ts";
|
|
6
7
|
export { mergeResourceOptions, type ResolvedSettings, resolveResourceOptions, resolveSettings, type ResourceOptionProblem, type ResourceOptionsResolution, type SettingFlags, } from "./resolve.ts";
|
|
7
8
|
export { type Checked, checkBoolean, type CheckedSettings, checkNonEmptyString, CONFIG_FILE_NAME, CONFIG_SETTING_KEYS, type ConfigKey, type ConfigSettingKey, type ConfigSettings, describeValue, type SettingValue, type ValueProblem, wrongValue, } from "./schema.ts";
|
|
8
|
-
export { parseSetFlags, type SetFlagsParse, setKeyPaths } from "./set.ts";
|
|
9
|
+
export { type OwnFlags, parseSetFlags, type SetFlagsParse, setKeyPaths } from "./set.ts";
|
|
9
10
|
export { fileOptions, fileSettings, invalidConfig, invalidResourceOptions, loadSettingsFile, type SettingsFile, settleResourceOptions, } from "./settings-file.ts";
|
package/dist/config/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// configs a caller passes in, reading `--set` against them, and resolving each top-level setting and each held
|
|
3
3
|
// resource's options. It names no resource. Each resource folder imports the resource config vocabulary to declare its
|
|
4
4
|
// own section; the composition layer passes the registry's resource configs in.
|
|
5
|
+
export { givenOptionsOf } from "./by-name.js";
|
|
5
6
|
export { configErrors, configProblemLine, optionProblemLine } from "./errors.js";
|
|
6
7
|
export { liveConfigGateway } from "./live/config-gateway.js";
|
|
7
8
|
export { findConfigFile, loadConfig } from "./load.js";
|
package/dist/config/resolve.d.ts
CHANGED
|
@@ -42,8 +42,8 @@ export type ResourceOptionsResolution<T> = {
|
|
|
42
42
|
*/
|
|
43
43
|
export declare function mergeResourceOptions<C extends AnyResourceConfig>(config: C, file: GivenOptions<C> | undefined, flags: GivenOptions<C> | undefined): ResourceOptionsResolution<SettingsOf<C>>;
|
|
44
44
|
/**
|
|
45
|
-
* The resolved options of each resource the run holds, by name: one the file has, or one
|
|
46
|
-
* of. Each is merged (`mergeResourceOptions`) and
|
|
47
|
-
* against each other. Every problem of every held resource is returned at once, in config order.
|
|
45
|
+
* The resolved options of each resource the run holds, by name: one the file has, or one the flags (`sets`: each
|
|
46
|
+
* `--set`, and a command's own flag for an option) give an option of. Each is merged (`mergeResourceOptions`) and
|
|
47
|
+
* then resolved by its config's `resolve`, which checks its options against each other. Every problem of every held resource is returned at once, in config order.
|
|
48
48
|
*/
|
|
49
49
|
export declare function resolveResourceOptions<Configs extends readonly AnyResourceConfig[]>(configs: Configs, file: GivenResources<Configs> | undefined, sets: GivenResources<Configs>): ResourceOptionsResolution<ResolvedResources<Configs>>;
|
package/dist/config/resolve.js
CHANGED
|
@@ -52,9 +52,9 @@ export function mergeResourceOptions(config, file, flags) {
|
|
|
52
52
|
return { ok: true, value: merged };
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
|
-
* The resolved options of each resource the run holds, by name: one the file has, or one
|
|
56
|
-
* of. Each is merged (`mergeResourceOptions`) and
|
|
57
|
-
* against each other. Every problem of every held resource is returned at once, in config order.
|
|
55
|
+
* The resolved options of each resource the run holds, by name: one the file has, or one the flags (`sets`: each
|
|
56
|
+
* `--set`, and a command's own flag for an option) give an option of. Each is merged (`mergeResourceOptions`) and
|
|
57
|
+
* then resolved by its config's `resolve`, which checks its options against each other. Every problem of every held resource is returned at once, in config order.
|
|
58
58
|
*/
|
|
59
59
|
export function resolveResourceOptions(configs, file, sets) {
|
|
60
60
|
const fromFile = file ?? {};
|
|
@@ -9,10 +9,10 @@ export interface Setting<T> {
|
|
|
9
9
|
/**
|
|
10
10
|
* How one resource option is checked, read from `--set` text and defaulted.
|
|
11
11
|
*
|
|
12
|
-
* - `check`: the option's rule, for a value from the file
|
|
12
|
+
* - `check`: the option's rule, for a value from the file, from `--set` once read, or from a command's own flag.
|
|
13
13
|
* - `readText`: a `--set` value's text as the value `check` reads, such as a whole number or a boolean. Text that
|
|
14
14
|
* doesn't read as its kind is passed on as text, which `check` refuses by name.
|
|
15
|
-
* - `default`: the value when neither the file nor a
|
|
15
|
+
* - `default`: the value when neither the file nor a flag gives one.
|
|
16
16
|
* - `required`: a resource held without this option is a problem.
|
|
17
17
|
*/
|
|
18
18
|
export interface OptionRule<T> {
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface ConfigSettings {
|
|
|
11
11
|
readonly scope?: string;
|
|
12
12
|
/** The control plane project (`--project`), which a runner run also mints for. */
|
|
13
13
|
readonly project?: string;
|
|
14
|
-
/** The runner recipe: what
|
|
14
|
+
/** The runner recipe: what a run runs its command in, unless `--local`. Only a runner run reads it. */
|
|
15
15
|
readonly runner?: RunnerRecipe;
|
|
16
16
|
}
|
|
17
17
|
/** A top-level setting's name. */
|
package/dist/config/set.d.ts
CHANGED
|
@@ -7,10 +7,21 @@ export type SetFlagsParse<Configs extends readonly AnyResourceConfig[]> = {
|
|
|
7
7
|
readonly ok: false;
|
|
8
8
|
readonly problems: readonly string[];
|
|
9
9
|
};
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The options a command gives their own flags, by key path, such as `resources.<name>.<option>`, with each flag's
|
|
12
|
+
* spelling, such as `--<name>-<option>`. `--set` takes none of them: one option has one spelling on the command line.
|
|
13
|
+
*/
|
|
14
|
+
export interface OwnFlags {
|
|
15
|
+
readonly [keyPath: string]: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The key paths `--set` takes, such as `resources.<name>.<option>`, in config order, then option order: every option of
|
|
19
|
+
* `configs` but those in `ownFlags`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function setKeyPaths(configs: readonly AnyResourceConfig[], ownFlags?: OwnFlags): readonly string[];
|
|
12
22
|
/**
|
|
13
23
|
* Reads each `--set <key path>=<value>` in `texts` against `configs`. Each problem names the `--set` as given: one
|
|
14
|
-
* without `=`, a key path
|
|
24
|
+
* without `=`, a key path with its own flag in `ownFlags`, which it names, a key path `--set` doesn't take, a key path
|
|
25
|
+
* given twice, or a value its option's rule refuses.
|
|
15
26
|
*/
|
|
16
|
-
export declare function parseSetFlags<Configs extends readonly AnyResourceConfig[]>(texts: readonly string[], configs: Configs): SetFlagsParse<Configs>;
|
|
27
|
+
export declare function parseSetFlags<Configs extends readonly AnyResourceConfig[]>(texts: readonly string[], configs: Configs, ownFlags?: OwnFlags): SetFlagsParse<Configs>;
|
package/dist/config/set.js
CHANGED
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
// `--set <key path>=<value>`: a resource's option given on the command line by its key path in `storm.config.ts`,
|
|
2
|
-
// `resources.<name>.<option>`. Every option of every resource config passed in takes one
|
|
3
|
-
// its
|
|
4
|
-
//
|
|
2
|
+
// `resources.<name>.<option>`. Every option of every resource config passed in takes one, but an option the command
|
|
3
|
+
// gives its own flag (`OwnFlags`), which `--set` refuses by naming that flag. Each value is text, read by its option's
|
|
4
|
+
// rule (`readText`) and then checked by the rule, as a value from the file would be. The values come back by resource,
|
|
5
|
+
// then by option.
|
|
5
6
|
import { givenResourcesByName } from "./by-name.js";
|
|
6
7
|
import { optionKeyPath } from "./resource-config.js";
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Each key path `--set` takes, with the option it names, in config order, then option order: every option of
|
|
10
|
+
* `configs` but those in `ownFlags`.
|
|
11
|
+
*/
|
|
12
|
+
function setTargets(configs, ownFlags) {
|
|
13
|
+
return configs.flatMap((config) => Object.entries(config.options).flatMap(([option, rule]) => {
|
|
14
|
+
const path = optionKeyPath(config.name, option);
|
|
15
|
+
return Object.hasOwn(ownFlags, path) ? [] : [[path, { resource: config.name, option, rule }]];
|
|
16
|
+
}));
|
|
10
17
|
}
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
/**
|
|
19
|
+
* The key paths `--set` takes, such as `resources.<name>.<option>`, in config order, then option order: every option of
|
|
20
|
+
* `configs` but those in `ownFlags`.
|
|
21
|
+
*/
|
|
22
|
+
export function setKeyPaths(configs, ownFlags = {}) {
|
|
23
|
+
return setTargets(configs, ownFlags).map(([path]) => path);
|
|
14
24
|
}
|
|
15
25
|
/**
|
|
16
26
|
* Reads each `--set <key path>=<value>` in `texts` against `configs`. Each problem names the `--set` as given: one
|
|
17
|
-
* without `=`, a key path
|
|
27
|
+
* without `=`, a key path with its own flag in `ownFlags`, which it names, a key path `--set` doesn't take, a key path
|
|
28
|
+
* given twice, or a value its option's rule refuses.
|
|
18
29
|
*/
|
|
19
|
-
export function parseSetFlags(texts, configs) {
|
|
20
|
-
const targets = setTargets(configs);
|
|
30
|
+
export function parseSetFlags(texts, configs, ownFlags = {}) {
|
|
31
|
+
const targets = setTargets(configs, ownFlags);
|
|
21
32
|
const byPath = new Map(targets);
|
|
22
33
|
const paths = targets.map(([path]) => path);
|
|
23
34
|
const values = {};
|
|
@@ -30,6 +41,11 @@ export function parseSetFlags(texts, configs) {
|
|
|
30
41
|
continue;
|
|
31
42
|
}
|
|
32
43
|
const path = text.slice(0, equals);
|
|
44
|
+
const flag = Object.hasOwn(ownFlags, path) ? ownFlags[path] : undefined;
|
|
45
|
+
if (flag !== undefined) {
|
|
46
|
+
problems.push(`--set ${path} has its own flag; use ${flag}`);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
33
49
|
const target = byPath.get(path);
|
|
34
50
|
if (target === undefined) {
|
|
35
51
|
problems.push(paths.length === 0
|
|
@@ -5,8 +5,10 @@ export { pnpmToolchains } from "./toolchain.ts";
|
|
|
5
5
|
export type { RunnerRecipe, RunnerResources, RunnerStep, RunnerStepContext, RunnerSteps } from "../runner/index.ts";
|
|
6
6
|
/**
|
|
7
7
|
* The resources a run holds for its command, each made by its own factory. Without one, a run holds nothing beside
|
|
8
|
-
* its command. `storm
|
|
9
|
-
*
|
|
8
|
+
* its command. `storm vitest` and `storm exec` set any resource's option for one run, and gives the run that resource when the file
|
|
9
|
+
* has none: the Testserver pool resource's with its own flags (`--testserver-sandboxes`, `--testserver-build`,
|
|
10
|
+
* `--testserver-min-time-left`, `--testserver-ttl`, `--testserver-no-create`), any other's with
|
|
11
|
+
* `--set resources.<name>.<option>=<value>`.
|
|
10
12
|
*/
|
|
11
13
|
export interface StormResources {
|
|
12
14
|
/**
|
|
@@ -17,19 +19,19 @@ export interface StormResources {
|
|
|
17
19
|
/**
|
|
18
20
|
* The GitHub fixture repository resource, from `githubFixtureRepo()` in `@cnc-tools/storm/github`: one standing
|
|
19
21
|
* GitHub repository, a token for it and a run prefix, handed to the command, whose branches under the run prefix the
|
|
20
|
-
* run deletes once the command has stopped. Only
|
|
22
|
+
* run deletes once the command has stopped. Only a run, `vitest`'s or `exec`'s, reads it.
|
|
21
23
|
*/
|
|
22
24
|
readonly githubFixtureRepo?: GitHubFixtureRepoResource;
|
|
23
25
|
}
|
|
24
26
|
/**
|
|
25
27
|
* What a `storm.config.ts` can give: the top-level settings, and the resources a run holds. A flag (`--scope`,
|
|
26
|
-
* `--project`, or `--set` for
|
|
28
|
+
* `--project`, a `--testserver-*` flag, or `--set` for another resource's option) overrides the file, and the file overrides the built-in default.
|
|
27
29
|
* storm checks the whole file whenever a command loads it.
|
|
28
30
|
*/
|
|
29
31
|
export interface StormConfig extends ConfigSettings {
|
|
30
32
|
/**
|
|
31
|
-
* The resources a run holds. Without `resources.testserverPool`, and without a `--
|
|
32
|
-
*
|
|
33
|
+
* The resources a run holds. Without `resources.testserverPool`, and without a `--testserver-*` flag,
|
|
34
|
+
* a run holds no Testserver sandbox: it runs the command with a run payload that names none.
|
|
33
35
|
*/
|
|
34
36
|
readonly resources?: StormResources;
|
|
35
37
|
}
|
package/dist/context.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { type RESOURCE_CONFIGS, type StormResourceGateways } from "./resources.t
|
|
|
5
5
|
import { type CommandGateway, type JobSummaryGateway, type ProgressTerminal, type RunDirectoryGateway } from "./core/index.ts";
|
|
6
6
|
import { type CheckoutGateway, type RunnerSandboxGateway, type RunnerSnapshotCacheGateway, type RunnerTerminal } from "./runner/index.ts";
|
|
7
7
|
import { type Clock, type Timer } from "./time/index.ts";
|
|
8
|
+
import { type VitestListGateway } from "./vitest/plan.ts";
|
|
8
9
|
/**
|
|
9
10
|
* The gateways and DI seams storm's commands reach the world through, beside the resources' own
|
|
10
11
|
* (`StormContext`).
|
|
@@ -29,6 +30,8 @@ export interface StormCoreContext {
|
|
|
29
30
|
readonly progressTerminal: ProgressTerminal;
|
|
30
31
|
/** The GitHub Actions job summary a run appends its summary to, in a step that has one. */
|
|
31
32
|
readonly jobSummary: JobSummaryGateway;
|
|
33
|
+
/** vitest on this machine, which `storm vitest` finds and counts the tests with before a run starts. */
|
|
34
|
+
readonly vitestList: VitestListGateway;
|
|
32
35
|
readonly timer: Timer;
|
|
33
36
|
readonly clock: Clock;
|
|
34
37
|
}
|
|
@@ -39,7 +42,7 @@ export interface StormCoreContext {
|
|
|
39
42
|
export type StormContext = StormCoreContext & StormResourceGateways;
|
|
40
43
|
/**
|
|
41
44
|
* Where a command records the status the process exits with, past Clinkr's: a Clinkr handler's result exits only
|
|
42
|
-
* 0 or 1, so
|
|
45
|
+
* 0 or 1, so a run, `exec`'s or `vitest`'s, records its command's code (or `128 + n` for a signal) here, and `bin/storm.ts` exits with
|
|
43
46
|
* it when it is set.
|
|
44
47
|
*/
|
|
45
48
|
export interface StormExit {
|
|
@@ -76,8 +79,8 @@ export interface StormApp {
|
|
|
76
79
|
* real process; `storm.config.ts` imported by Node; for a runner run, git and tar on the local checkout, the
|
|
77
80
|
* runner snapshot cache under `env`'s `XDG_STATE_HOME` or `HOME`, Vercel Sandbox through `@vercel/sandbox` (loaded
|
|
78
81
|
* only when a runner run first calls it) and this process's stdout and stderr; the run directories beside the runner
|
|
79
|
-
* snapshot cache; the live view on this process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any;
|
|
80
|
-
* system timer and clock; and each resource's own live gateways, which its folder builds from `env`. When `env` names
|
|
82
|
+
* snapshot cache; the live view on this process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any;
|
|
83
|
+
* `vitest` found in `node_modules/.bin` and spawned as a real process; the system timer and clock; and each resource's own live gateways, which its folder builds from `env`. When `env` names
|
|
81
84
|
* no place for the state directory, every runner snapshot cache operation fails and says why, which a run treats as an
|
|
82
85
|
* empty cache, and so does opening a run directory, which a run goes on without.
|
|
83
86
|
*/
|
package/dist/context.js
CHANGED
|
@@ -6,14 +6,15 @@ import { liveResourceGateways } from "./resources.js";
|
|
|
6
6
|
import { liveCommandGateway, liveJobSummaryGateway, liveProgressTerminal, liveRunDirectoryGateway, resolveStateDirectory, RUNS_SUBPATH, stateDirectoryPattern, unavailableRunDirectoryGateway, } from "./core/index.js";
|
|
7
7
|
import { liveCheckoutGateway, liveRunnerSandboxGateway, liveRunnerSnapshotCacheGateway, liveRunnerTerminal, RUNNER_SNAPSHOTS_SUBPATH, unavailableRunnerSnapshotCacheGateway, } from "./runner/index.js";
|
|
8
8
|
import { systemClock, systemTimer } from "./time/index.js";
|
|
9
|
+
import { liveVitestListGateway } from "./vitest/plan.js";
|
|
9
10
|
/**
|
|
10
11
|
* The live Context: `vercel` for credentials, and for `--credential github-actions` GitHub Actions' token request, read
|
|
11
12
|
* from `env`'s `ACTIONS_ID_TOKEN_REQUEST_*` at each request, with a 10-second timeout; a run's command spawned as a
|
|
12
13
|
* real process; `storm.config.ts` imported by Node; for a runner run, git and tar on the local checkout, the
|
|
13
14
|
* runner snapshot cache under `env`'s `XDG_STATE_HOME` or `HOME`, Vercel Sandbox through `@vercel/sandbox` (loaded
|
|
14
15
|
* only when a runner run first calls it) and this process's stdout and stderr; the run directories beside the runner
|
|
15
|
-
* snapshot cache; the live view on this process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any;
|
|
16
|
-
* system timer and clock; and each resource's own live gateways, which its folder builds from `env`. When `env` names
|
|
16
|
+
* snapshot cache; the live view on this process's stderr; the job summary `GITHUB_STEP_SUMMARY` names, if any;
|
|
17
|
+
* `vitest` found in `node_modules/.bin` and spawned as a real process; the system timer and clock; and each resource's own live gateways, which its folder builds from `env`. When `env` names
|
|
17
18
|
* no place for the state directory, every runner snapshot cache operation fails and says why, which a run treats as an
|
|
18
19
|
* empty cache, and so does opening a run directory, which a run goes on without.
|
|
19
20
|
*/
|
|
@@ -37,6 +38,7 @@ export function liveContext(options) {
|
|
|
37
38
|
: unavailableRunDirectoryGateway(stateDirectoryPattern(RUNS_SUBPATH), runs.reason),
|
|
38
39
|
progressTerminal: liveProgressTerminal(),
|
|
39
40
|
jobSummary: liveJobSummaryGateway({ path: options.env["GITHUB_STEP_SUMMARY"] }),
|
|
41
|
+
vitestList: liveVitestListGateway,
|
|
40
42
|
timer: systemTimer,
|
|
41
43
|
clock: systemClock,
|
|
42
44
|
};
|