@cnc-tools/storm 0.14.2 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application.js +3 -1
- package/dist/bin/storm.js +9 -7
- package/dist/build-info.js +1 -1
- package/dist/chunks/chunk-4U4DZ7VG.js +40 -0
- package/dist/chunks/{chunk-GSC6SRTW.js → chunk-5CCP36QQ.js} +1 -1
- package/dist/chunks/chunk-5GBMR4HM.js +966 -0
- package/dist/chunks/{chunk-43MWZLJR.js → chunk-5VXBKPW6.js} +1 -1
- package/dist/chunks/{chunk-RA4L2ACU.js → chunk-AWBSONHB.js} +88 -34
- package/dist/chunks/{chunk-BRUIATTR.js → chunk-CN4EFA5J.js} +59 -12
- package/dist/chunks/{chunk-3HBPNQ4Y.js → chunk-CXAT7ZKP.js} +2 -2
- package/dist/chunks/chunk-E4PJNZVG.js +783 -0
- package/dist/chunks/{chunk-T6AZIDZD.js → chunk-F6N34UWB.js} +12 -244
- package/dist/chunks/{chunk-RUPD4TLT.js → chunk-KC4KDJ5K.js} +147 -26
- package/dist/chunks/{chunk-I7AN3DIJ.js → chunk-L36GBUBB.js} +1626 -676
- package/dist/chunks/{chunk-XZCDA5PE.js → chunk-OX7X4B2L.js} +7 -2
- package/dist/chunks/{chunk-UUBZTGLV.js → chunk-PN5ULTTH.js} +140 -130
- package/dist/chunks/chunk-QUHY6FGN.js +108 -0
- package/dist/chunks/chunk-QVS7HRU7.js +74 -0
- package/dist/chunks/{chunk-UC6DULWY.js → chunk-R7XVBZOY.js} +130 -39
- package/dist/chunks/{chunk-LUOHJ3LB.js → chunk-RAQEXKL6.js} +1120 -465
- package/dist/chunks/{chunk-GJOEPJJL.js → chunk-SZEURWRS.js} +446 -52
- package/dist/chunks/chunk-TJNFVNKR.js +246 -0
- package/dist/chunks/{chunk-BW2ADH7U.js → chunk-VUPZH7J2.js} +1 -1
- package/dist/chunks/{chunk-HDL4WKIB.js → chunk-XEVHP5ZW.js} +2 -2
- package/dist/chunks/{chunk-VH2POPW5.js → chunk-YV7GE6EV.js} +635 -79
- package/dist/chunks/{chunk-GQIL3AHY.js → chunk-ZG3WQ4UF.js} +1 -1
- package/dist/chunks/{live-app-SZGEILCQ.js → live-app-PI3BAN6Y.js} +28 -23
- package/dist/command-tree.d.ts +2 -2
- package/dist/command-tree.js +2 -2
- package/dist/commands/exec/across-sandboxes-outcomes.d.ts +364 -0
- package/dist/commands/exec/across-sandboxes-outcomes.js +229 -0
- package/dist/commands/exec/across-sandboxes-run.d.ts +180 -0
- package/dist/commands/exec/across-sandboxes-run.js +339 -0
- package/dist/commands/exec/command.d.ts +577 -75
- package/dist/commands/exec/command.js +165 -32
- package/dist/commands/exec/driver-plan.d.ts +8 -2
- package/dist/commands/exec/driver-plan.js +13 -3
- package/dist/commands/exec/exec-words.d.ts +17 -3
- package/dist/commands/exec/exec-words.js +27 -16
- package/dist/commands/exec/live-view.d.ts +3 -4
- package/dist/commands/exec/live-view.js +37 -28
- package/dist/commands/exec/metadata.js +2 -2
- package/dist/commands/exec/mint-failed.d.ts +4 -4
- package/dist/commands/exec/mint-failed.js +6 -6
- package/dist/commands/exec/outcomes.d.ts +530 -73
- package/dist/commands/exec/outcomes.js +202 -66
- package/dist/commands/exec/plan-only.d.ts +10 -0
- package/dist/commands/exec/plan-only.js +46 -0
- package/dist/commands/exec/plan-run.d.ts +54 -35
- package/dist/commands/exec/plan-run.js +81 -38
- package/dist/commands/exec/planned-outcome.d.ts +15 -0
- package/dist/commands/exec/planned-outcome.js +35 -0
- package/dist/commands/exec/progress.d.ts +2 -2
- package/dist/commands/exec/progress.js +35 -18
- package/dist/commands/exec/resource-refusals.d.ts +2 -2
- package/dist/commands/exec/resource-refusals.js +3 -3
- package/dist/commands/exec/run-bin.d.ts +1 -1
- package/dist/commands/exec/run-bin.js +2 -2
- package/dist/commands/exec/run-command.d.ts +345 -63
- package/dist/commands/exec/run-command.js +308 -258
- package/dist/commands/exec/run-metadata.d.ts +42 -8
- package/dist/commands/exec/run-metadata.js +40 -21
- package/dist/commands/exec/run-planned.d.ts +20 -0
- package/dist/commands/exec/run-planned.js +22 -0
- package/dist/commands/exec/sandbox-lines.d.ts +42 -0
- package/dist/commands/exec/sandbox-lines.js +59 -0
- package/dist/commands/exec/sandbox-progress.d.ts +30 -0
- package/dist/commands/exec/sandbox-progress.js +232 -0
- package/dist/commands/exec/sandbox-view.d.ts +19 -0
- package/dist/commands/exec/sandbox-view.js +72 -0
- package/dist/commands/exec/view.d.ts +3 -2
- package/dist/commands/exec/view.js +10 -6
- package/dist/commands/runs/facts.d.ts +51 -9
- package/dist/commands/runs/facts.js +49 -29
- package/dist/commands/runs/list/command.d.ts +80 -4
- package/dist/commands/runs/list/command.js +11 -10
- package/dist/commands/runs/list/metadata.js +1 -1
- package/dist/commands/runs/list/outcomes.d.ts +40 -2
- package/dist/commands/runs/logs/command.d.ts +103 -8
- package/dist/commands/runs/logs/command.js +139 -24
- package/dist/commands/runs/logs/metadata.d.ts +4 -0
- package/dist/commands/runs/logs/metadata.js +14 -7
- package/dist/commands/runs/logs/outcomes.d.ts +49 -2
- package/dist/commands/runs/logs/outcomes.js +110 -6
- package/dist/commands/runs/past-run.d.ts +77 -6
- package/dist/commands/runs/past-run.js +133 -4
- package/dist/commands/runs/show/command.d.ts +568 -10
- package/dist/commands/runs/show/command.js +634 -119
- package/dist/commands/runs/show/metadata.d.ts +17 -0
- package/dist/commands/runs/show/metadata.js +48 -7
- package/dist/commands/runs/show/outcomes.d.ts +276 -5
- package/dist/commands/runs/show/outcomes.js +484 -96
- package/dist/commands/snapshots/build/command.d.ts +109 -18
- package/dist/commands/snapshots/build/command.js +72 -36
- package/dist/commands/snapshots/build/metadata.d.ts +4 -0
- package/dist/commands/snapshots/build/metadata.js +5 -1
- package/dist/commands/snapshots/build/outcomes.d.ts +53 -8
- package/dist/commands/snapshots/build/outcomes.js +26 -3
- package/dist/commands/snapshots/list/command.d.ts +72 -7
- package/dist/commands/snapshots/list/command.js +57 -24
- package/dist/commands/snapshots/list/metadata.d.ts +4 -0
- package/dist/commands/snapshots/list/metadata.js +4 -0
- package/dist/commands/snapshots/list/outcomes.d.ts +31 -0
- package/dist/commands/snapshots/list/outcomes.js +25 -2
- package/dist/commands/suites/list/command.d.ts +129 -0
- package/dist/commands/suites/list/command.js +162 -0
- package/dist/commands/suites/list/metadata.d.ts +11 -0
- package/dist/commands/suites/list/metadata.js +15 -0
- package/dist/commands/suites/list/outcomes.d.ts +91 -0
- package/dist/commands/suites/list/outcomes.js +122 -0
- package/dist/commands/suites/metadata.js +8 -0
- package/dist/commands/test/command.d.ts +1389 -0
- package/dist/commands/test/command.js +583 -0
- package/dist/commands/test/metadata.js +8 -0
- package/dist/commands/test/outcomes.d.ts +765 -0
- package/dist/commands/test/outcomes.js +140 -0
- package/dist/commands/test/plan.d.ts +92 -0
- package/dist/commands/test/plan.js +128 -0
- package/dist/commands/test/test-words.d.ts +12 -0
- package/dist/commands/test/test-words.js +42 -0
- package/dist/config/check-resources.d.ts +14 -0
- package/dist/config/check-resources.js +98 -0
- package/dist/config/check-runner.d.ts +13 -0
- package/dist/config/check-runner.js +54 -0
- package/dist/config/check-suites.d.ts +14 -0
- package/dist/config/check-suites.js +99 -0
- package/dist/config/gateways.d.ts +24 -0
- package/dist/config/index.d.ts +6 -3
- package/dist/config/index.js +3 -1
- package/dist/config/live/file-lists-file-gateway.d.ts +4 -0
- package/dist/config/live/file-lists-file-gateway.js +27 -0
- package/dist/config/load.d.ts +11 -10
- package/dist/config/load.js +35 -103
- package/dist/config/recipe-run.d.ts +8 -1
- package/dist/config/recipe-run.js +2 -1
- package/dist/config/resolve.d.ts +3 -2
- package/dist/config/resolve.js +6 -3
- package/dist/config/resolver.d.ts +20 -6
- package/dist/config/resolver.js +11 -8
- package/dist/config/runner.d.ts +24 -0
- package/dist/config/runner.js +4 -0
- package/dist/config/schema.d.ts +26 -18
- package/dist/config/schema.js +41 -9
- package/dist/config/settings-file.d.ts +9 -3
- package/dist/config/settings-file.js +41 -4
- package/dist/config/suite.d.ts +39 -0
- package/dist/config/suite.js +5 -0
- package/dist/config-file/define.d.ts +49 -18
- package/dist/config-file/define.js +9 -8
- package/dist/config-file/runner.d.ts +12 -0
- package/dist/config-file/runner.js +9 -0
- package/dist/context.d.ts +12 -8
- package/dist/context.js +9 -3
- package/dist/core/across-sandboxes.d.ts +43 -0
- package/dist/core/across-sandboxes.js +319 -0
- package/dist/core/before-run.d.ts +5 -3
- package/dist/core/before-run.js +12 -1
- package/dist/core/events.d.ts +62 -6
- package/dist/core/events.js +14 -0
- package/dist/core/index.d.ts +4 -2
- package/dist/core/index.js +3 -1
- package/dist/core/payload.d.ts +2 -1
- package/dist/core/payload.js +2 -1
- package/dist/core/presentations.js +1 -1
- package/dist/core/resource.d.ts +1 -1
- package/dist/core/resources.d.ts +56 -6
- package/dist/core/resources.js +81 -5
- package/dist/core/run-state.js +9 -0
- package/dist/core/run.d.ts +77 -15
- package/dist/core/run.js +150 -86
- package/dist/core/sandbox-end.d.ts +64 -0
- package/dist/core/sandbox-end.js +128 -0
- package/dist/core/timeline.d.ts +4 -4
- package/dist/core/timeline.js +3 -3
- package/dist/credential/live/vercel-cli-gateway.d.ts +7 -0
- package/dist/credential/live/vercel-cli-gateway.js +14 -1
- package/dist/extensions/github/context.d.ts +1 -1
- package/dist/extensions/github/definition.d.ts +11 -9
- package/dist/extensions/github/definition.js +8 -6
- package/dist/extensions/github/extension.d.ts +3 -3
- package/dist/extensions/github/fixture-repo.d.ts +21 -2
- package/dist/extensions/github/fixture-repo.js +31 -2
- package/dist/extensions/github/index.d.ts +2 -2
- package/dist/extensions/github/index.js +2 -2
- package/dist/extensions/github/lifecycle.d.ts +16 -6
- package/dist/extensions/github/lifecycle.js +42 -25
- package/dist/extensions/github/options.d.ts +17 -11
- package/dist/extensions/github/options.js +14 -13
- package/dist/extensions/github/refusals.d.ts +23 -6
- package/dist/extensions/github/refusals.js +34 -12
- package/dist/extensions/github/resource.d.ts +21 -12
- package/dist/extensions/github/resource.js +16 -8
- package/dist/extensions/github/run/payload.d.ts +6 -6
- package/dist/extensions/github/run/payload.js +3 -5
- package/dist/extensions/github/split.d.ts +10 -0
- package/dist/extensions/github/split.js +12 -0
- package/dist/extensions/playwright/driver.js +6 -26
- package/dist/extensions/playwright/extension.js +1 -1
- package/dist/extensions/testserver/commands/pool/create/command.js +8 -8
- package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
- package/dist/extensions/testserver/definition.d.ts +4 -4
- package/dist/extensions/testserver/definition.js +41 -31
- package/dist/extensions/testserver/extension.d.ts +4 -5
- package/dist/extensions/testserver/extension.js +14 -41
- package/dist/extensions/testserver/index.d.ts +1 -1
- package/dist/extensions/testserver/index.js +1 -1
- package/dist/extensions/testserver/lifecycle.d.ts +10 -2
- package/dist/extensions/testserver/lifecycle.js +29 -6
- package/dist/extensions/testserver/options/rules.d.ts +5 -5
- package/dist/extensions/testserver/options/rules.js +10 -8
- package/dist/extensions/testserver/options/sandboxes.d.ts +4 -2
- package/dist/extensions/testserver/options/sandboxes.js +8 -3
- package/dist/extensions/testserver/pool/gateways.d.ts +29 -4
- package/dist/extensions/testserver/pool/index.d.ts +2 -2
- package/dist/extensions/testserver/pool/index.js +1 -1
- package/dist/extensions/testserver/pool/lease.d.ts +10 -0
- package/dist/extensions/testserver/pool/lease.js +21 -0
- package/dist/extensions/testserver/pool/live/pool-store-gateway.js +38 -3
- package/dist/extensions/testserver/refusals.d.ts +12 -0
- package/dist/extensions/testserver/refusals.js +18 -0
- package/dist/extensions/testserver/release.d.ts +16 -0
- package/dist/extensions/testserver/release.js +56 -4
- package/dist/extensions/testserver/resource.d.ts +4 -4
- package/dist/extensions/testserver/resource.js +1 -1
- package/dist/extensions/testserver/split.d.ts +9 -0
- package/dist/extensions/testserver/split.js +22 -0
- package/dist/extensions/testserver/vitest/fixtures.d.ts +5 -5
- package/dist/extensions/testserver/vitest/fixtures.js +9 -38
- package/dist/extensions/vitest/driver.d.ts +7 -0
- package/dist/extensions/vitest/driver.js +33 -37
- package/dist/extensions/vitest/extension.js +1 -1
- package/dist/extensions/vitest/plan/plan-over.d.ts +8 -1
- package/dist/extensions/vitest/plan/plan-over.js +16 -2
- package/dist/extensions.d.ts +17 -16
- package/dist/extensions.js +5 -4
- package/dist/forward-sigterm.js +1 -1
- package/dist/launcher-resolvers/local-services.d.ts +1 -1
- package/dist/live-app.js +4 -3
- package/dist/local-services.js +1 -1
- package/dist/planning/driver-file-lists.d.ts +61 -0
- package/dist/planning/driver-file-lists.js +66 -0
- package/dist/{commands/exec → planning}/driver-refusals.d.ts +11 -10
- package/dist/{commands/exec → planning}/driver-refusals.js +18 -14
- package/dist/planning/file-lists-file.d.ts +58 -0
- package/dist/planning/file-lists-file.js +105 -0
- package/dist/planning/file-lists.d.ts +28 -0
- package/dist/planning/file-lists.js +52 -0
- package/dist/{commands/exec → planning}/final-results.d.ts +1 -1
- package/dist/{commands/exec → planning}/final-results.js +6 -6
- package/dist/planning/plan-only.d.ts +81 -0
- package/dist/planning/plan-only.js +83 -0
- package/dist/{commands/exec → planning}/redaction.d.ts +2 -2
- package/dist/{commands/exec → planning}/redaction.js +5 -4
- package/dist/{commands/exec → planning}/resource-flags.d.ts +5 -12
- package/dist/{commands/exec → planning}/resource-flags.js +6 -16
- package/dist/planning/run-kind-flags.d.ts +20 -0
- package/dist/planning/run-kind-flags.js +48 -0
- package/dist/planning/run-plan.d.ts +30 -0
- package/dist/planning/run-plan.js +4 -0
- package/dist/planning/sandbox-placeholders.d.ts +22 -0
- package/dist/planning/sandbox-placeholders.js +60 -0
- package/dist/planning/suite-not-found.d.ts +37 -0
- package/dist/planning/suite-not-found.js +36 -0
- package/dist/planning/suites.d.ts +43 -0
- package/dist/planning/suites.js +89 -0
- package/dist/{commands/exec → planning}/test-plan.d.ts +8 -3
- package/dist/{commands/exec → planning}/test-plan.js +32 -4
- package/dist/playwright/reporter.d.ts +20 -8
- package/dist/playwright/reporter.js +195 -15
- package/dist/presentation.d.ts +10 -6
- package/dist/presentation.js +13 -15
- package/dist/run-directory/gateways.d.ts +60 -4
- package/dist/run-directory/index.d.ts +4 -4
- package/dist/run-directory/index.js +2 -1
- package/dist/run-directory/live/run-directory-gateway.js +92 -16
- package/dist/run-directory/plan.d.ts +35 -2
- package/dist/run-directory/plan.js +44 -7
- package/dist/run-directory/reader.d.ts +26 -5
- package/dist/run-directory/reader.js +24 -1
- package/dist/run-directory/recording.d.ts +75 -49
- package/dist/run-directory/recording.js +214 -28
- package/dist/run-directory/run-directory.d.ts +22 -1
- package/dist/run-directory/run-directory.js +24 -0
- package/dist/run-directory/run-record.d.ts +144 -21
- package/dist/run-directory/run-record.js +118 -19
- package/dist/run-directory/timeline-facts.js +4 -4
- package/dist/runner/build-snapshots.d.ts +7 -7
- package/dist/runner/build-snapshots.js +12 -16
- package/dist/runner/events.d.ts +29 -8
- package/dist/runner/gateways.d.ts +49 -6
- package/dist/runner/index.d.ts +6 -4
- package/dist/runner/index.js +3 -2
- package/dist/runner/live/sandbox-gateway.js +161 -31
- package/dist/runner/network-policy.d.ts +55 -0
- package/dist/runner/network-policy.js +46 -0
- package/dist/runner/policy-writes.d.ts +40 -0
- package/dist/runner/policy-writes.js +124 -0
- package/dist/runner/prepare.d.ts +6 -7
- package/dist/runner/ready.d.ts +39 -10
- package/dist/runner/ready.js +59 -47
- package/dist/runner/recipe-check.d.ts +6 -0
- package/dist/runner/recipe-check.js +29 -0
- package/dist/runner/recipe-secrets.d.ts +67 -0
- package/dist/runner/recipe-secrets.js +230 -0
- package/dist/runner/recipe.d.ts +115 -26
- package/dist/runner/recipe.js +147 -154
- package/dist/runner/sandboxed-command.d.ts +22 -8
- package/dist/runner/sandboxed-command.js +33 -10
- package/dist/runner/scope.d.ts +107 -21
- package/dist/runner/scope.js +274 -54
- package/dist/runner/secrets.d.ts +42 -31
- package/dist/runner/secrets.js +62 -40
- package/dist/runner/session.d.ts +59 -26
- package/dist/runner/session.js +82 -41
- package/dist/runner/snapshot-build.d.ts +7 -4
- package/dist/runner/snapshot-build.js +48 -28
- package/dist/runner/snapshot-choice.d.ts +37 -0
- package/dist/runner/snapshot-choice.js +38 -0
- package/dist/runner/snapshot-key.d.ts +16 -14
- package/dist/runner/snapshot-key.js +24 -18
- package/dist/runner/steps.d.ts +13 -5
- package/dist/runner/steps.js +34 -4
- package/dist/runner/time-limit.d.ts +10 -0
- package/dist/runner/time-limit.js +43 -0
- package/dist/sdk/extension/commands.d.ts +1 -7
- package/dist/sdk/extension/driver.d.ts +39 -46
- package/dist/sdk/extension/driver.js +6 -6
- package/dist/sdk/extension/index.d.ts +3 -3
- package/dist/sdk/extension/index.js +3 -4
- package/dist/sdk/extension/lifecycle.d.ts +52 -9
- package/dist/sdk/extension/lifecycle.js +1 -1
- package/dist/sdk/extension/resource-definition.d.ts +13 -10
- package/dist/sdk/extension/resource-definition.js +7 -2
- package/dist/sdk/extension/resource.d.ts +2 -2
- package/dist/sdk/extension/secret-source.d.ts +58 -0
- package/dist/sdk/extension/secret-source.js +78 -0
- package/dist/sdk/index.d.ts +2 -2
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/run/launcher.d.ts +1 -1
- package/dist/sdk/run/launcher.js +1 -1
- package/dist/sdk/run/payload.d.ts +16 -1
- package/dist/sdk/run/payload.js +17 -2
- package/dist/sdk/run/redact.js +2 -2
- package/dist/sdk/run/test-events.d.ts +23 -6
- package/dist/sdk/run/test-events.js +6 -4
- package/dist/sdk/run/test-result-writer.d.ts +8 -3
- package/dist/sdk/run/test-result-writer.js +22 -2
- package/dist/{commands/exec → shared}/cleanup.d.ts +3 -3
- package/dist/{commands/exec → shared}/cleanup.js +11 -6
- package/dist/shared/job-summary.d.ts +19 -0
- package/dist/{commands/exec → shared}/job-summary.js +17 -0
- package/dist/shared/sandbox-table.d.ts +48 -0
- package/dist/shared/sandbox-table.js +109 -0
- package/dist/{commands/exec → shared}/snapshot-text.d.ts +1 -1
- package/dist/{commands/exec → shared}/tests-summary.d.ts +22 -6
- package/dist/{commands/exec → shared}/tests-summary.js +74 -31
- package/dist/{commands/exec → shared}/text.d.ts +7 -2
- package/dist/{commands/exec → shared}/text.js +9 -1
- package/dist/{commands/exec → shared}/waterfall.d.ts +8 -6
- package/dist/{commands/exec → shared}/waterfall.js +71 -24
- package/dist/shared/worker-chart.d.ts +172 -0
- package/dist/shared/worker-chart.js +623 -0
- package/dist/vitest/config.d.ts +35 -11
- package/dist/vitest/config.js +47 -14
- package/dist/vitest/index.d.ts +1 -1
- package/dist/vitest/index.js +3 -3
- package/dist/vitest/sequencer.d.ts +23 -0
- package/dist/vitest/sequencer.js +73 -0
- package/dist/vitest/setup.d.ts +1 -0
- package/dist/vitest/setup.js +34 -0
- package/dist/vitest/test-events.d.ts +32 -6
- package/dist/vitest/test-events.js +25 -5
- package/dist/vitest/test-results.d.ts +8 -3
- package/dist/vitest/test-results.js +6 -0
- package/package.json +7 -2
- package/skills/overview.md +21 -17
- package/skills/plan-runs.md +67 -0
- package/skills/read-run-output.md +51 -19
- package/dist/chunks/chunk-E3QU74NX.js +0 -49
- package/dist/chunks/chunk-HP54VHGY.js +0 -201
- package/dist/chunks/chunk-NMVODY3P.js +0 -19
- package/dist/chunks/chunk-TVMEKVOW.js +0 -607
- package/dist/commands/exec/define-run-command.d.ts +0 -671
- package/dist/commands/exec/define-run-command.js +0 -91
- package/dist/commands/exec/job-summary.d.ts +0 -10
- package/dist/commands/exec/worker-chart.d.ts +0 -87
- package/dist/commands/exec/worker-chart.js +0 -343
- package/dist/commands/playwright/command.d.ts +0 -661
- package/dist/commands/playwright/command.js +0 -31
- package/dist/commands/playwright/metadata.js +0 -8
- package/dist/commands/vitest/command.d.ts +0 -662
- package/dist/commands/vitest/command.js +0 -31
- package/dist/commands/vitest/metadata.js +0 -8
- package/dist/sdk/extension/ci.d.ts +0 -2
- package/dist/sdk/extension/ci.js +0 -6
- package/dist/chunks/{chunk-YM6TZV4L.js → chunk-VL7WFTVQ.js} +52 -52
- package/dist/commands/{playwright → suites}/metadata.d.ts +1 -1
- package/dist/commands/{vitest → test}/metadata.d.ts +1 -1
- /package/dist/{commands → shared}/dashboard.d.ts +0 -0
- /package/dist/{commands → shared}/dashboard.js +0 -0
- /package/dist/{commands/exec → shared}/snapshot-text.js +0 -0
package/dist/sdk/run/launcher.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
// folders use of the run payload and the redaction of secrets, and what an extension's run side reads the run payload
|
|
3
3
|
// with (`readRunPayload`). It is not a published export: a command and a support library import `../index.ts`,
|
|
4
4
|
// `@vercel/storm/sdk`.
|
|
5
|
-
export { readRunPayload, RUN_PAYLOAD_VARIABLE } from "./payload.js";
|
|
5
|
+
export { readRunPayload, RUN_PAYLOAD_VARIABLE, } from "./payload.js";
|
|
6
6
|
export { parseTestEvent, testEventLine, } from "./test-events.js";
|
|
7
7
|
export { redactSecrets } from "./redact.js";
|
|
@@ -2,14 +2,28 @@ import type { Present } from "./present.ts";
|
|
|
2
2
|
import { type PayloadContract } from "./contract.ts";
|
|
3
3
|
/**
|
|
4
4
|
* The run payload, version 3, as a command reads it: where the command may append test events (`testEvents`, a file
|
|
5
|
-
* path), when the run follows them; whether the run is verbose (`verbose`, under `storm
|
|
5
|
+
* path), when the run follows them; whether the run is verbose (`verbose`, under `storm test --verbose` or
|
|
6
6
|
* `storm exec --verbose`), so the command prints what each test did as it goes, passing or not; and what each acquired
|
|
7
7
|
* resource instance hands the command, read by its definition with `get`.
|
|
8
8
|
*/
|
|
9
|
+
/** Which runner sandbox the command runs in, and its file list, in the run payload of a run across runner sandboxes. */
|
|
10
|
+
export interface RunPayloadSandbox {
|
|
11
|
+
/** The runner sandbox index, counting from 0. */
|
|
12
|
+
readonly index: number;
|
|
13
|
+
/** Total number of runner sandboxes in this run. */
|
|
14
|
+
readonly count: number;
|
|
15
|
+
/** This runner sandbox's file list, as paths relative to the project; absent when the run has no file lists. */
|
|
16
|
+
readonly files?: readonly string[];
|
|
17
|
+
}
|
|
9
18
|
export interface RunPayload {
|
|
10
19
|
readonly version: 3;
|
|
11
20
|
readonly testEvents?: string;
|
|
12
21
|
readonly verbose?: true;
|
|
22
|
+
/**
|
|
23
|
+
* In a run across runner sandboxes, this runner sandbox's runner sandbox index, the number of runner sandboxes, and
|
|
24
|
+
* its file list when it has one.
|
|
25
|
+
*/
|
|
26
|
+
readonly sandbox?: RunPayloadSandbox;
|
|
13
27
|
/**
|
|
14
28
|
* The section the run payload holds for the default resource of payload contract `contract`'s resource, the
|
|
15
29
|
* resource keyed by its name: `{ present: true, value }` with the section, checked by the contract's payload check,
|
|
@@ -34,6 +48,7 @@ export interface RunPayloadJson<Resources extends object = Readonly<Record<strin
|
|
|
34
48
|
readonly resources: Resources;
|
|
35
49
|
readonly testEvents?: string;
|
|
36
50
|
readonly verbose?: true;
|
|
51
|
+
readonly sandbox?: RunPayloadSandbox;
|
|
37
52
|
}
|
|
38
53
|
/** The variable a run hands its command the run payload in. */
|
|
39
54
|
export declare const RUN_PAYLOAD_VARIABLE = "STORM_RUN";
|
package/dist/sdk/run/payload.js
CHANGED
|
@@ -8,11 +8,17 @@ const RUN_PAYLOAD_VERSION = 3;
|
|
|
8
8
|
* What `readRunPayload` checks: the version, that each resource instance under `resources` names its definition, and
|
|
9
9
|
* `testEvents` and `verbose`.
|
|
10
10
|
*/
|
|
11
|
+
const runPayloadSandboxSchema = z.object({
|
|
12
|
+
index: z.number().int().nonnegative(),
|
|
13
|
+
count: z.number().int().positive(),
|
|
14
|
+
files: z.array(z.string().min(1)).optional(),
|
|
15
|
+
});
|
|
11
16
|
const runPayloadSchema = z.object({
|
|
12
17
|
version: z.literal(RUN_PAYLOAD_VERSION),
|
|
13
18
|
resources: z.record(z.string(), z.object({ definition: z.string().min(1), payload: z.unknown() })),
|
|
14
19
|
testEvents: z.string().min(1).optional(),
|
|
15
20
|
verbose: z.literal(true).optional(),
|
|
21
|
+
sandbox: runPayloadSandboxSchema.optional(),
|
|
16
22
|
});
|
|
17
23
|
/**
|
|
18
24
|
* `readRunPayload` found `STORM_RUN` missing, not JSON, or not a version 3 run payload, or an instance of another
|
|
@@ -30,7 +36,7 @@ export class RunPayloadError extends Error {
|
|
|
30
36
|
export function readRunPayload(env = process.env) {
|
|
31
37
|
const raw = env[RUN_PAYLOAD_VARIABLE];
|
|
32
38
|
if (raw === undefined || raw === "") {
|
|
33
|
-
throw new RunPayloadError(`${RUN_PAYLOAD_VARIABLE} is not set: run this command under \`storm
|
|
39
|
+
throw new RunPayloadError(`${RUN_PAYLOAD_VARIABLE} is not set: run this command under \`storm test\` or \`storm exec\``);
|
|
34
40
|
}
|
|
35
41
|
let json;
|
|
36
42
|
try {
|
|
@@ -47,11 +53,20 @@ export function readRunPayload(env = process.env) {
|
|
|
47
53
|
const issue = parsed.error.issues[0];
|
|
48
54
|
throw notValid(issue?.path ?? [], issue?.message ?? "invalid");
|
|
49
55
|
}
|
|
50
|
-
const { resources, testEvents, verbose } = parsed.data;
|
|
56
|
+
const { resources, testEvents, verbose, sandbox } = parsed.data;
|
|
51
57
|
return {
|
|
52
58
|
version: RUN_PAYLOAD_VERSION,
|
|
53
59
|
...(testEvents === undefined ? {} : { testEvents }),
|
|
54
60
|
...(verbose === undefined ? {} : { verbose }),
|
|
61
|
+
...(sandbox === undefined
|
|
62
|
+
? {}
|
|
63
|
+
: {
|
|
64
|
+
sandbox: {
|
|
65
|
+
index: sandbox.index,
|
|
66
|
+
count: sandbox.count,
|
|
67
|
+
...(sandbox.files === undefined ? {} : { files: [...sandbox.files] }),
|
|
68
|
+
},
|
|
69
|
+
}),
|
|
55
70
|
get(contract) {
|
|
56
71
|
const key = defaultResourceKey(contract);
|
|
57
72
|
const instance = Object.hasOwn(resources, key) ? resources[key] : undefined;
|
package/dist/sdk/run/redact.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// Hiding secrets in text: storm shows a
|
|
2
|
-
// run prints and writes.
|
|
1
|
+
// Hiding secrets in text: storm shows a secret, such as a resource's token or a sandbox credential's value, as
|
|
2
|
+
// `<token>` wherever it appears in what a run prints and writes.
|
|
3
3
|
/** What a hidden secret reads as. */
|
|
4
4
|
const REDACTED = "<token>";
|
|
5
5
|
/**
|
|
@@ -7,9 +7,11 @@ export type TestEventState = "pass" | "fail" | "skip";
|
|
|
7
7
|
* epoch).
|
|
8
8
|
*
|
|
9
9
|
* - `file-started` and `file-finished`: the worker started and finished the file.
|
|
10
|
-
* - `test-started`: the worker started an attempt at test `test`, one of the file's `fileTests` tests.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* - `test-started`: the worker started an attempt at test `test`, one of the file's `fileTests` tests. `id` is the
|
|
11
|
+
* test runner's id for the test, unique within the run and the same as its final result's (`TestResultEvent.id`),
|
|
12
|
+
* so a reader joins a test's attempts to its final result by it; `test` is the test's name, for display only.
|
|
13
|
+
* - `test-attempt-finished`: that attempt, by the same `id`, ended `state` after `ms`, any setup phase among it. A
|
|
14
|
+
* retried test reports one for each attempt, so these are not the test's final result.
|
|
13
15
|
* - `setup-started` and `setup-finished`: a setup phase, in which the worker set something up for the file's tests, or
|
|
14
16
|
* for one test, before they could run. Its writer supplies two names: `label`, what it set up, a singular noun the
|
|
15
17
|
* launcher prints as it is (`<label> starts 5`, `waiting on a <label>`), and `resource`, the name of the resource
|
|
@@ -32,6 +34,7 @@ export type WorkerTestEvent = {
|
|
|
32
34
|
readonly file: string;
|
|
33
35
|
readonly worker: number;
|
|
34
36
|
readonly at: number;
|
|
37
|
+
readonly id: string;
|
|
35
38
|
readonly test: string;
|
|
36
39
|
readonly fileTests: number;
|
|
37
40
|
} | {
|
|
@@ -39,6 +42,7 @@ export type WorkerTestEvent = {
|
|
|
39
42
|
readonly file: string;
|
|
40
43
|
readonly worker: number;
|
|
41
44
|
readonly at: number;
|
|
45
|
+
readonly id: string;
|
|
42
46
|
readonly test: string;
|
|
43
47
|
readonly state: TestEventState;
|
|
44
48
|
readonly ms: number;
|
|
@@ -96,12 +100,25 @@ export interface TestResultEvent {
|
|
|
96
100
|
readonly errors?: readonly TestResultError[];
|
|
97
101
|
readonly output?: TestResultOutput;
|
|
98
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* A test file's start or finish reported by the test runner's main process, where no worker index is known.
|
|
105
|
+
* A worker's own `file-started` / `file-finished` event carries `worker` (`WorkerTestEvent`).
|
|
106
|
+
*/
|
|
107
|
+
export type FileTimingEvent = {
|
|
108
|
+
readonly kind: "file-started";
|
|
109
|
+
readonly file: string;
|
|
110
|
+
readonly at: number;
|
|
111
|
+
} | {
|
|
112
|
+
readonly kind: "file-finished";
|
|
113
|
+
readonly file: string;
|
|
114
|
+
readonly at: number;
|
|
115
|
+
};
|
|
99
116
|
/**
|
|
100
117
|
* What a command's test runner reports as it goes, one JSON object a line, appended to the run payload's
|
|
101
|
-
* `testEvents` file: a worker's progress through a file (`WorkerTestEvent`),
|
|
102
|
-
* (`TestResultEvent`).
|
|
118
|
+
* `testEvents` file: a worker's progress through a file (`WorkerTestEvent`), a main-process file start or finish
|
|
119
|
+
* (`FileTimingEvent`), or a test's final result (`TestResultEvent`).
|
|
103
120
|
*/
|
|
104
|
-
export type TestEvent = WorkerTestEvent | TestResultEvent;
|
|
121
|
+
export type TestEvent = WorkerTestEvent | FileTimingEvent | TestResultEvent;
|
|
105
122
|
/** The line a test event is appended as: its JSON, without a newline. */
|
|
106
123
|
export declare function testEventLine(event: TestEvent): string;
|
|
107
124
|
/** The test event on `line`, or undefined when it holds none: not JSON, or not an event this SDK knows. */
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
const where = { file: z.string(), worker: z.number().int().nonnegative(), at: z.number() };
|
|
3
|
+
const fileWhere = { file: z.string(), worker: z.number().int().nonnegative().exactOptional(), at: z.number() };
|
|
4
|
+
const attempt = { id: z.string().min(1), test: z.string() };
|
|
3
5
|
const setup = { label: z.string().min(1), resource: z.string().min(1) };
|
|
4
6
|
const state = z.enum(["pass", "fail", "skip"]);
|
|
5
7
|
const testEventSchema = z.discriminatedUnion("kind", [
|
|
6
|
-
z.object({ kind: z.literal("file-started"), ...
|
|
7
|
-
z.object({ kind: z.literal("file-finished"), ...
|
|
8
|
-
z.object({ kind: z.literal("test-started"), ...where,
|
|
8
|
+
z.object({ kind: z.literal("file-started"), ...fileWhere }),
|
|
9
|
+
z.object({ kind: z.literal("file-finished"), ...fileWhere }),
|
|
10
|
+
z.object({ kind: z.literal("test-started"), ...where, ...attempt, fileTests: z.number().int().nonnegative() }),
|
|
9
11
|
z.object({
|
|
10
12
|
kind: z.literal("test-attempt-finished"),
|
|
11
13
|
...where,
|
|
12
|
-
|
|
14
|
+
...attempt,
|
|
13
15
|
state,
|
|
14
16
|
ms: z.number().nonnegative(),
|
|
15
17
|
}),
|
|
@@ -44,10 +44,15 @@ export interface TestResultWriter {
|
|
|
44
44
|
/** Keeps `content`, a console write the test `id` made, as the end of its test output so far. */
|
|
45
45
|
output(id: string, content: string): void;
|
|
46
46
|
/**
|
|
47
|
-
* Appends the test's final result as a `test-result` event, with the time
|
|
48
|
-
* output, and drops any later result for the same `id`. A result that can't be written as a
|
|
47
|
+
* Appends the test's final result as a `test-result` event, with the time (`at`, defaulting to `now()`), its errors
|
|
48
|
+
* cut to size and its test output, and drops any later result for the same `id`. A result that can't be written as a
|
|
49
|
+
* line is dropped alone.
|
|
49
50
|
*/
|
|
50
|
-
write(result: ReportedTestResult): void;
|
|
51
|
+
write(result: ReportedTestResult, at?: number): void;
|
|
52
|
+
/** Appends a main-process `file-started` event for `file` (no worker index). */
|
|
53
|
+
fileStarted(file: string): void;
|
|
54
|
+
/** Appends a main-process `file-finished` event for `file` (no worker index), at `at` (defaulting to `now()`). */
|
|
55
|
+
fileFinished(file: string, at?: number): void;
|
|
51
56
|
/** Drops the test output held for tests no result was written for, once the test run has ended. */
|
|
52
57
|
end(): void;
|
|
53
58
|
}
|
|
@@ -46,7 +46,7 @@ export function testResultWriter(env, append = (path, text) => appendFileSync(pa
|
|
|
46
46
|
// result is cut to the limit.
|
|
47
47
|
outputs.set(id, grown.text.length > 2 * OUTPUT_CHARS ? keepLast(grown, OUTPUT_CHARS) : grown);
|
|
48
48
|
},
|
|
49
|
-
write: (result) => {
|
|
49
|
+
write: (result, at) => {
|
|
50
50
|
if (path === undefined || !accepts(result.id))
|
|
51
51
|
return;
|
|
52
52
|
written.add(result.id);
|
|
@@ -64,7 +64,7 @@ export function testResultWriter(env, append = (path, text) => appendFileSync(pa
|
|
|
64
64
|
state: result.state,
|
|
65
65
|
retryCount: result.retryCount,
|
|
66
66
|
flaky: result.flaky,
|
|
67
|
-
at: now(),
|
|
67
|
+
at: at ?? now(),
|
|
68
68
|
...(errors.length > 0 ? { errors } : {}),
|
|
69
69
|
...(output === undefined ? {} : { output }),
|
|
70
70
|
});
|
|
@@ -80,6 +80,26 @@ export function testResultWriter(env, append = (path, text) => appendFileSync(pa
|
|
|
80
80
|
failed = true;
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
|
+
fileStarted: (file) => {
|
|
84
|
+
if (path === undefined || failed || file === "")
|
|
85
|
+
return;
|
|
86
|
+
try {
|
|
87
|
+
append(path, `${testEventLine({ kind: "file-started", file, at: now() })}\n`);
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
failed = true;
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
fileFinished: (file, at) => {
|
|
94
|
+
if (path === undefined || failed || file === "")
|
|
95
|
+
return;
|
|
96
|
+
try {
|
|
97
|
+
append(path, `${testEventLine({ kind: "file-finished", file, at: at ?? now() })}\n`);
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
failed = true;
|
|
101
|
+
}
|
|
102
|
+
},
|
|
83
103
|
end: () => {
|
|
84
104
|
outputs.clear();
|
|
85
105
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Row } from "@vercel/clinkr";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import type { InstanceWarnings, ResourceCleanupRecords, RunnerCleanupFacts } from "
|
|
3
|
+
import type { InstanceWarnings, ResourceCleanupRecords, RunnerCleanupFacts } from "../core/index.ts";
|
|
4
4
|
/** One of the runner's sandboxes the run couldn't stop; its own timeout stops it. */
|
|
5
5
|
declare const notStoppedSchema: z.ZodObject<{
|
|
6
6
|
name: z.ZodString;
|
|
@@ -20,7 +20,7 @@ declare const notDeletedSchema: z.ZodObject<{
|
|
|
20
20
|
}>;
|
|
21
21
|
message: z.ZodString;
|
|
22
22
|
}, z.core.$strip>;
|
|
23
|
-
/** The runner sandbox the run kept running once it ended, so a person can connect to it. */
|
|
23
|
+
/** The runner sandbox the run kept running once it ended, with no network access, so a person can connect to it. */
|
|
24
24
|
declare const keptSchema: z.ZodObject<{
|
|
25
25
|
name: z.ZodString;
|
|
26
26
|
stopsAt: z.ZodString;
|
|
@@ -77,7 +77,7 @@ export declare function notKeptText(sandbox: z.infer<typeof notKeptSchema>): str
|
|
|
77
77
|
* Rows for the runner sandbox the run kept running, or couldn't keep, and the runner's sandboxes that couldn't be
|
|
78
78
|
* stopped or deleted, when there are any.
|
|
79
79
|
*/
|
|
80
|
-
export declare function runnerCleanupRows(cleanup: RunnerCleanup | null): (readonly ["
|
|
80
|
+
export declare function runnerCleanupRows(cleanup: RunnerCleanup | null): (readonly ["Runner sandbox kept", readonly [`${string}, running until ${string}, with no network access`, string]] | readonly ["Runner sandbox not kept", string] | readonly ["Sandboxes not deleted", string[]] | readonly ["Sandboxes not stopped", string[]])[];
|
|
81
81
|
/** Warnings for the runner sandbox the run couldn't keep running, and the sandboxes that couldn't be stopped or deleted. */
|
|
82
82
|
export declare function runnerCleanupWarnings(cleanup: RunnerCleanup | null): {
|
|
83
83
|
reason: string;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
// among them (`resource-refusals.ts`). `RUN_CLEANUP` is the run's cleanup over the resource definition set's resource
|
|
8
8
|
// reports (`DEFINITION_SET.reports`, `src/extensions.ts`).
|
|
9
9
|
import { z } from "zod";
|
|
10
|
-
import { DEFINITION_SET } from "
|
|
11
|
-
import { sandboxConnectPage } from "
|
|
10
|
+
import { DEFINITION_SET } from "../extensions.js";
|
|
11
|
+
import { sandboxConnectPage } from "./dashboard.js";
|
|
12
12
|
import { isoSecondsText } from "./text.js";
|
|
13
13
|
/** One of the runner's sandboxes the run couldn't stop; its own timeout stops it. */
|
|
14
14
|
const notStoppedSchema = z.object({
|
|
@@ -24,7 +24,7 @@ const notDeletedSchema = z.object({
|
|
|
24
24
|
role: z.enum(["runner", "snapshot-build"]),
|
|
25
25
|
message: z.string(),
|
|
26
26
|
});
|
|
27
|
-
/** The runner sandbox the run kept running once it ended, so a person can connect to it. */
|
|
27
|
+
/** The runner sandbox the run kept running once it ended, with no network access, so a person can connect to it. */
|
|
28
28
|
const keptSchema = z.object({
|
|
29
29
|
name: z.string(),
|
|
30
30
|
/** When its timeout stops it, as an ISO time: the keep time from when the run ended, or later. */
|
|
@@ -58,7 +58,7 @@ export function notDeletedText(sandbox) {
|
|
|
58
58
|
}
|
|
59
59
|
/** The runner sandbox a run kept running, as a sentence. */
|
|
60
60
|
export function keptText(kept) {
|
|
61
|
-
return `Kept the runner sandbox ${kept.name} running until ${isoSecondsText(kept.stopsAt)}, so you can connect to it: ${kept.url}`;
|
|
61
|
+
return `Kept the runner sandbox ${kept.name} running until ${isoSecondsText(kept.stopsAt)}, with no network access, so you can connect to it: ${kept.url}`;
|
|
62
62
|
}
|
|
63
63
|
/** The runner sandbox a run couldn't keep running, as a sentence. */
|
|
64
64
|
export function notKeptText(sandbox) {
|
|
@@ -75,8 +75,13 @@ export function runnerCleanupRows(cleanup) {
|
|
|
75
75
|
return [
|
|
76
76
|
...(kept === null
|
|
77
77
|
? []
|
|
78
|
-
: [
|
|
79
|
-
|
|
78
|
+
: [
|
|
79
|
+
[
|
|
80
|
+
"Runner sandbox kept",
|
|
81
|
+
[`${kept.name}, running until ${isoSecondsText(kept.stopsAt)}, with no network access`, kept.url],
|
|
82
|
+
],
|
|
83
|
+
]),
|
|
84
|
+
...(notKept === null ? [] : [["Runner sandbox not kept", notKeptText(notKept)]]),
|
|
80
85
|
...(cleanup.notStopped.length === 0
|
|
81
86
|
? []
|
|
82
87
|
: [["Sandboxes not stopped", cleanup.notStopped.map(notStoppedText)]]),
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SandboxRecord, TimelineFacts } from "../run-directory/index.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The job summary's Markdown for `timeline`, headed with the invoking command, `storm <command>`; `details` are
|
|
4
|
+
* lines after the critical path, such as the tests'.
|
|
5
|
+
*/
|
|
6
|
+
export declare function jobSummaryMarkdown(timeline: TimelineFacts, extras: {
|
|
7
|
+
readonly command: string;
|
|
8
|
+
readonly logs: string | undefined;
|
|
9
|
+
readonly details?: readonly string[];
|
|
10
|
+
}): string;
|
|
11
|
+
/**
|
|
12
|
+
* The job summary's Markdown for a run across runner sandboxes, headed with the invoking command, `storm <command>`:
|
|
13
|
+
* the runner sandbox table, the totals line, the tests' lines (`details`), and where its run directory is.
|
|
14
|
+
*/
|
|
15
|
+
export declare function acrossSandboxesJobSummaryMarkdown(records: readonly SandboxRecord[], extras: {
|
|
16
|
+
readonly command: string;
|
|
17
|
+
readonly logs: string | undefined;
|
|
18
|
+
readonly details?: readonly string[];
|
|
19
|
+
}): string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// The Markdown summary a run appends to a GitHub Actions job summary: its waterfall as a table, the critical path,
|
|
2
2
|
// and where its run directory is, so a CI run that uploads it as an artifact can find it.
|
|
3
|
+
import { SANDBOX_TABLE_HEADER, sandboxTableRows, sandboxTotalsLine } from "./sandbox-table.js";
|
|
3
4
|
import { seconds } from "./text.js";
|
|
4
5
|
import { criticalPathStep } from "./waterfall.js";
|
|
5
6
|
/**
|
|
@@ -32,3 +33,19 @@ function tableRow(row) {
|
|
|
32
33
|
const idle = row.idleMs > 0 ? seconds(row.idleMs) : "";
|
|
33
34
|
return `| ${row.label}${outcome} | +${seconds(row.startMs)} | ${seconds(row.endMs - row.startMs)} | ${idle} | ${steps} |`;
|
|
34
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* The job summary's Markdown for a run across runner sandboxes, headed with the invoking command, `storm <command>`:
|
|
38
|
+
* the runner sandbox table, the totals line, the tests' lines (`details`), and where its run directory is.
|
|
39
|
+
*/
|
|
40
|
+
export function acrossSandboxesJobSummaryMarkdown(records, extras) {
|
|
41
|
+
const lines = [`### storm ${extras.command}`, ""];
|
|
42
|
+
const rows = sandboxTableRows(records);
|
|
43
|
+
lines.push(`| ${SANDBOX_TABLE_HEADER.join(" | ")} |`, `| ${SANDBOX_TABLE_HEADER.map((_, column) => (column >= 2 && column <= 4 ? "---:" : "---")).join(" | ")} |`, ...rows.map((row) => `| ${row.map((cell) => cell.replaceAll("|", "\\|")).join(" | ")} |`), "", sandboxTotalsLine(records), "");
|
|
44
|
+
for (const detail of extras.details ?? [])
|
|
45
|
+
lines.push(`${detail.trim()} `);
|
|
46
|
+
if ((extras.details ?? []).length > 0)
|
|
47
|
+
lines.push("");
|
|
48
|
+
if (extras.logs !== undefined)
|
|
49
|
+
lines.push(`Run directory: \`${extras.logs}\``, "");
|
|
50
|
+
return lines.join("\n");
|
|
51
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { SandboxRecord, SandboxState } from "../run-directory/index.ts";
|
|
2
|
+
import { type Paint } from "./text.ts";
|
|
3
|
+
/** The runner sandbox table's columns. */
|
|
4
|
+
export declare const SANDBOX_TABLE_HEADER: readonly ["RUNNER SANDBOX", "STATE", "EXIT", "PREPARED", "COMMAND", "TESTS", "NAME"];
|
|
5
|
+
/** Tests' totals, such as `5 passed · 1 failed`, `no tests`, or `-` when unknown (null). */
|
|
6
|
+
export declare function testTotalsText(totals: {
|
|
7
|
+
readonly passed: number;
|
|
8
|
+
readonly failed: number;
|
|
9
|
+
readonly skipped: number;
|
|
10
|
+
} | null): string;
|
|
11
|
+
/** A runner sandbox state as a person reads it: the state, with a space for a dash, such as `not started`. */
|
|
12
|
+
export declare function sandboxStateText(state: SandboxState): string;
|
|
13
|
+
/** `count` runner sandboxes, such as `1 runner sandbox` or `2 runner sandboxes`. */
|
|
14
|
+
export declare function sandboxesText(count: number): string;
|
|
15
|
+
/**
|
|
16
|
+
* What follows the exit status of a run across runner sandboxes that has ended: how many of its runner sandboxes
|
|
17
|
+
* passed, such as ` (1 of 2 runner sandboxes passed)`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function sandboxesPassedText(sandboxes: readonly Pick<SandboxRecord, "state">[]): string;
|
|
20
|
+
/**
|
|
21
|
+
* Where a run across runner sandboxes ran its commands: `2 runner sandboxes`. Once the run has ended (`ended`), only
|
|
22
|
+
* the runner sandboxes that started count, and the ones that never started are named: `1 runner sandbox, 1 not
|
|
23
|
+
* started`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function startedSandboxesText(sandboxes: readonly Pick<SandboxRecord, "name">[], ended: boolean): string;
|
|
26
|
+
/** What a row of the runner sandbox table reads of a runner sandbox's record. */
|
|
27
|
+
export type SandboxTableRecord = Pick<SandboxRecord, "sandbox" | "state" | "exitCode" | "preparedMs" | "commandMs" | "tests" | "name" | "keptUntil">;
|
|
28
|
+
/**
|
|
29
|
+
* The runner sandbox table's rows, one for each runner sandbox, under `SANDBOX_TABLE_HEADER`: its runner sandbox index,
|
|
30
|
+
* its runner sandbox state, its command's exit code, the time from the run's start to its command's start, how long its
|
|
31
|
+
* command took, its tests' totals, and its runner sandbox, with until when the run kept it; `-` for each that is
|
|
32
|
+
* unknown.
|
|
33
|
+
*/
|
|
34
|
+
export declare function sandboxTableRows(sandboxes: readonly SandboxTableRecord[]): string[][];
|
|
35
|
+
/**
|
|
36
|
+
* Why a runner sandbox is in its runner sandbox state, as one line: its record's cause, or for a runner sandbox whose
|
|
37
|
+
* command exited, the exit code; `-` when neither is known, such as for a pending runner sandbox.
|
|
38
|
+
*/
|
|
39
|
+
export declare function sandboxCauseText(sandbox: Pick<SandboxRecord, "cause" | "exitCode">): string;
|
|
40
|
+
/**
|
|
41
|
+
* How many runner sandboxes are in each runner sandbox state, as the totals line says it: `3 runner sandboxes: 2
|
|
42
|
+
* passed, 1 failed`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function sandboxTotalsLine(records: readonly Pick<SandboxRecord, "state">[]): string;
|
|
45
|
+
/**
|
|
46
|
+
* The runner sandbox table as lines, under its header, each column as wide as its widest cell, the state in its color.
|
|
47
|
+
*/
|
|
48
|
+
export declare function sandboxTableLines(records: readonly SandboxRecord[], style?: Paint): string[];
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// Shared formatting for the summaries and tables of a run across runner sandboxes, reused by `storm runs show`, the
|
|
2
|
+
// run's end summary, and the GitHub Actions job summary with no import between `commands/exec/` and `commands/runs/`.
|
|
3
|
+
import { isoSecondsText, paint as paintFor, seconds } from "./text.js";
|
|
4
|
+
/** The runner sandbox table's columns. */
|
|
5
|
+
export const SANDBOX_TABLE_HEADER = [
|
|
6
|
+
"RUNNER SANDBOX",
|
|
7
|
+
"STATE",
|
|
8
|
+
"EXIT",
|
|
9
|
+
"PREPARED",
|
|
10
|
+
"COMMAND",
|
|
11
|
+
"TESTS",
|
|
12
|
+
"NAME",
|
|
13
|
+
];
|
|
14
|
+
/** Tests' totals, such as `5 passed · 1 failed`, `no tests`, or `-` when unknown (null). */
|
|
15
|
+
export function testTotalsText(totals) {
|
|
16
|
+
if (totals === null)
|
|
17
|
+
return "-";
|
|
18
|
+
const parts = [
|
|
19
|
+
...(totals.passed > 0 ? [`${totals.passed} passed`] : []),
|
|
20
|
+
...(totals.failed > 0 ? [`${totals.failed} failed`] : []),
|
|
21
|
+
...(totals.skipped > 0 ? [`${totals.skipped} skipped`] : []),
|
|
22
|
+
];
|
|
23
|
+
return parts.length === 0 ? "no tests" : parts.join(" · ");
|
|
24
|
+
}
|
|
25
|
+
/** A runner sandbox state as a person reads it: the state, with a space for a dash, such as `not started`. */
|
|
26
|
+
export function sandboxStateText(state) {
|
|
27
|
+
return state.replace("-", " ");
|
|
28
|
+
}
|
|
29
|
+
/** `count` runner sandboxes, such as `1 runner sandbox` or `2 runner sandboxes`. */
|
|
30
|
+
export function sandboxesText(count) {
|
|
31
|
+
return `${count} ${count === 1 ? "runner sandbox" : "runner sandboxes"}`;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* What follows the exit status of a run across runner sandboxes that has ended: how many of its runner sandboxes
|
|
35
|
+
* passed, such as ` (1 of 2 runner sandboxes passed)`.
|
|
36
|
+
*/
|
|
37
|
+
export function sandboxesPassedText(sandboxes) {
|
|
38
|
+
const passed = sandboxes.filter(({ state }) => state === "passed").length;
|
|
39
|
+
return ` (${passed} of ${sandboxesText(sandboxes.length)} passed)`;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Where a run across runner sandboxes ran its commands: `2 runner sandboxes`. Once the run has ended (`ended`), only
|
|
43
|
+
* the runner sandboxes that started count, and the ones that never started are named: `1 runner sandbox, 1 not
|
|
44
|
+
* started`.
|
|
45
|
+
*/
|
|
46
|
+
export function startedSandboxesText(sandboxes, ended) {
|
|
47
|
+
const started = ended ? sandboxes.filter(({ name }) => name !== null).length : sandboxes.length;
|
|
48
|
+
const missing = sandboxes.length - started;
|
|
49
|
+
return `${started} runner ${started === 1 ? "sandbox" : "sandboxes"}${missing === 0 ? "" : `, ${missing} not started`}`;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The runner sandbox table's rows, one for each runner sandbox, under `SANDBOX_TABLE_HEADER`: its runner sandbox index,
|
|
53
|
+
* its runner sandbox state, its command's exit code, the time from the run's start to its command's start, how long its
|
|
54
|
+
* command took, its tests' totals, and its runner sandbox, with until when the run kept it; `-` for each that is
|
|
55
|
+
* unknown.
|
|
56
|
+
*/
|
|
57
|
+
export function sandboxTableRows(sandboxes) {
|
|
58
|
+
const time = (ms) => (ms === null ? "-" : seconds(ms));
|
|
59
|
+
return sandboxes.map((each) => [
|
|
60
|
+
String(each.sandbox),
|
|
61
|
+
sandboxStateText(each.state),
|
|
62
|
+
each.exitCode === null ? "-" : String(each.exitCode),
|
|
63
|
+
time(each.preparedMs),
|
|
64
|
+
time(each.commandMs),
|
|
65
|
+
testTotalsText(each.tests),
|
|
66
|
+
each.name === null
|
|
67
|
+
? "-"
|
|
68
|
+
: `${each.name}${each.keptUntil === null ? "" : ` (kept until ${isoSecondsText(each.keptUntil)})`}`,
|
|
69
|
+
]);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Why a runner sandbox is in its runner sandbox state, as one line: its record's cause, or for a runner sandbox whose
|
|
73
|
+
* command exited, the exit code; `-` when neither is known, such as for a pending runner sandbox.
|
|
74
|
+
*/
|
|
75
|
+
export function sandboxCauseText(sandbox) {
|
|
76
|
+
if (sandbox.cause !== null)
|
|
77
|
+
return sandbox.cause;
|
|
78
|
+
return sandbox.exitCode === null ? "-" : `the command exited ${sandbox.exitCode}`;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* How many runner sandboxes are in each runner sandbox state, as the totals line says it: `3 runner sandboxes: 2
|
|
82
|
+
* passed, 1 failed`.
|
|
83
|
+
*/
|
|
84
|
+
export function sandboxTotalsLine(records) {
|
|
85
|
+
const states = ["passed", "failed", "not-started", "canceled", "pending"];
|
|
86
|
+
const counted = states.flatMap((state) => {
|
|
87
|
+
const number = records.filter((record) => record.state === state).length;
|
|
88
|
+
return number === 0 ? [] : [`${number} ${sandboxStateText(state)}`];
|
|
89
|
+
});
|
|
90
|
+
return `${sandboxesText(records.length)}: ${counted.join(", ")}`;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The runner sandbox table as lines, under its header, each column as wide as its widest cell, the state in its color.
|
|
94
|
+
*/
|
|
95
|
+
export function sandboxTableLines(records, style = paintFor(false)) {
|
|
96
|
+
const rows = [[...SANDBOX_TABLE_HEADER], ...sandboxTableRows(records)];
|
|
97
|
+
const widths = SANDBOX_TABLE_HEADER.map((_, column) => Math.max(...rows.map((row) => row[column]?.length ?? 0)));
|
|
98
|
+
const tone = (state) => state === "passed" ? style.done : state === "canceled" || state === "pending" ? style.stopped : style.failed;
|
|
99
|
+
return rows.map((row, index) => {
|
|
100
|
+
const record = index === 0 ? undefined : records[index - 1];
|
|
101
|
+
const cells = row.map((cell, column) => {
|
|
102
|
+
const padded = column === row.length - 1 ? cell : cell.padEnd(widths[column] ?? 0);
|
|
103
|
+
if (index === 0)
|
|
104
|
+
return style.strong(padded);
|
|
105
|
+
return column === 1 && record !== undefined ? tone(record.state)(padded) : padded;
|
|
106
|
+
});
|
|
107
|
+
return ` ${cells.join(" ")}`.trimEnd();
|
|
108
|
+
});
|
|
109
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RejectedSnapshot, SnapshotCacheNote, SnapshotRejectionReason } from "
|
|
1
|
+
import type { RejectedSnapshot, SnapshotCacheNote, SnapshotRejectionReason } from "../runner/index.ts";
|
|
2
2
|
/** How many of the snapshots a run doesn't start from its build line lists, before it counts the rest. */
|
|
3
3
|
export declare const REJECTIONS_SHOWN = 5;
|
|
4
4
|
/** `count` commits, as text: `1 commit`, `24 commits`. */
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import { setupPhaseWords } from "
|
|
2
|
-
import type { DriverHints } from "
|
|
3
|
-
import type { TestEvent } from "
|
|
1
|
+
import { type SetupPhaseName, setupPhaseWords } from "../core/index.ts";
|
|
2
|
+
import type { DriverHints } from "../sdk/extension/index.ts";
|
|
3
|
+
import type { TestEvent } from "../sdk/run/launcher.ts";
|
|
4
|
+
/** One finished, successful setup phase as the setup summary counts it. */
|
|
5
|
+
export interface SetupPhaseTiming {
|
|
6
|
+
readonly label: string;
|
|
7
|
+
readonly resource: string;
|
|
8
|
+
readonly ms: number;
|
|
9
|
+
readonly warmupMs?: number | undefined;
|
|
10
|
+
}
|
|
11
|
+
/** A test event, optionally tagged with the 0-based runner sandbox index that emitted it. */
|
|
12
|
+
export type SandboxTaggedTestEvent = TestEvent & {
|
|
13
|
+
readonly sandbox?: number | undefined;
|
|
14
|
+
};
|
|
4
15
|
/**
|
|
5
16
|
* What the summary says about the tests, a line apiece: `tests`, the totals and how busy the workers were;
|
|
6
17
|
* `setups`, a line for each resource's setup phases under each label (`setupsText`); `slowest`, the slowest files;
|
|
@@ -21,7 +32,7 @@ export interface TestsSummary {
|
|
|
21
32
|
* driver (`hints`), and counts the workers' test attempts instead. `unreadable` counts the lines in the test events
|
|
22
33
|
* file that held none; `incomplete` is why the final read of the test events failed, when it did.
|
|
23
34
|
*/
|
|
24
|
-
export declare function testsSummaryLines(events: readonly
|
|
35
|
+
export declare function testsSummaryLines(events: readonly SandboxTaggedTestEvent[], hints: Pick<DriverHints, "noFinalResults">, unreadable?: number, incomplete?: string): string[];
|
|
25
36
|
/** What the summary says when the final read of the test events failed with `message`. */
|
|
26
37
|
export declare function incompleteText(message: string): string;
|
|
27
38
|
/**
|
|
@@ -35,9 +46,14 @@ export declare function noFinalResultsText(hint: string): string;
|
|
|
35
46
|
* What the summary says about the tests, from `events`, of which `unreadable` lines held none, and `incomplete`, why the
|
|
36
47
|
* final read of the test events file failed. `hints` are the run's driver's, for a run with no final result.
|
|
37
48
|
*/
|
|
38
|
-
export declare function testsSummary(events: readonly
|
|
49
|
+
export declare function testsSummary(events: readonly SandboxTaggedTestEvent[], hints: Pick<DriverHints, "noFinalResults">, unreadable?: number, incomplete?: string): TestsSummary;
|
|
39
50
|
/**
|
|
40
51
|
* How the setup phases in `events` are worded, every view's alike (`setupPhaseWords`): by label, and with the
|
|
41
52
|
* resource beside it where two resources' phases share one.
|
|
42
53
|
*/
|
|
43
|
-
export declare function setupWordsOf(events: readonly
|
|
54
|
+
export declare function setupWordsOf(events: readonly SandboxTaggedTestEvent[]): ReturnType<typeof setupPhaseWords>;
|
|
55
|
+
/**
|
|
56
|
+
* Formats one summary line per resource and setup label from finished, successful setup phases (`phases`), disambiguated
|
|
57
|
+
* against all setup phases (`allPhases`), with each group's share of `testMs` when non-zero.
|
|
58
|
+
*/
|
|
59
|
+
export declare function formatSetupPhases(phases: readonly SetupPhaseTiming[], allPhases: readonly SetupPhaseName[], testMs: number): string[];
|