@cnc-tools/storm 0.0.0-stage → 0.5.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/bin/node-version.js +24 -0
- package/bin/storm.js +16 -0
- package/dist/application.d.ts +13 -0
- package/dist/application.js +23 -0
- package/dist/bin/storm.d.ts +1 -0
- package/dist/bin/storm.js +45 -0
- package/dist/build-info.js +3 -0
- package/dist/closed-terminal.d.ts +7 -0
- package/dist/closed-terminal.js +18 -0
- package/dist/combine-errors.d.ts +11 -0
- package/dist/combine-errors.js +19 -0
- package/dist/commands/dashboard.d.ts +11 -0
- package/dist/commands/dashboard.js +18 -0
- package/dist/commands/run/cleanup.d.ts +135 -0
- package/dist/commands/run/cleanup.js +171 -0
- package/dist/commands/run/command.d.ts +327 -0
- package/dist/commands/run/command.js +620 -0
- package/dist/commands/run/job-summary.d.ts +6 -0
- package/dist/commands/run/job-summary.js +31 -0
- package/dist/commands/run/live-view.d.ts +22 -0
- package/dist/commands/run/live-view.js +395 -0
- package/dist/commands/run/metadata.d.ts +47 -0
- package/dist/commands/run/metadata.js +83 -0
- package/dist/commands/run/mint-failed.d.ts +11 -0
- package/dist/commands/run/mint-failed.js +33 -0
- package/dist/commands/run/outcomes.d.ts +307 -0
- package/dist/commands/run/outcomes.js +332 -0
- package/dist/commands/run/progress.d.ts +44 -0
- package/dist/commands/run/progress.js +277 -0
- package/dist/commands/run/redaction.d.ts +15 -0
- package/dist/commands/run/redaction.js +40 -0
- package/dist/commands/run/run-collector.d.ts +30 -0
- package/dist/commands/run/run-collector.js +73 -0
- package/dist/commands/run/run-record.d.ts +144 -0
- package/dist/commands/run/run-record.js +96 -0
- package/dist/commands/run/tests-summary.d.ts +34 -0
- package/dist/commands/run/tests-summary.js +141 -0
- package/dist/commands/run/text.d.ts +22 -0
- package/dist/commands/run/text.js +74 -0
- package/dist/commands/run/view.d.ts +35 -0
- package/dist/commands/run/view.js +163 -0
- package/dist/commands/run/waterfall.d.ts +25 -0
- package/dist/commands/run/waterfall.js +108 -0
- package/dist/commands/run/worker-chart.d.ts +79 -0
- package/dist/commands/run/worker-chart.js +313 -0
- package/dist/commands/runs/facts.d.ts +150 -0
- package/dist/commands/runs/facts.js +292 -0
- package/dist/commands/runs/list/command.d.ts +86 -0
- package/dist/commands/runs/list/command.js +36 -0
- package/dist/commands/runs/list/metadata.d.ts +22 -0
- package/dist/commands/runs/list/metadata.js +19 -0
- package/dist/commands/runs/list/outcomes.d.ts +74 -0
- package/dist/commands/runs/list/outcomes.js +89 -0
- package/dist/commands/runs/logs/command.d.ts +72 -0
- package/dist/commands/runs/logs/command.js +51 -0
- package/dist/commands/runs/logs/metadata.d.ts +22 -0
- package/dist/commands/runs/logs/metadata.js +22 -0
- package/dist/commands/runs/logs/outcomes.d.ts +55 -0
- package/dist/commands/runs/logs/outcomes.js +77 -0
- package/dist/commands/runs/metadata.d.ts +3 -0
- package/dist/commands/runs/metadata.js +3 -0
- package/dist/commands/runs/past-run.d.ts +72 -0
- package/dist/commands/runs/past-run.js +99 -0
- package/dist/commands/runs/show/command.d.ts +176 -0
- package/dist/commands/runs/show/command.js +76 -0
- package/dist/commands/runs/show/metadata.d.ts +25 -0
- package/dist/commands/runs/show/metadata.js +22 -0
- package/dist/commands/runs/show/outcomes.d.ts +164 -0
- package/dist/commands/runs/show/outcomes.js +317 -0
- package/dist/config/by-name.d.ts +24 -0
- package/dist/config/by-name.js +26 -0
- package/dist/config/errors.d.ts +58 -0
- package/dist/config/errors.js +101 -0
- package/dist/config/gateways.d.ts +32 -0
- package/dist/config/gateways.js +1 -0
- package/dist/config/index.d.ts +9 -0
- package/dist/config/index.js +12 -0
- package/dist/config/live/config-gateway.d.ts +6 -0
- package/dist/config/live/config-gateway.js +71 -0
- package/dist/config/load.d.ts +54 -0
- package/dist/config/load.js +175 -0
- package/dist/config/resolve.d.ts +49 -0
- package/dist/config/resolve.js +94 -0
- package/dist/config/resource-config.d.ts +132 -0
- package/dist/config/resource-config.js +19 -0
- package/dist/config/schema.d.ts +64 -0
- package/dist/config/schema.js +57 -0
- package/dist/config/set.d.ts +16 -0
- package/dist/config/set.js +55 -0
- package/dist/config/settings-file.d.ts +41 -0
- package/dist/config/settings-file.js +72 -0
- package/dist/config-file/define.d.ts +37 -0
- package/dist/config-file/define.js +9 -0
- package/dist/config-file/toolchain.d.ts +9 -0
- package/dist/config-file/toolchain.js +41 -0
- package/dist/context.d.ts +86 -0
- package/dist/context.js +43 -0
- package/dist/core/command-provider.d.ts +126 -0
- package/dist/core/command-provider.js +13 -0
- package/dist/core/command-slots.d.ts +67 -0
- package/dist/core/command-slots.js +136 -0
- package/dist/core/events.d.ts +128 -0
- package/dist/core/events.js +15 -0
- package/dist/core/gateways.d.ts +249 -0
- package/dist/core/gateways.js +1 -0
- package/dist/core/index.d.ts +20 -0
- package/dist/core/index.js +18 -0
- package/dist/core/keyed.d.ts +12 -0
- package/dist/core/keyed.js +24 -0
- package/dist/core/lane.d.ts +46 -0
- package/dist/core/lane.js +5 -0
- package/dist/core/limit.d.ts +9 -0
- package/dist/core/limit.js +29 -0
- package/dist/core/live/command-gateway.d.ts +11 -0
- package/dist/core/live/command-gateway.js +83 -0
- package/dist/core/live/job-summary-gateway.d.ts +5 -0
- package/dist/core/live/job-summary-gateway.js +20 -0
- package/dist/core/live/progress-terminal.d.ts +20 -0
- package/dist/core/live/progress-terminal.js +173 -0
- package/dist/core/live/run-directory-gateway.d.ts +24 -0
- package/dist/core/live/run-directory-gateway.js +437 -0
- package/dist/core/mint.d.ts +10 -0
- package/dist/core/mint.js +14 -0
- package/dist/core/payload.d.ts +26 -0
- package/dist/core/payload.js +33 -0
- package/dist/core/presentation.d.ts +87 -0
- package/dist/core/presentation.js +5 -0
- package/dist/core/presentations.d.ts +56 -0
- package/dist/core/presentations.js +66 -0
- package/dist/core/provider.d.ts +69 -0
- package/dist/core/provider.js +5 -0
- package/dist/core/resource.d.ts +262 -0
- package/dist/core/resource.js +6 -0
- package/dist/core/resources.d.ts +131 -0
- package/dist/core/resources.js +254 -0
- package/dist/core/run-directory.d.ts +69 -0
- package/dist/core/run-directory.js +94 -0
- package/dist/core/run-state.d.ts +152 -0
- package/dist/core/run-state.js +313 -0
- package/dist/core/run.d.ts +187 -0
- package/dist/core/run.js +321 -0
- package/dist/core/state-directory.d.ts +19 -0
- package/dist/core/state-directory.js +29 -0
- package/dist/core/timeline.d.ts +63 -0
- package/dist/core/timeline.js +97 -0
- package/dist/core/timing.d.ts +22 -0
- package/dist/core/timing.js +26 -0
- package/dist/credential/credential.d.ts +46 -0
- package/dist/credential/credential.js +80 -0
- package/dist/credential/diagnosis.d.ts +18 -0
- package/dist/credential/diagnosis.js +99 -0
- package/dist/credential/gateways.d.ts +109 -0
- package/dist/credential/gateways.js +1 -0
- package/dist/credential/index.d.ts +7 -0
- package/dist/credential/index.js +7 -0
- package/dist/credential/live/github-actions-token-gateway.d.ts +15 -0
- package/dist/credential/live/github-actions-token-gateway.js +43 -0
- package/dist/credential/live/github-actions-token-response.d.ts +19 -0
- package/dist/credential/live/github-actions-token-response.js +49 -0
- package/dist/credential/live/vercel-cli-gateway.d.ts +9 -0
- package/dist/credential/live/vercel-cli-gateway.js +64 -0
- package/dist/credential/live/vercel-output.d.ts +60 -0
- package/dist/credential/live/vercel-output.js +122 -0
- package/dist/credential/live/vercel-process.d.ts +14 -0
- package/dist/credential/live/vercel-process.js +3 -0
- package/dist/credential/settle.d.ts +31 -0
- package/dist/credential/settle.js +49 -0
- package/dist/credential/source.d.ts +110 -0
- package/dist/credential/source.js +114 -0
- package/dist/help-logo.d.ts +11 -0
- package/dist/help-logo.js +56 -0
- package/dist/presentation.d.ts +26 -0
- package/dist/presentation.js +21 -0
- package/dist/resources/github/cleanup.d.ts +23 -0
- package/dist/resources/github/cleanup.js +39 -0
- package/dist/resources/github/command.d.ts +74 -0
- package/dist/resources/github/command.js +117 -0
- package/dist/resources/github/config.d.ts +16 -0
- package/dist/resources/github/config.js +37 -0
- package/dist/resources/github/events.d.ts +26 -0
- package/dist/resources/github/events.js +2 -0
- package/dist/resources/github/fixture-repo.d.ts +69 -0
- package/dist/resources/github/fixture-repo.js +60 -0
- package/dist/resources/github/gateways.d.ts +62 -0
- package/dist/resources/github/gateways.js +1 -0
- package/dist/resources/github/index.d.ts +12 -0
- package/dist/resources/github/index.js +15 -0
- package/dist/resources/github/live/fixture-repo-gateway.d.ts +12 -0
- package/dist/resources/github/live/fixture-repo-gateway.js +92 -0
- package/dist/resources/github/live/gateways.d.ts +6 -0
- package/dist/resources/github/live/gateways.js +13 -0
- package/dist/resources/github/presentation.d.ts +13 -0
- package/dist/resources/github/presentation.js +43 -0
- package/dist/resources/github/provider.d.ts +66 -0
- package/dist/resources/github/provider.js +58 -0
- package/dist/resources/github/resource-provider.d.ts +6 -0
- package/dist/resources/github/resource-provider.js +20 -0
- package/dist/resources/github/resource.d.ts +33 -0
- package/dist/resources/github/resource.js +12 -0
- package/dist/resources/testserver/cleanup.d.ts +14 -0
- package/dist/resources/testserver/cleanup.js +22 -0
- package/dist/resources/testserver/command.d.ts +322 -0
- package/dist/resources/testserver/command.js +245 -0
- package/dist/resources/testserver/commands/app.d.ts +18 -0
- package/dist/resources/testserver/commands/app.js +3 -0
- package/dist/resources/testserver/commands/create/command.d.ts +136 -0
- package/dist/resources/testserver/commands/create/command.js +158 -0
- package/dist/resources/testserver/commands/create/metadata.d.ts +31 -0
- package/dist/resources/testserver/commands/create/metadata.js +45 -0
- package/dist/resources/testserver/commands/create/outcomes.d.ts +111 -0
- package/dist/resources/testserver/commands/create/outcomes.js +172 -0
- package/dist/resources/testserver/commands/list/command.d.ts +60 -0
- package/dist/resources/testserver/commands/list/command.js +56 -0
- package/dist/resources/testserver/commands/list/metadata.d.ts +9 -0
- package/dist/resources/testserver/commands/list/metadata.js +9 -0
- package/dist/resources/testserver/commands/list/outcomes.d.ts +54 -0
- package/dist/resources/testserver/commands/list/outcomes.js +152 -0
- package/dist/resources/testserver/config.d.ts +18 -0
- package/dist/resources/testserver/config.js +77 -0
- package/dist/resources/testserver/credential-facts.d.ts +80 -0
- package/dist/resources/testserver/credential-facts.js +83 -0
- package/dist/resources/testserver/events.d.ts +59 -0
- package/dist/resources/testserver/events.js +4 -0
- package/dist/resources/testserver/index.d.ts +16 -0
- package/dist/resources/testserver/index.js +24 -0
- package/dist/resources/testserver/lane.d.ts +28 -0
- package/dist/resources/testserver/lane.js +139 -0
- package/dist/resources/testserver/live/gateways.d.ts +6 -0
- package/dist/resources/testserver/live/gateways.js +26 -0
- package/dist/resources/testserver/options.d.ts +5 -0
- package/dist/resources/testserver/options.js +5 -0
- package/dist/resources/testserver/pool/channels.d.ts +80 -0
- package/dist/resources/testserver/pool/channels.js +48 -0
- package/dist/resources/testserver/pool/create.d.ts +48 -0
- package/dist/resources/testserver/pool/create.js +45 -0
- package/dist/resources/testserver/pool/directory.d.ts +4 -0
- package/dist/resources/testserver/pool/directory.js +5 -0
- package/dist/resources/testserver/pool/gateways.d.ts +190 -0
- package/dist/resources/testserver/pool/gateways.js +1 -0
- package/dist/resources/testserver/pool/host.d.ts +8 -0
- package/dist/resources/testserver/pool/host.js +21 -0
- package/dist/resources/testserver/pool/index.d.ts +9 -0
- package/dist/resources/testserver/pool/index.js +10 -0
- package/dist/resources/testserver/pool/inspect.d.ts +53 -0
- package/dist/resources/testserver/pool/inspect.js +45 -0
- package/dist/resources/testserver/pool/lease.d.ts +84 -0
- package/dist/resources/testserver/pool/lease.js +125 -0
- package/dist/resources/testserver/pool/live/pool-records.d.ts +17 -0
- package/dist/resources/testserver/pool/live/pool-records.js +70 -0
- package/dist/resources/testserver/pool/live/pool-store-gateway.d.ts +12 -0
- package/dist/resources/testserver/pool/live/pool-store-gateway.js +435 -0
- package/dist/resources/testserver/pool/staleness.d.ts +16 -0
- package/dist/resources/testserver/pool/staleness.js +27 -0
- package/dist/resources/testserver/presentation.d.ts +9 -0
- package/dist/resources/testserver/presentation.js +217 -0
- package/dist/resources/testserver/provider.d.ts +177 -0
- package/dist/resources/testserver/provider.js +254 -0
- package/dist/resources/testserver/ran.d.ts +87 -0
- package/dist/resources/testserver/ran.js +140 -0
- package/dist/resources/testserver/resource-provider.d.ts +12 -0
- package/dist/resources/testserver/resource-provider.js +38 -0
- package/dist/resources/testserver/resource.d.ts +32 -0
- package/dist/resources/testserver/resource.js +10 -0
- package/dist/resources/testserver/run-sandbox.d.ts +13 -0
- package/dist/resources/testserver/run-sandbox.js +6 -0
- package/dist/resources/testserver/sandbox/channels.d.ts +12 -0
- package/dist/resources/testserver/sandbox/channels.js +21 -0
- package/dist/resources/testserver/sandbox/create-failure.d.ts +35 -0
- package/dist/resources/testserver/sandbox/create-failure.js +65 -0
- package/dist/resources/testserver/sandbox/create.d.ts +29 -0
- package/dist/resources/testserver/sandbox/create.js +37 -0
- package/dist/resources/testserver/sandbox/gateways.d.ts +150 -0
- package/dist/resources/testserver/sandbox/gateways.js +1 -0
- package/dist/resources/testserver/sandbox/index.d.ts +6 -0
- package/dist/resources/testserver/sandbox/index.js +7 -0
- package/dist/resources/testserver/sandbox/live/builds-response.d.ts +9 -0
- package/dist/resources/testserver/sandbox/live/builds-response.js +27 -0
- package/dist/resources/testserver/sandbox/live/control-plane-gateway.d.ts +17 -0
- package/dist/resources/testserver/sandbox/live/control-plane-gateway.js +133 -0
- package/dist/resources/testserver/sandbox/live/create-response.d.ts +35 -0
- package/dist/resources/testserver/sandbox/live/create-response.js +78 -0
- package/dist/resources/testserver/sandbox/live/fetch-failure.d.ts +24 -0
- package/dist/resources/testserver/sandbox/live/fetch-failure.js +45 -0
- package/dist/resources/testserver/sandbox/live/health-check-gateway.d.ts +11 -0
- package/dist/resources/testserver/sandbox/live/health-check-gateway.js +36 -0
- package/dist/resources/testserver/sandbox/live/sse.d.ts +12 -0
- package/dist/resources/testserver/sandbox/live/sse.js +32 -0
- package/dist/resources.d.ts +452 -0
- package/dist/resources.js +88 -0
- package/dist/runner/base.d.ts +40 -0
- package/dist/runner/base.js +52 -0
- package/dist/runner/context.d.ts +13 -0
- package/dist/runner/context.js +9 -0
- package/dist/runner/events.d.ts +179 -0
- package/dist/runner/events.js +16 -0
- package/dist/runner/gateways.d.ts +351 -0
- package/dist/runner/gateways.js +3 -0
- package/dist/runner/index.d.ts +19 -0
- package/dist/runner/index.js +18 -0
- package/dist/runner/live/checkout-gateway.d.ts +3 -0
- package/dist/runner/live/checkout-gateway.js +206 -0
- package/dist/runner/live/git-output.d.ts +14 -0
- package/dist/runner/live/git-output.js +32 -0
- package/dist/runner/live/sandbox-errors.d.ts +7 -0
- package/dist/runner/live/sandbox-errors.js +21 -0
- package/dist/runner/live/sandbox-gateway.d.ts +7 -0
- package/dist/runner/live/sandbox-gateway.js +427 -0
- package/dist/runner/live/snapshot-cache-gateway.d.ts +12 -0
- package/dist/runner/live/snapshot-cache-gateway.js +104 -0
- package/dist/runner/live/snapshot-records.d.ts +11 -0
- package/dist/runner/live/snapshot-records.js +57 -0
- package/dist/runner/live/terminal.d.ts +16 -0
- package/dist/runner/live/terminal.js +37 -0
- package/dist/runner/live/user.d.ts +2 -0
- package/dist/runner/live/user.js +11 -0
- package/dist/runner/output.d.ts +23 -0
- package/dist/runner/output.js +58 -0
- package/dist/runner/prepare.d.ts +67 -0
- package/dist/runner/prepare.js +59 -0
- package/dist/runner/ready.d.ts +68 -0
- package/dist/runner/ready.js +159 -0
- package/dist/runner/recipe.d.ts +126 -0
- package/dist/runner/recipe.js +302 -0
- package/dist/runner/remote-command.d.ts +77 -0
- package/dist/runner/remote-command.js +127 -0
- package/dist/runner/scope.d.ts +58 -0
- package/dist/runner/scope.js +117 -0
- package/dist/runner/snapshot-build.d.ts +33 -0
- package/dist/runner/snapshot-build.js +112 -0
- package/dist/runner/snapshot-cache.d.ts +84 -0
- package/dist/runner/snapshot-cache.js +126 -0
- package/dist/runner/snapshot-key.d.ts +52 -0
- package/dist/runner/snapshot-key.js +91 -0
- package/dist/runner/steps.d.ts +41 -0
- package/dist/runner/steps.js +49 -0
- package/dist/sdk/container/api-request.d.ts +32 -0
- package/dist/sdk/container/api-request.js +46 -0
- package/dist/sdk/container/container.d.ts +144 -0
- package/dist/sdk/container/container.js +346 -0
- package/dist/sdk/container/feature-flags.d.ts +37 -0
- package/dist/sdk/container/feature-flags.js +118 -0
- package/dist/sdk/container/gateways.d.ts +108 -0
- package/dist/sdk/container/gateways.js +1 -0
- package/dist/sdk/container/index.d.ts +5 -0
- package/dist/sdk/container/index.js +5 -0
- package/dist/sdk/container/live/container-gateway.d.ts +17 -0
- package/dist/sdk/container/live/container-gateway.js +114 -0
- package/dist/sdk/factories/build.d.ts +66 -0
- package/dist/sdk/factories/build.js +98 -0
- package/dist/sdk/factories/definition.d.ts +28 -0
- package/dist/sdk/factories/definition.js +16 -0
- package/dist/sdk/factories/definitions.d.ts +166 -0
- package/dist/sdk/factories/definitions.js +235 -0
- package/dist/sdk/factories/gateways.d.ts +25 -0
- package/dist/sdk/factories/gateways.js +1 -0
- package/dist/sdk/factories/index.d.ts +5 -0
- package/dist/sdk/factories/index.js +5 -0
- package/dist/sdk/factories/live/factory-gateway.d.ts +10 -0
- package/dist/sdk/factories/live/factory-gateway.js +29 -0
- package/dist/sdk/index.d.ts +7 -0
- package/dist/sdk/index.js +15 -0
- package/dist/sdk/payload/index.d.ts +2 -0
- package/dist/sdk/payload/index.js +4 -0
- package/dist/sdk/payload/payload.d.ts +47 -0
- package/dist/sdk/payload/payload.js +74 -0
- package/dist/sdk/payload/test-events.d.ts +102 -0
- package/dist/sdk/payload/test-events.js +59 -0
- package/dist/sdk/proxy/exchange.d.ts +58 -0
- package/dist/sdk/proxy/exchange.js +173 -0
- package/dist/sdk/proxy/faulted-exchange.d.ts +10 -0
- package/dist/sdk/proxy/faulted-exchange.js +106 -0
- package/dist/sdk/proxy/faults.d.ts +133 -0
- package/dist/sdk/proxy/faults.js +147 -0
- package/dist/sdk/proxy/index.d.ts +3 -0
- package/dist/sdk/proxy/index.js +3 -0
- package/dist/sdk/proxy/proxy.d.ts +93 -0
- package/dist/sdk/proxy/proxy.js +99 -0
- package/dist/sdk/proxy/records.d.ts +56 -0
- package/dist/sdk/proxy/records.js +56 -0
- package/dist/sdk/records/body.d.ts +89 -0
- package/dist/sdk/records/body.js +236 -0
- package/dist/sdk/records/index.d.ts +2 -0
- package/dist/sdk/records/index.js +4 -0
- package/dist/sdk/records/records.d.ts +49 -0
- package/dist/sdk/records/records.js +16 -0
- package/dist/sdk/seed/index.d.ts +1 -0
- package/dist/sdk/seed/index.js +3 -0
- package/dist/sdk/seed/seed.d.ts +221 -0
- package/dist/sdk/seed/seed.js +171 -0
- package/dist/sdk/testserver/clock.d.ts +8 -0
- package/dist/sdk/testserver/clock.js +10 -0
- package/dist/sdk/testserver/failure.d.ts +73 -0
- package/dist/sdk/testserver/failure.js +61 -0
- package/dist/sdk/testserver/index.d.ts +5 -0
- package/dist/sdk/testserver/index.js +8 -0
- package/dist/sdk/testserver/live/connect-failure.d.ts +7 -0
- package/dist/sdk/testserver/live/connect-failure.js +30 -0
- package/dist/sdk/testserver/live/request.d.ts +69 -0
- package/dist/sdk/testserver/live/request.js +89 -0
- package/dist/sdk/testserver/service-ids.d.ts +19 -0
- package/dist/sdk/testserver/service-ids.js +77 -0
- package/dist/sdk/testserver/test-id.d.ts +15 -0
- package/dist/sdk/testserver/test-id.js +28 -0
- package/dist/story/align.d.ts +37 -0
- package/dist/story/align.js +39 -0
- package/dist/story/artifact.d.ts +60 -0
- package/dist/story/artifact.js +93 -0
- package/dist/story/definition.d.ts +52 -0
- package/dist/story/definition.js +9 -0
- package/dist/story/diff.d.ts +9 -0
- package/dist/story/diff.js +97 -0
- package/dist/story/errors.d.ts +14 -0
- package/dist/story/errors.js +21 -0
- package/dist/story/gateways.d.ts +74 -0
- package/dist/story/gateways.js +3 -0
- package/dist/story/host.d.ts +27 -0
- package/dist/story/host.js +97 -0
- package/dist/story/index.d.ts +7 -0
- package/dist/story/index.js +9 -0
- package/dist/story/json.d.ts +16 -0
- package/dist/story/json.js +59 -0
- package/dist/story/live/artifact-gateway.d.ts +2 -0
- package/dist/story/live/artifact-gateway.js +82 -0
- package/dist/story/mode.d.ts +17 -0
- package/dist/story/mode.js +21 -0
- package/dist/story/orphans.d.ts +17 -0
- package/dist/story/orphans.js +15 -0
- package/dist/story/report.d.ts +30 -0
- package/dist/story/report.js +118 -0
- package/dist/story/run.d.ts +49 -0
- package/dist/story/run.js +160 -0
- package/dist/story/sequence.d.ts +30 -0
- package/dist/story/sequence.js +74 -0
- package/dist/story/settle.d.ts +94 -0
- package/dist/story/settle.js +70 -0
- package/dist/time/duration.d.ts +19 -0
- package/dist/time/duration.js +37 -0
- package/dist/time/index.d.ts +2 -0
- package/dist/time/index.js +4 -0
- package/dist/time/time.d.ts +15 -0
- package/dist/time/time.js +23 -0
- package/dist/vercel-cli/ansi.d.ts +13 -0
- package/dist/vercel-cli/ansi.js +32 -0
- package/dist/vercel-cli/arguments.d.ts +25 -0
- package/dist/vercel-cli/arguments.js +78 -0
- package/dist/vercel-cli/auth-config.d.ts +43 -0
- package/dist/vercel-cli/auth-config.js +36 -0
- package/dist/vercel-cli/clock.d.ts +9 -0
- package/dist/vercel-cli/clock.js +10 -0
- package/dist/vercel-cli/config-files.d.ts +24 -0
- package/dist/vercel-cli/config-files.js +40 -0
- package/dist/vercel-cli/context.d.ts +12 -0
- package/dist/vercel-cli/context.js +12 -0
- package/dist/vercel-cli/driver.d.ts +218 -0
- package/dist/vercel-cli/driver.js +364 -0
- package/dist/vercel-cli/entry.d.ts +8 -0
- package/dist/vercel-cli/entry.js +13 -0
- package/dist/vercel-cli/environment.d.ts +33 -0
- package/dist/vercel-cli/environment.js +72 -0
- package/dist/vercel-cli/errors.d.ts +8 -0
- package/dist/vercel-cli/errors.js +8 -0
- package/dist/vercel-cli/gateways.d.ts +103 -0
- package/dist/vercel-cli/gateways.js +4 -0
- package/dist/vercel-cli/index.d.ts +10 -0
- package/dist/vercel-cli/index.js +15 -0
- package/dist/vercel-cli/invocation.d.ts +234 -0
- package/dist/vercel-cli/invocation.js +397 -0
- package/dist/vercel-cli/keys.d.ts +14 -0
- package/dist/vercel-cli/keys.js +12 -0
- package/dist/vercel-cli/live/config-files.d.ts +28 -0
- package/dist/vercel-cli/live/config-files.js +66 -0
- package/dist/vercel-cli/live/process-gateway.d.ts +14 -0
- package/dist/vercel-cli/live/process-gateway.js +178 -0
- package/dist/vercel-cli/redaction.d.ts +13 -0
- package/dist/vercel-cli/redaction.js +22 -0
- package/dist/vercel-cli/report.d.ts +22 -0
- package/dist/vercel-cli/report.js +110 -0
- package/dist/vercel-cli/verbose.d.ts +7 -0
- package/dist/vercel-cli/verbose.js +24 -0
- package/dist/version.d.ts +20 -0
- package/dist/version.js +57 -0
- package/dist/vitest/config.d.ts +51 -0
- package/dist/vitest/config.js +61 -0
- package/dist/vitest/container-scope.d.ts +108 -0
- package/dist/vitest/container-scope.js +234 -0
- package/dist/vitest/diagnostics.d.ts +146 -0
- package/dist/vitest/diagnostics.js +306 -0
- package/dist/vitest/fixtures.d.ts +64 -0
- package/dist/vitest/fixtures.js +172 -0
- package/dist/vitest/gateways.d.ts +47 -0
- package/dist/vitest/gateways.js +3 -0
- package/dist/vitest/index.d.ts +3 -0
- package/dist/vitest/index.js +9 -0
- package/dist/vitest/list-output.d.ts +3 -0
- package/dist/vitest/list-output.js +19 -0
- package/dist/vitest/live/list-gateway.d.ts +7 -0
- package/dist/vitest/live/list-gateway.js +60 -0
- package/dist/vitest/ownership.d.ts +29 -0
- package/dist/vitest/ownership.js +68 -0
- package/dist/vitest/plan.d.ts +33 -0
- package/dist/vitest/plan.js +73 -0
- package/dist/vitest/sandbox.d.ts +16 -0
- package/dist/vitest/sandbox.js +35 -0
- package/dist/vitest/test-events.d.ts +41 -0
- package/dist/vitest/test-events.js +92 -0
- package/dist/vitest/test-results.d.ts +84 -0
- package/dist/vitest/test-results.js +160 -0
- package/dist/vitest/types.d.ts +68 -0
- package/dist/vitest/types.js +4 -0
- package/package.json +123 -4
- package/skills/overview.md +32 -0
- package/skills/read-run-output.md +65 -0
- package/README.md +0 -3
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { AUTH_CONFIG_FILE, GLOBAL_CONFIG_FILE, parseConfigText, serializeConfig, } from "../config-files.js";
|
|
5
|
+
/**
|
|
6
|
+
* The CLI's `config.json` in `globalConfigDir`, such as a test's `vercel.globalConfigDir`, or `undefined` when
|
|
7
|
+
* there is none. Throws a `VercelCliError` when it isn't a JSON object.
|
|
8
|
+
*/
|
|
9
|
+
export function readGlobalConfig(globalConfigDir) {
|
|
10
|
+
return readConfigFile(globalConfigDir, GLOBAL_CONFIG_FILE);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Writes `config` as the CLI's `config.json` in `globalConfigDir`, creating the directory if needed, at once
|
|
14
|
+
* (`replaceConfigFile`).
|
|
15
|
+
*/
|
|
16
|
+
export function writeGlobalConfig(globalConfigDir, config) {
|
|
17
|
+
return writeConfigFile(globalConfigDir, GLOBAL_CONFIG_FILE, config);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The CLI's `auth.json` in `globalConfigDir`, such as a test's `vercel.globalConfigDir`, or `undefined` when there is
|
|
21
|
+
* none. Throws a `VercelCliError` when it isn't a JSON object.
|
|
22
|
+
*/
|
|
23
|
+
export function readAuthConfig(globalConfigDir) {
|
|
24
|
+
return readConfigFile(globalConfigDir, AUTH_CONFIG_FILE);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Writes `config` as the CLI's `auth.json` in `globalConfigDir`, creating the directory if needed, at once
|
|
28
|
+
* (`replaceConfigFile`), so a running `vercel` never reads part of it. Under a saved login the driver replaces its
|
|
29
|
+
* `token` before each invocation, and under a logged-out run removes it; every other key is the test's.
|
|
30
|
+
*/
|
|
31
|
+
export function writeAuthConfig(globalConfigDir, config) {
|
|
32
|
+
return writeConfigFile(globalConfigDir, AUTH_CONFIG_FILE, config);
|
|
33
|
+
}
|
|
34
|
+
async function readConfigFile(globalConfigDir, name) {
|
|
35
|
+
const path = join(globalConfigDir, name);
|
|
36
|
+
let text;
|
|
37
|
+
try {
|
|
38
|
+
text = await readFile(path, "utf8");
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
if (error.code === "ENOENT")
|
|
42
|
+
return undefined;
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
return parseConfigText(text, path);
|
|
46
|
+
}
|
|
47
|
+
async function writeConfigFile(globalConfigDir, name, config) {
|
|
48
|
+
await mkdir(globalConfigDir, { recursive: true });
|
|
49
|
+
await replaceConfigFile(globalConfigDir, name, serializeConfig(config));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Replaces `name` in `globalConfigDir`, an existing directory, with `text` at once: it writes a temporary file in
|
|
53
|
+
* that directory, then renames it over `name`, so a reader sees the old file or the new one, never part of it. The
|
|
54
|
+
* temporary file is removed when either step fails.
|
|
55
|
+
*/
|
|
56
|
+
export async function replaceConfigFile(globalConfigDir, name, text) {
|
|
57
|
+
const temporary = join(globalConfigDir, `.${name}.${randomUUID()}.tmp`);
|
|
58
|
+
try {
|
|
59
|
+
await writeFile(temporary, text);
|
|
60
|
+
await rename(temporary, join(globalConfigDir, name));
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
await rm(temporary, { force: true }).catch(() => undefined);
|
|
64
|
+
throw error;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { VercelCliProcessGateway } from "../gateways.ts";
|
|
2
|
+
/** How long a hard termination waits for output pipes to close after the process exits: 1 second. */
|
|
3
|
+
export declare const TERMINATE_DRAIN_MS = 1000;
|
|
4
|
+
/**
|
|
5
|
+
* The live process gateway: spawns `file` with `args`, no shell, only the given environment, stdout and stderr
|
|
6
|
+
* piped and decoded as UTF-8, and stdin ignored or piped. On POSIX each process leads its own process group, so a hard
|
|
7
|
+
* termination can kill descendants too; graceful signals still reach only the process itself. On Windows a hard
|
|
8
|
+
* termination asks `taskkill /T /F`, best effort. An `error` before the process spawns is a start failure: `missing`
|
|
9
|
+
* for ENOENT (no such executable on `PATH`, or no such `cwd`), `spawn-failed` otherwise.
|
|
10
|
+
* `auth.json` is read and written as UTF-8 text in the global-config directory; ENOENT on a read is `missing`. A
|
|
11
|
+
* write replaces it at once (`replaceConfigFile`), so a reader such as a running `vercel` sees the old file or the
|
|
12
|
+
* new one, never a partial one.
|
|
13
|
+
*/
|
|
14
|
+
export declare function liveVercelCliProcessGateway(): VercelCliProcessGateway;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { mkdir, readFile } from "node:fs/promises";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { AUTH_CONFIG_FILE } from "../config-files.js";
|
|
5
|
+
import { replaceConfigFile } from "./config-files.js";
|
|
6
|
+
/** How long a hard termination waits for output pipes to close after the process exits: 1 second. */
|
|
7
|
+
export const TERMINATE_DRAIN_MS = 1000;
|
|
8
|
+
/**
|
|
9
|
+
* The live process gateway: spawns `file` with `args`, no shell, only the given environment, stdout and stderr
|
|
10
|
+
* piped and decoded as UTF-8, and stdin ignored or piped. On POSIX each process leads its own process group, so a hard
|
|
11
|
+
* termination can kill descendants too; graceful signals still reach only the process itself. On Windows a hard
|
|
12
|
+
* termination asks `taskkill /T /F`, best effort. An `error` before the process spawns is a start failure: `missing`
|
|
13
|
+
* for ENOENT (no such executable on `PATH`, or no such `cwd`), `spawn-failed` otherwise.
|
|
14
|
+
* `auth.json` is read and written as UTF-8 text in the global-config directory; ENOENT on a read is `missing`. A
|
|
15
|
+
* write replaces it at once (`replaceConfigFile`), so a reader such as a running `vercel` sees the old file or the
|
|
16
|
+
* new one, never a partial one.
|
|
17
|
+
*/
|
|
18
|
+
export function liveVercelCliProcessGateway() {
|
|
19
|
+
return {
|
|
20
|
+
async prepareDirectories(directories) {
|
|
21
|
+
try {
|
|
22
|
+
for (const directory of directories)
|
|
23
|
+
await mkdir(directory, { recursive: true });
|
|
24
|
+
return { ok: true };
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
return { ok: false, error: { message: messageOf(error) } };
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
async readAuthFile(globalConfigDir) {
|
|
31
|
+
try {
|
|
32
|
+
return { type: "found", text: await readFile(join(globalConfigDir, AUTH_CONFIG_FILE), "utf8") };
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (error.code === "ENOENT")
|
|
36
|
+
return { type: "missing" };
|
|
37
|
+
return { type: "error", error: { message: messageOf(error) } };
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
async writeAuthFile(globalConfigDir, text) {
|
|
41
|
+
try {
|
|
42
|
+
await replaceConfigFile(globalConfigDir, AUTH_CONFIG_FILE, text);
|
|
43
|
+
return { ok: true };
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
return { ok: false, error: { message: messageOf(error) } };
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
start: (request) => startProcess(request),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function startProcess(request) {
|
|
53
|
+
return new Promise((resolve) => {
|
|
54
|
+
const child = spawn(request.file, [...request.args], {
|
|
55
|
+
cwd: request.cwd,
|
|
56
|
+
env: { ...request.env },
|
|
57
|
+
shell: false,
|
|
58
|
+
detached: process.platform !== "win32",
|
|
59
|
+
stdio: [request.stdin, "pipe", "pipe"],
|
|
60
|
+
});
|
|
61
|
+
let started = false;
|
|
62
|
+
let completed = false;
|
|
63
|
+
let terminated = false;
|
|
64
|
+
let drainExpired = false;
|
|
65
|
+
let drainTimer;
|
|
66
|
+
let processExit;
|
|
67
|
+
let stdinOpen = request.stdin === "pipe";
|
|
68
|
+
let resolveExit = () => undefined;
|
|
69
|
+
const exitedPromise = new Promise((resolveCompleted) => {
|
|
70
|
+
resolveExit = resolveCompleted;
|
|
71
|
+
});
|
|
72
|
+
const complete = (exit) => {
|
|
73
|
+
if (completed)
|
|
74
|
+
return;
|
|
75
|
+
completed = true;
|
|
76
|
+
stdinOpen = false;
|
|
77
|
+
if (drainTimer !== undefined)
|
|
78
|
+
clearTimeout(drainTimer);
|
|
79
|
+
resolveExit(exit);
|
|
80
|
+
};
|
|
81
|
+
const stopDraining = () => {
|
|
82
|
+
if (!drainExpired || processExit === undefined)
|
|
83
|
+
return;
|
|
84
|
+
complete({ ...processExit, outputComplete: false });
|
|
85
|
+
child.stdout?.destroy();
|
|
86
|
+
child.stderr?.destroy();
|
|
87
|
+
};
|
|
88
|
+
const startDrainTimer = () => {
|
|
89
|
+
if (!terminated || processExit === undefined || drainTimer !== undefined || completed)
|
|
90
|
+
return;
|
|
91
|
+
drainTimer = setTimeout(() => {
|
|
92
|
+
drainExpired = true;
|
|
93
|
+
stopDraining();
|
|
94
|
+
}, TERMINATE_DRAIN_MS);
|
|
95
|
+
};
|
|
96
|
+
// A write racing the process's exit fails with EPIPE; the driver learns of the exit from `exited`.
|
|
97
|
+
child.stdin?.on("error", () => {
|
|
98
|
+
stdinOpen = false;
|
|
99
|
+
});
|
|
100
|
+
child.stdout?.setEncoding("utf8").on("data", (text) => {
|
|
101
|
+
if (!completed)
|
|
102
|
+
request.onOutput("stdout", text);
|
|
103
|
+
});
|
|
104
|
+
child.stderr?.setEncoding("utf8").on("data", (text) => {
|
|
105
|
+
if (!completed)
|
|
106
|
+
request.onOutput("stderr", text);
|
|
107
|
+
});
|
|
108
|
+
child.once("exit", (exitCode, signal) => {
|
|
109
|
+
processExit = { exitCode, signal };
|
|
110
|
+
startDrainTimer();
|
|
111
|
+
});
|
|
112
|
+
// `close` comes after the process exits and its stdio streams end, so every chunk has been delivered.
|
|
113
|
+
child.once("close", (exitCode, signal) => complete({ exitCode, signal, outputComplete: true }));
|
|
114
|
+
child.once("error", (error) => {
|
|
115
|
+
if (started)
|
|
116
|
+
return;
|
|
117
|
+
resolve({
|
|
118
|
+
ok: false,
|
|
119
|
+
error: { code: error.code === "ENOENT" ? "missing" : "spawn-failed", message: error.message },
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
child.once("spawn", () => {
|
|
123
|
+
started = true;
|
|
124
|
+
resolve({
|
|
125
|
+
ok: true,
|
|
126
|
+
process: {
|
|
127
|
+
exited: exitedPromise,
|
|
128
|
+
write(text) {
|
|
129
|
+
if (stdinOpen && child.stdin !== null)
|
|
130
|
+
child.stdin.write(text);
|
|
131
|
+
},
|
|
132
|
+
closeStdin() {
|
|
133
|
+
if (!stdinOpen || child.stdin === null)
|
|
134
|
+
return;
|
|
135
|
+
stdinOpen = false;
|
|
136
|
+
child.stdin.end();
|
|
137
|
+
},
|
|
138
|
+
signal(signal) {
|
|
139
|
+
if (!completed && processExit === undefined)
|
|
140
|
+
child.kill(signal);
|
|
141
|
+
},
|
|
142
|
+
terminate() {
|
|
143
|
+
if (completed || terminated)
|
|
144
|
+
return;
|
|
145
|
+
terminated = true;
|
|
146
|
+
terminateTree(child.pid, () => child.kill("SIGKILL"));
|
|
147
|
+
startDrainTimer();
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/** Hard-terminates `pid`'s process tree, falling back to the process itself when no tree kill can be asked. */
|
|
155
|
+
function terminateTree(pid, killProcess) {
|
|
156
|
+
if (pid === undefined) {
|
|
157
|
+
killProcess();
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (process.platform === "win32") {
|
|
161
|
+
const taskkill = spawn("taskkill", ["/PID", String(pid), "/T", "/F"], { stdio: "ignore", windowsHide: true });
|
|
162
|
+
taskkill.once("error", killProcess);
|
|
163
|
+
taskkill.once("exit", (code) => {
|
|
164
|
+
if (code !== 0)
|
|
165
|
+
killProcess();
|
|
166
|
+
});
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
try {
|
|
170
|
+
process.kill(-pid, "SIGKILL");
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
killProcess();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
function messageOf(error) {
|
|
177
|
+
return error instanceof Error ? error.message : String(error);
|
|
178
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every token one test's invocations used. `redact` replaces each wherever it appears with `<token>`, longest first
|
|
3
|
+
* so a token that contains another is replaced whole, then passes the text to `downstream`, the proxy's `redact`,
|
|
4
|
+
* which replaces every token secret the proxy's container has seen. Longest first holds only within each set: a
|
|
5
|
+
* container's secret that contains one of these would be cut by this pass first. Testserver's tokens are random and
|
|
6
|
+
* don't contain one another.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Redactor {
|
|
9
|
+
#private;
|
|
10
|
+
constructor(downstream?: (text: string) => string);
|
|
11
|
+
add(secret: string): void;
|
|
12
|
+
redact(text: string): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { redactSecrets } from "../sdk/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Every token one test's invocations used. `redact` replaces each wherever it appears with `<token>`, longest first
|
|
4
|
+
* so a token that contains another is replaced whole, then passes the text to `downstream`, the proxy's `redact`,
|
|
5
|
+
* which replaces every token secret the proxy's container has seen. Longest first holds only within each set: a
|
|
6
|
+
* container's secret that contains one of these would be cut by this pass first. Testserver's tokens are random and
|
|
7
|
+
* don't contain one another.
|
|
8
|
+
*/
|
|
9
|
+
export class Redactor {
|
|
10
|
+
#secrets = new Set();
|
|
11
|
+
#downstream;
|
|
12
|
+
constructor(downstream = (text) => text) {
|
|
13
|
+
this.#downstream = downstream;
|
|
14
|
+
}
|
|
15
|
+
add(secret) {
|
|
16
|
+
if (secret !== "")
|
|
17
|
+
this.#secrets.add(secret);
|
|
18
|
+
}
|
|
19
|
+
redact(text) {
|
|
20
|
+
return this.#downstream(redactSecrets(text, this.#secrets));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ProxyRequestRecord } from "../sdk/index.ts";
|
|
2
|
+
import { type InvocationEnd, type VercelInvocation } from "./invocation.ts";
|
|
3
|
+
/** The most characters of each of an invocation's stdout and stderr a report prints: the last ones. */
|
|
4
|
+
export declare const OUTPUT_REPORT_CHARS = 4000;
|
|
5
|
+
/** The most characters of an invocation's piped stdin text a report prints: the first ones. */
|
|
6
|
+
export declare const STDIN_REPORT_CHARS = 200;
|
|
7
|
+
/** What a failed test prints about `vercel`: each invocation, in order. */
|
|
8
|
+
export declare function describeInvocations(invocations: readonly VercelInvocation[]): string;
|
|
9
|
+
/**
|
|
10
|
+
* One invocation: its command line, where it ran and whether it was interactive, at a terminal, given piped stdin
|
|
11
|
+
* or an open one, a saved login or logged out, the text piped to it, how it ended and how long it took, the proxy's
|
|
12
|
+
* records added while it ran by session id, and the end of its stdout and stderr.
|
|
13
|
+
*/
|
|
14
|
+
export declare function describeInvocation(invocation: VercelInvocation): string;
|
|
15
|
+
/** How an invocation ended and how long it ran, such as `exited 1 after 812ms`. */
|
|
16
|
+
export declare function describeEnd(end: InvocationEnd | undefined, durationMs: number): string;
|
|
17
|
+
/**
|
|
18
|
+
* The proxy's records added while an invocation ran, counted by the `vercel` CLI's session id, such as
|
|
19
|
+
* `3 proxy requests while it ran: session 4c24… (3)`, and how many of them were still open, such as
|
|
20
|
+
* `3 proxy requests while it ran, 1 still open: session 4c24… (3)`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function describeRequests(requests: readonly ProxyRequestRecord[]): string;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// The Vercel CLI driver's failure report: pure functions over invocation records, so a test's fixture can print
|
|
2
|
+
// them and unit tests can check them.
|
|
3
|
+
import { isOpenRecord } from "../sdk/index.js";
|
|
4
|
+
import { STOP_GRACE_MS } from "./invocation.js";
|
|
5
|
+
/** The most characters of each of an invocation's stdout and stderr a report prints: the last ones. */
|
|
6
|
+
export const OUTPUT_REPORT_CHARS = 4000;
|
|
7
|
+
/** The most characters of an invocation's piped stdin text a report prints: the first ones. */
|
|
8
|
+
export const STDIN_REPORT_CHARS = 200;
|
|
9
|
+
/** What a failed test prints about `vercel`: each invocation, in order. */
|
|
10
|
+
export function describeInvocations(invocations) {
|
|
11
|
+
if (invocations.length === 0)
|
|
12
|
+
return "vercel-cli: vercel never ran";
|
|
13
|
+
return invocations.map((invocation) => describeInvocation(invocation)).join("\n");
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* One invocation: its command line, where it ran and whether it was interactive, at a terminal, given piped stdin
|
|
17
|
+
* or an open one, a saved login or logged out, the text piped to it, how it ended and how long it took, the proxy's
|
|
18
|
+
* records added while it ran by session id, and the end of its stdout and stderr.
|
|
19
|
+
*/
|
|
20
|
+
export function describeInvocation(invocation) {
|
|
21
|
+
const lines = [
|
|
22
|
+
`vercel-cli: invocation ${invocation.number}${describeMode(invocation)}: ${invocation.command}`,
|
|
23
|
+
` in ${invocation.cwd}`,
|
|
24
|
+
...(invocation.stdin.kind === "text" ? [` stdin: ${describeStdinText(invocation.stdin.text)}`] : []),
|
|
25
|
+
` ${describeEnd(invocation.end, invocation.durationMs)}`,
|
|
26
|
+
...(invocation.outputComplete
|
|
27
|
+
? []
|
|
28
|
+
: [" output incomplete: a descendant kept stdout or stderr open after the driver killed vercel"]),
|
|
29
|
+
` ${describeRequests(invocation.requests)}`,
|
|
30
|
+
];
|
|
31
|
+
if (invocation.overlapped.length > 0) {
|
|
32
|
+
lines.push(` ran at the same time as invocation ${invocation.overlapped.join(", ")}: these are every record the proxy ` +
|
|
33
|
+
"added while it ran, not checked against this invocation");
|
|
34
|
+
}
|
|
35
|
+
lines.push(...describeOutput("stdout", invocation.stdout), ...describeOutput("stderr", invocation.stderr));
|
|
36
|
+
return lines.join("\n");
|
|
37
|
+
}
|
|
38
|
+
/** How an invocation ended and how long it ran, such as `exited 1 after 812ms`. */
|
|
39
|
+
export function describeEnd(end, durationMs) {
|
|
40
|
+
const after = `after ${Math.round(durationMs)}ms`;
|
|
41
|
+
if (end === undefined)
|
|
42
|
+
return `still running ${after}`;
|
|
43
|
+
switch (end.kind) {
|
|
44
|
+
case "exited":
|
|
45
|
+
return `${exitText(end)} ${after}`;
|
|
46
|
+
case "stopped":
|
|
47
|
+
return (`stopped with ${end.stopSignal}` +
|
|
48
|
+
(end.killAttemptedAfterGrace ? `, SIGKILL attempted after the ${STOP_GRACE_MS}ms grace` : "") +
|
|
49
|
+
`; ${exitText(end)} ${after}`);
|
|
50
|
+
case "timed-out":
|
|
51
|
+
return `killed after its ${end.timeoutMs}ms timeout, then ${exitText(end)} ${after}`;
|
|
52
|
+
case "aborted":
|
|
53
|
+
return `killed when the test's signal aborted, then ${exitText(end)} ${after}`;
|
|
54
|
+
case "closed":
|
|
55
|
+
return `killed by close() at the end of the test, then ${exitText(end)} ${after}`;
|
|
56
|
+
case "abandoned":
|
|
57
|
+
return `killed when its interactive block threw, then ${exitText(end)} ${after}`;
|
|
58
|
+
case "not-started":
|
|
59
|
+
return end.reason === "missing"
|
|
60
|
+
? `could not start: not found, or its working directory doesn't exist (${end.message})`
|
|
61
|
+
: `could not start: ${end.message}`;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The proxy's records added while an invocation ran, counted by the `vercel` CLI's session id, such as
|
|
66
|
+
* `3 proxy requests while it ran: session 4c24… (3)`, and how many of them were still open, such as
|
|
67
|
+
* `3 proxy requests while it ran, 1 still open: session 4c24… (3)`.
|
|
68
|
+
*/
|
|
69
|
+
export function describeRequests(requests) {
|
|
70
|
+
if (requests.length === 0)
|
|
71
|
+
return "no proxy requests while it ran";
|
|
72
|
+
const counts = new Map();
|
|
73
|
+
for (const request of requests)
|
|
74
|
+
counts.set(request.sessionId, (counts.get(request.sessionId) ?? 0) + 1);
|
|
75
|
+
const sessions = [...counts].map(([session, count]) => session === undefined ? `no session id (${count})` : `session ${session} (${count})`);
|
|
76
|
+
const noun = requests.length === 1 ? "proxy request" : "proxy requests";
|
|
77
|
+
const open = requests.filter(isOpenRecord).length;
|
|
78
|
+
return `${requests.length} ${noun} while it ran${open === 0 ? "" : `, ${open} still open`}: ${sessions.join(", ")}`;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* How an invocation ran, when not as a script with `--token` and no stdin: whether it was interactive, at a
|
|
82
|
+
* terminal, given piped stdin or an open one, a saved login or logged out, such as ` (interactive)`,
|
|
83
|
+
* ` (piped stdin, saved login)` or ` (interactive, terminal, logged out)`.
|
|
84
|
+
*/
|
|
85
|
+
function describeMode(invocation) {
|
|
86
|
+
const modes = [
|
|
87
|
+
...(invocation.interactive ? ["interactive"] : []),
|
|
88
|
+
...(invocation.terminal ? ["terminal"] : []),
|
|
89
|
+
...(invocation.stdin.kind === "text" ? ["piped stdin"] : invocation.stdin.kind === "open" ? ["stdin open"] : []),
|
|
90
|
+
...(invocation.auth === "saved" ? ["saved login"] : invocation.auth === "none" ? ["logged out"] : []),
|
|
91
|
+
];
|
|
92
|
+
return modes.length === 0 ? "" : ` (${modes.join(", ")})`;
|
|
93
|
+
}
|
|
94
|
+
/** Piped stdin text, JSON-quoted, its first `STDIN_REPORT_CHARS` characters with its length when cut. */
|
|
95
|
+
function describeStdinText(text) {
|
|
96
|
+
if (text.length <= STDIN_REPORT_CHARS)
|
|
97
|
+
return JSON.stringify(text);
|
|
98
|
+
return `${JSON.stringify(text.slice(0, STDIN_REPORT_CHARS))} (first ${STDIN_REPORT_CHARS} of ${text.length} characters)`;
|
|
99
|
+
}
|
|
100
|
+
function exitText(exit) {
|
|
101
|
+
return exit.exitCode === null ? `ended by ${exit.signal ?? "a signal"}` : `exited ${exit.exitCode}`;
|
|
102
|
+
}
|
|
103
|
+
/** The end of one stream's text, already stripped of ANSI codes by the invocation. */
|
|
104
|
+
function describeOutput(name, plain) {
|
|
105
|
+
if (plain === "")
|
|
106
|
+
return [` --- ${name}: empty`];
|
|
107
|
+
const cut = plain.length > OUTPUT_REPORT_CHARS;
|
|
108
|
+
const heading = cut ? ` --- ${name} (last ${OUTPUT_REPORT_CHARS} of ${plain.length} characters)` : ` --- ${name}`;
|
|
109
|
+
return [heading, plain.slice(-OUTPUT_REPORT_CHARS).replace(/\n$/, "")];
|
|
110
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { VercelInvocation } from "./invocation.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The listener `vercelCli` uses when the caller passes no `onInvocationEnd`: one that prints each invocation with
|
|
4
|
+
* `describeInvocation` to `print`, when `env`'s run payload says the run is verbose (`storm run --verbose`), or
|
|
5
|
+
* `undefined` outside `storm run`, in a run that isn't verbose, or when the run payload can't be read.
|
|
6
|
+
*/
|
|
7
|
+
export declare function defaultInvocationListener(env: Readonly<Record<string, string | undefined>>, print: (text: string) => void): ((invocation: VercelInvocation) => void) | undefined;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// The driver's default `onInvocationEnd` in a verbose run: pure over the environment and a printer, so `entry.ts`
|
|
2
|
+
// passes `process.env` and stderr, and unit tests pass their own.
|
|
3
|
+
import { readRunPayload, RUN_PAYLOAD_VARIABLE, RunPayloadError } from "../sdk/index.js";
|
|
4
|
+
import { describeInvocation } from "./report.js";
|
|
5
|
+
/**
|
|
6
|
+
* The listener `vercelCli` uses when the caller passes no `onInvocationEnd`: one that prints each invocation with
|
|
7
|
+
* `describeInvocation` to `print`, when `env`'s run payload says the run is verbose (`storm run --verbose`), or
|
|
8
|
+
* `undefined` outside `storm run`, in a run that isn't verbose, or when the run payload can't be read.
|
|
9
|
+
*/
|
|
10
|
+
export function defaultInvocationListener(env, print) {
|
|
11
|
+
const raw = env[RUN_PAYLOAD_VARIABLE];
|
|
12
|
+
if (raw === undefined || raw === "")
|
|
13
|
+
return undefined;
|
|
14
|
+
try {
|
|
15
|
+
if (readRunPayload(env).verbose !== true)
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
if (error instanceof RunPayloadError)
|
|
20
|
+
return undefined;
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
return (invocation) => print(describeInvocation(invocation));
|
|
24
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** A git commit as storm reads it: the full SHA, and whether the tree had uncommitted changes. */
|
|
2
|
+
export interface GitCommit {
|
|
3
|
+
readonly sha: string;
|
|
4
|
+
readonly dirty: boolean;
|
|
5
|
+
}
|
|
6
|
+
/** A commit as the version line shows it: the SHA's first 12 characters, `-dirty` appended for a dirty tree. */
|
|
7
|
+
export declare function commitText(commit: GitCommit): string;
|
|
8
|
+
/** The version as root `--version` and a run print it: `0.0.1 (3f2a9c1b7d4e)`, or `0.0.1` with no commit. */
|
|
9
|
+
export declare function versionText(version: string, commit: string | null): string;
|
|
10
|
+
/**
|
|
11
|
+
* Reads the commit checked out in `directory` from git (`git rev-parse HEAD`, then `git status --porcelain`).
|
|
12
|
+
* Any failure, git missing or `directory` outside a git worktree, gives `undefined`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function readGitCommit(directory: string): Promise<GitCommit | undefined>;
|
|
15
|
+
/**
|
|
16
|
+
* The commit storm was built from, as the version line shows it. `binUrl` is the `import.meta.url` of
|
|
17
|
+
* `bin/storm.ts`: built, under `dist/bin/`, it reads the stamp in `dist/build-info.js`; from source, under
|
|
18
|
+
* `src/bin/`, it reads git in the package directory. `null` when neither gives a commit.
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildCommit(binUrl: string): Promise<string | null>;
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// The version line: storm's version and the git commit it was built from. `scripts/write-build-info.js` stamps
|
|
2
|
+
// the commit into `dist/build-info.js` at build time; running from source in the cnc workspace, storm reads it
|
|
3
|
+
// from git at startup.
|
|
4
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
5
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
6
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
7
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
return path;
|
|
11
|
+
};
|
|
12
|
+
import { execFile } from "node:child_process";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
14
|
+
import { promisify } from "node:util";
|
|
15
|
+
/** A commit as the version line shows it: the SHA's first 12 characters, `-dirty` appended for a dirty tree. */
|
|
16
|
+
export function commitText(commit) {
|
|
17
|
+
return `${commit.sha.slice(0, 12)}${commit.dirty ? "-dirty" : ""}`;
|
|
18
|
+
}
|
|
19
|
+
/** The version as root `--version` and a run print it: `0.0.1 (3f2a9c1b7d4e)`, or `0.0.1` with no commit. */
|
|
20
|
+
export function versionText(version, commit) {
|
|
21
|
+
return commit === null ? version : `${version} (${commit})`;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Reads the commit checked out in `directory` from git (`git rev-parse HEAD`, then `git status --porcelain`).
|
|
25
|
+
* Any failure, git missing or `directory` outside a git worktree, gives `undefined`.
|
|
26
|
+
*/
|
|
27
|
+
export async function readGitCommit(directory) {
|
|
28
|
+
const git = async (...args) => (await promisify(execFile)("git", args, { cwd: directory, encoding: "utf8" })).stdout;
|
|
29
|
+
try {
|
|
30
|
+
const sha = (await git("rev-parse", "HEAD")).trim();
|
|
31
|
+
if (!/^[0-9a-f]{40,64}$/.test(sha))
|
|
32
|
+
return undefined;
|
|
33
|
+
return { sha, dirty: (await git("status", "--porcelain")).trim() !== "" };
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The commit storm was built from, as the version line shows it. `binUrl` is the `import.meta.url` of
|
|
41
|
+
* `bin/storm.ts`: built, under `dist/bin/`, it reads the stamp in `dist/build-info.js`; from source, under
|
|
42
|
+
* `src/bin/`, it reads git in the package directory. `null` when neither gives a commit.
|
|
43
|
+
*/
|
|
44
|
+
export async function buildCommit(binUrl) {
|
|
45
|
+
if (binUrl.endsWith(".ts")) {
|
|
46
|
+
const commit = await readGitCommit(fileURLToPath(new URL("../..", binUrl)));
|
|
47
|
+
return commit === undefined ? null : commitText(commit);
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
const info = (await import(__rewriteRelativeImportExtension(new URL("../build-info.js", binUrl).href)));
|
|
51
|
+
const { sha, dirty } = info;
|
|
52
|
+
return typeof sha === "string" && typeof dirty === "boolean" ? commitText({ sha, dirty }) : null;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type StormReporter } from "./test-results.ts";
|
|
2
|
+
export type { ReportedConsoleLog, ReportedTestCase, ReportedTestError, ReportedTestModule, StormReporter, } from "./test-results.ts";
|
|
3
|
+
/**
|
|
4
|
+
* The vitest workers per Testserver sandbox `testserverWorkers` sizes for by default: about the number of
|
|
5
|
+
* concurrent test ids a Testserver sandbox serves before its service boots slow down.
|
|
6
|
+
*/
|
|
7
|
+
export declare const WORKERS_PER_SANDBOX = 4;
|
|
8
|
+
/**
|
|
9
|
+
* A vitest `retry` for a testserver project: one more attempt for a test that failed because a Testserver call's
|
|
10
|
+
* connection failed (`TESTSERVER_CONNECTION_FAILURE`), such as a `read ECONNRESET` between the runner and the
|
|
11
|
+
* Testserver URL, and none for any other failure. The adapter ends a file's container when a test fails, so the retry
|
|
12
|
+
* runs on a new container, where a factory call that half-happened on the old one can't collide with it. vitest's
|
|
13
|
+
* own output marks a test it rescued `(retry x1)`. Spread it to change the count:
|
|
14
|
+
* `retry: { ...testserverConnectionRetry, count: 2 }`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const testserverConnectionRetry: {
|
|
17
|
+
readonly count: number;
|
|
18
|
+
readonly condition: RegExp;
|
|
19
|
+
};
|
|
20
|
+
export interface TestserverWorkersOptions {
|
|
21
|
+
/** Workers per Testserver sandbox, a positive integer. Defaults to `WORKERS_PER_SANDBOX`. */
|
|
22
|
+
readonly workersPerSandbox?: number;
|
|
23
|
+
/** Where to read `STORM_RUN`. Defaults to `process.env`. */
|
|
24
|
+
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The `maxWorkers` for a testserver vitest project: `workersPerSandbox` times the number of Testserver sandboxes in
|
|
28
|
+
* the run payload. With `STORM_RUN` unset or empty, outside `storm run`, it counts one Testserver sandbox,
|
|
29
|
+
* so the config still loads. Throws a `RunPayloadError` when `STORM_RUN` holds no valid run payload, and an
|
|
30
|
+
* `Error` when `workersPerSandbox` is not a positive integer.
|
|
31
|
+
*/
|
|
32
|
+
export declare function testserverWorkers(options?: TestserverWorkersOptions): number;
|
|
33
|
+
export interface StormReporterOptions {
|
|
34
|
+
/** Where to read `STORM_RUN`. Defaults to `process.env`. */
|
|
35
|
+
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A vitest reporter for a testserver project's config: it appends each test's final result, retries settled, to the
|
|
39
|
+
* run payload's `testEvents` file, which `storm run` counts the tests from. It prints nothing, so list it beside
|
|
40
|
+
* the reporter a person reads, `reporters: ["default", stormReporter()]`; a `--reporter` given to vitest on the
|
|
41
|
+
* command line replaces both. Outside `storm run`, or when the run payload names no test events file, it
|
|
42
|
+
* reports nothing, and once an append fails it drops every later result: it never fails a test.
|
|
43
|
+
*/
|
|
44
|
+
export declare function stormReporter(options?: StormReporterOptions): StormReporter;
|
|
45
|
+
/**
|
|
46
|
+
* The reporters for a testserver project's config under `storm run`: vitest's `default`, which names each file
|
|
47
|
+
* and its slow or failed tests as each file finishes, or under `storm run --verbose` its `verbose`, which names
|
|
48
|
+
* each test as it finishes; and `stormReporter()`. With `STORM_RUN` unset or empty it picks `default`.
|
|
49
|
+
* Throws a `RunPayloadError` when `STORM_RUN` holds no valid run payload.
|
|
50
|
+
*/
|
|
51
|
+
export declare function stormReporters(options?: StormReporterOptions): ["default" | "verbose", StormReporter];
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// storm's Vitest config helpers, exported as `@cnc-tools/storm/vitest/config`. A `vitest.config.ts` imports
|
|
2
|
+
// this, never `@cnc-tools/storm/vitest`: loading the adapter's `test` extends vitest's, which throws inside a config
|
|
3
|
+
// file. So nothing here imports `./fixtures.ts` or vitest.
|
|
4
|
+
import { readRunPayload, RUN_PAYLOAD_VARIABLE, TESTSERVER_CONNECTION_FAILURE } from "../sdk/index.js";
|
|
5
|
+
import { sandboxCount } from "./sandbox.js";
|
|
6
|
+
import { testResultReporter } from "./test-results.js";
|
|
7
|
+
/**
|
|
8
|
+
* The vitest workers per Testserver sandbox `testserverWorkers` sizes for by default: about the number of
|
|
9
|
+
* concurrent test ids a Testserver sandbox serves before its service boots slow down.
|
|
10
|
+
*/
|
|
11
|
+
export const WORKERS_PER_SANDBOX = 4;
|
|
12
|
+
/**
|
|
13
|
+
* A vitest `retry` for a testserver project: one more attempt for a test that failed because a Testserver call's
|
|
14
|
+
* connection failed (`TESTSERVER_CONNECTION_FAILURE`), such as a `read ECONNRESET` between the runner and the
|
|
15
|
+
* Testserver URL, and none for any other failure. The adapter ends a file's container when a test fails, so the retry
|
|
16
|
+
* runs on a new container, where a factory call that half-happened on the old one can't collide with it. vitest's
|
|
17
|
+
* own output marks a test it rescued `(retry x1)`. Spread it to change the count:
|
|
18
|
+
* `retry: { ...testserverConnectionRetry, count: 2 }`.
|
|
19
|
+
*/
|
|
20
|
+
export const testserverConnectionRetry = {
|
|
21
|
+
count: 1,
|
|
22
|
+
condition: TESTSERVER_CONNECTION_FAILURE,
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The `maxWorkers` for a testserver vitest project: `workersPerSandbox` times the number of Testserver sandboxes in
|
|
26
|
+
* the run payload. With `STORM_RUN` unset or empty, outside `storm run`, it counts one Testserver sandbox,
|
|
27
|
+
* so the config still loads. Throws a `RunPayloadError` when `STORM_RUN` holds no valid run payload, and an
|
|
28
|
+
* `Error` when `workersPerSandbox` is not a positive integer.
|
|
29
|
+
*/
|
|
30
|
+
export function testserverWorkers(options = {}) {
|
|
31
|
+
const { workersPerSandbox = WORKERS_PER_SANDBOX, env = process.env } = options;
|
|
32
|
+
if (!Number.isInteger(workersPerSandbox) || workersPerSandbox < 1) {
|
|
33
|
+
throw new Error(`workersPerSandbox is ${String(workersPerSandbox)}, not a positive integer`);
|
|
34
|
+
}
|
|
35
|
+
const raw = env[RUN_PAYLOAD_VARIABLE];
|
|
36
|
+
if (raw === undefined || raw === "")
|
|
37
|
+
return workersPerSandbox;
|
|
38
|
+
return workersPerSandbox * sandboxCount(readRunPayload(env));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A vitest reporter for a testserver project's config: it appends each test's final result, retries settled, to the
|
|
42
|
+
* run payload's `testEvents` file, which `storm run` counts the tests from. It prints nothing, so list it beside
|
|
43
|
+
* the reporter a person reads, `reporters: ["default", stormReporter()]`; a `--reporter` given to vitest on the
|
|
44
|
+
* command line replaces both. Outside `storm run`, or when the run payload names no test events file, it
|
|
45
|
+
* reports nothing, and once an append fails it drops every later result: it never fails a test.
|
|
46
|
+
*/
|
|
47
|
+
export function stormReporter(options = {}) {
|
|
48
|
+
return testResultReporter(options.env ?? process.env);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The reporters for a testserver project's config under `storm run`: vitest's `default`, which names each file
|
|
52
|
+
* and its slow or failed tests as each file finishes, or under `storm run --verbose` its `verbose`, which names
|
|
53
|
+
* each test as it finishes; and `stormReporter()`. With `STORM_RUN` unset or empty it picks `default`.
|
|
54
|
+
* Throws a `RunPayloadError` when `STORM_RUN` holds no valid run payload.
|
|
55
|
+
*/
|
|
56
|
+
export function stormReporters(options = {}) {
|
|
57
|
+
const env = options.env ?? process.env;
|
|
58
|
+
const raw = env[RUN_PAYLOAD_VARIABLE];
|
|
59
|
+
const verbose = raw !== undefined && raw !== "" && readRunPayload(env).verbose === true;
|
|
60
|
+
return [verbose ? "verbose" : "default", stormReporter({ env })];
|
|
61
|
+
}
|