@cnc-tools/storm 0.14.2 → 0.16.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-2MAD5NKK.js +108 -0
- package/dist/chunks/{chunk-HDL4WKIB.js → chunk-3L52KNQA.js} +2 -2
- package/dist/chunks/{chunk-GSC6SRTW.js → chunk-5CCP36QQ.js} +1 -1
- package/dist/chunks/{chunk-43MWZLJR.js → chunk-5VXBKPW6.js} +1 -1
- package/dist/chunks/chunk-7EENF73W.js +782 -0
- package/dist/chunks/{chunk-RA4L2ACU.js → chunk-AWBSONHB.js} +88 -34
- package/dist/chunks/chunk-CK2GZEPK.js +40 -0
- package/dist/chunks/{chunk-BRUIATTR.js → chunk-CN4EFA5J.js} +59 -12
- package/dist/chunks/{chunk-I7AN3DIJ.js → chunk-DC2CDHNK.js} +1928 -738
- package/dist/chunks/{chunk-UUBZTGLV.js → chunk-DWEAHX4T.js} +140 -130
- package/dist/chunks/{chunk-T6AZIDZD.js → chunk-F6N34UWB.js} +12 -244
- package/dist/chunks/chunk-FCQUJDA4.js +963 -0
- package/dist/chunks/{chunk-VH2POPW5.js → chunk-FOZWA52V.js} +635 -79
- package/dist/chunks/{chunk-XZCDA5PE.js → chunk-G3PHMXH5.js} +7 -2
- package/dist/chunks/{chunk-3HBPNQ4Y.js → chunk-HVNK3I45.js} +2 -2
- package/dist/chunks/chunk-OIY3DMF2.js +74 -0
- package/dist/chunks/{chunk-GJOEPJJL.js → chunk-P357TZAY.js} +446 -52
- package/dist/chunks/{chunk-UC6DULWY.js → chunk-R7XVBZOY.js} +130 -39
- package/dist/chunks/chunk-TJNFVNKR.js +246 -0
- package/dist/chunks/{chunk-RUPD4TLT.js → chunk-V4IKA3WI.js} +198 -63
- package/dist/chunks/{chunk-BW2ADH7U.js → chunk-VUPZH7J2.js} +1 -1
- package/dist/chunks/{chunk-LUOHJ3LB.js → chunk-Z5PBVG3Y.js} +1131 -468
- package/dist/chunks/{chunk-GQIL3AHY.js → chunk-ZG3WQ4UF.js} +1 -1
- package/dist/chunks/{live-app-SZGEILCQ.js → live-app-WECQOQ4C.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 +230 -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 +583 -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 +533 -73
- package/dist/commands/exec/outcomes.js +203 -67
- package/dist/commands/exec/plan-only.d.ts +10 -0
- package/dist/commands/exec/plan-only.js +45 -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 +42 -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 +344 -63
- package/dist/commands/exec/run-command.js +312 -263
- 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 +53 -10
- package/dist/commands/runs/facts.js +60 -32
- package/dist/commands/runs/list/command.d.ts +82 -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 +41 -2
- package/dist/commands/runs/logs/command.d.ts +109 -10
- 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 +52 -3
- package/dist/commands/runs/logs/outcomes.js +110 -6
- package/dist/commands/runs/past-run.d.ts +91 -11
- package/dist/commands/runs/past-run.js +149 -9
- package/dist/commands/runs/show/command.d.ts +574 -12
- 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 +279 -6
- 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 +5 -1
- 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 +163 -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 +1395 -0
- package/dist/commands/test/command.js +581 -0
- package/dist/commands/test/metadata.js +8 -0
- package/dist/commands/test/outcomes.d.ts +768 -0
- package/dist/commands/test/outcomes.js +140 -0
- package/dist/commands/test/plan.d.ts +92 -0
- package/dist/commands/test/plan.js +125 -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 +15 -0
- package/dist/config/check-runner.js +79 -0
- package/dist/config/check-suites.d.ts +14 -0
- package/dist/config/check-suites.js +100 -0
- package/dist/config/gateways.d.ts +31 -3
- package/dist/config/index.d.ts +8 -6
- package/dist/config/index.js +5 -4
- package/dist/config/live/config-gateway.js +5 -2
- 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 +32 -14
- package/dist/config/load.js +162 -116
- 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 +23 -0
- package/dist/config/runner.js +4 -0
- package/dist/config/schema.d.ts +39 -19
- package/dist/config/schema.js +50 -10
- 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/typed-options.d.ts +1 -6
- package/dist/config/typed-options.js +2 -10
- package/dist/config-file/define.d.ts +45 -24
- package/dist/config-file/define.js +9 -8
- package/dist/config-file/runner.d.ts +11 -0
- package/dist/config-file/runner.js +9 -0
- package/dist/config-file/toolchain.d.ts +13 -7
- package/dist/config-file/toolchain.js +51 -35
- 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 +6 -6
- package/dist/extensions/testserver/resource.js +3 -3
- 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 +84 -0
- package/dist/planning/plan-only.js +86 -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 +29 -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 -5
- 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/base.d.ts +0 -6
- package/dist/runner/base.js +0 -15
- package/dist/runner/build-snapshots.d.ts +7 -7
- package/dist/runner/build-snapshots.js +19 -24
- package/dist/runner/events.d.ts +29 -8
- package/dist/runner/gateways.d.ts +54 -6
- package/dist/runner/index.d.ts +6 -4
- package/dist/runner/index.js +3 -2
- package/dist/runner/live/sandbox-gateway.js +173 -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 +16 -16
- package/dist/runner/prepare.js +11 -12
- 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 +151 -63
- package/dist/runner/recipe.js +277 -200
- 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 +8 -5
- package/dist/runner/snapshot-build.js +56 -29
- package/dist/runner/snapshot-choice.d.ts +37 -0
- package/dist/runner/snapshot-choice.js +38 -0
- package/dist/runner/snapshot-inspect.d.ts +4 -4
- package/dist/runner/snapshot-inspect.js +7 -7
- package/dist/runner/snapshot-key.d.ts +27 -17
- package/dist/runner/snapshot-key.js +51 -26
- 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 +16 -12
- package/dist/sdk/extension/resource-definition.js +10 -4
- package/dist/sdk/extension/resource-factory.js +3 -4
- 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/present.d.ts +3 -3
- package/dist/sdk/run/present.js +1 -3
- 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 +23 -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/config/recipe-run.d.ts +0 -26
- package/dist/config/recipe-run.js +0 -27
- 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
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
import {
|
|
2
2
|
testserverPoolDefinition
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-R7XVBZOY.js";
|
|
4
|
+
import {
|
|
5
|
+
testserverExtensionCommands
|
|
6
|
+
} from "./chunk-ZG3WQ4UF.js";
|
|
7
|
+
import {
|
|
8
|
+
defineExtension
|
|
9
|
+
} from "./chunk-5CCP36QQ.js";
|
|
4
10
|
import {
|
|
5
11
|
driverContexts,
|
|
6
12
|
driversOf,
|
|
7
13
|
resourceDefinitionSet,
|
|
8
14
|
resourcesOf
|
|
9
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FOZWA52V.js";
|
|
10
16
|
import {
|
|
17
|
+
SECRET_MIN_LENGTH,
|
|
11
18
|
argsText,
|
|
12
19
|
booleanOption,
|
|
13
20
|
defineDriver,
|
|
14
21
|
defineResource,
|
|
22
|
+
describeSecretSource,
|
|
15
23
|
mustBe,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import {
|
|
22
|
-
defineExtension
|
|
23
|
-
} from "./chunk-GSC6SRTW.js";
|
|
24
|
+
readSecretSource,
|
|
25
|
+
readSecretSourceValue,
|
|
26
|
+
resourceFactory,
|
|
27
|
+
secretSourceSchema
|
|
28
|
+
} from "./chunk-AWBSONHB.js";
|
|
24
29
|
|
|
25
30
|
// src/extensions/github/release.ts
|
|
26
31
|
function fixtureRepoCleanupFailureText(cleanup, failure) {
|
|
@@ -44,19 +49,32 @@ function githubFixtureRepoReleased(cleaned) {
|
|
|
44
49
|
|
|
45
50
|
// src/extensions/github/refusals.ts
|
|
46
51
|
function githubTokenMissing(data) {
|
|
47
|
-
const {
|
|
52
|
+
const { source, repo, requiredBy } = data;
|
|
53
|
+
const variable = describeSecretSource(source);
|
|
48
54
|
return {
|
|
49
55
|
refused: "github_token_missing",
|
|
50
56
|
data: { ...data },
|
|
51
|
-
message: `${
|
|
57
|
+
message: `${variable} is not set: resources.githubFixtureRepo needs a token for ${repo} from it. The run didn't start.`,
|
|
52
58
|
next: [
|
|
53
59
|
{
|
|
54
60
|
type: "text",
|
|
55
|
-
text: requiredBy === "flag" ? `Set ${
|
|
61
|
+
text: requiredBy === "flag" ? `Set ${variable} to a token limited to ${repo}: --github-optional=false makes the repository required for this run.` : `Set ${variable} to a token limited to ${repo}, or let runs go on without the repository with githubFixtureRepo({ \u2026, optional: true }) or --github-optional.`
|
|
56
62
|
}
|
|
57
63
|
]
|
|
58
64
|
};
|
|
59
65
|
}
|
|
66
|
+
function githubTokenInvalid(data) {
|
|
67
|
+
const { source, repo, problem, minLength } = data;
|
|
68
|
+
const variable = describeSecretSource(source);
|
|
69
|
+
const reason = problem === "multiline" ? "holds a carriage return or a line feed" : `holds fewer than ${minLength} characters`;
|
|
70
|
+
const fix = problem === "multiline" ? `Set ${variable} to a token for ${repo} on one line: storm puts it in an HTTP header, hides it in output a line at a time, and doesn't trim it.` : `Set ${variable} to the full token for ${repo} (at least ${minLength} characters).`;
|
|
71
|
+
return {
|
|
72
|
+
refused: "github_token_invalid",
|
|
73
|
+
data: { ...data },
|
|
74
|
+
message: `${variable} ${reason}: resources.githubFixtureRepo can't use it as a token for ${repo}. The run didn't start.`,
|
|
75
|
+
next: [{ type: "text", text: fix }]
|
|
76
|
+
};
|
|
77
|
+
}
|
|
60
78
|
function githubFixtureRepoUnavailable(data) {
|
|
61
79
|
const { repo, status, message } = data;
|
|
62
80
|
return {
|
|
@@ -66,7 +84,7 @@ function githubFixtureRepoUnavailable(data) {
|
|
|
66
84
|
next: [
|
|
67
85
|
{
|
|
68
86
|
type: "text",
|
|
69
|
-
text: `Check that the token
|
|
87
|
+
text: `Check that the token from resources.githubFixtureRepo's token.source can read ${repo}, then retry.`
|
|
70
88
|
}
|
|
71
89
|
]
|
|
72
90
|
};
|
|
@@ -79,7 +97,23 @@ function fixtureRunPrefix(startedAt, suffix) {
|
|
|
79
97
|
return `${FIXTURE_RUN_PREFIX_ROOT}${stamp}-${suffix}`;
|
|
80
98
|
}
|
|
81
99
|
function fixtureRepoPayload(opened) {
|
|
82
|
-
return { url: opened.url, nameWithOwner: opened.nameWithOwner,
|
|
100
|
+
return { url: opened.url, nameWithOwner: opened.nameWithOwner, runPrefix: opened.runPrefix };
|
|
101
|
+
}
|
|
102
|
+
var GITHUB_API_HOST = "api.github.com";
|
|
103
|
+
var GITHUB_GIT_HOST = "github.com";
|
|
104
|
+
function githubBasicCredential(token) {
|
|
105
|
+
return Buffer.from(`x-access-token:${token}`, "utf8").toString("base64");
|
|
106
|
+
}
|
|
107
|
+
function fixtureRepoCredentials(token) {
|
|
108
|
+
return [
|
|
109
|
+
{ domain: GITHUB_API_HOST, header: "authorization", value: `Bearer ${token}`, requests: "all" },
|
|
110
|
+
{
|
|
111
|
+
domain: GITHUB_GIT_HOST,
|
|
112
|
+
header: "authorization",
|
|
113
|
+
value: `Basic ${githubBasicCredential(token)}`,
|
|
114
|
+
requests: "all"
|
|
115
|
+
}
|
|
116
|
+
];
|
|
83
117
|
}
|
|
84
118
|
async function openFixtureRepo(context, request, prefix) {
|
|
85
119
|
const read = await context.githubFixtureRepos.readRepo(request);
|
|
@@ -113,31 +147,45 @@ function failureText(failure) {
|
|
|
113
147
|
return failure.status === null ? failure.message : `HTTP ${failure.status}: ${failure.message}`;
|
|
114
148
|
}
|
|
115
149
|
|
|
116
|
-
// src/extensions/github/
|
|
117
|
-
function
|
|
118
|
-
|
|
119
|
-
|
|
150
|
+
// src/extensions/github/split.ts
|
|
151
|
+
function splitFixtureRepo({
|
|
152
|
+
payload,
|
|
153
|
+
sandboxes
|
|
154
|
+
}) {
|
|
155
|
+
return { parts: Array.from({ length: sandboxes }, () => payload) };
|
|
120
156
|
}
|
|
157
|
+
|
|
158
|
+
// src/extensions/github/lifecycle.ts
|
|
121
159
|
function githubFixtureRepoLifecycle(context) {
|
|
122
160
|
return {
|
|
123
|
-
// No I/O: the token, when the launcher has it, for a refusal that comes before `beforeRun`.
|
|
161
|
+
// No I/O: the token and its `Basic` form, when the launcher has it, for a refusal that comes before `beforeRun`.
|
|
124
162
|
secrets: ({ options }) => {
|
|
125
|
-
const token =
|
|
126
|
-
return token === void 0 ? [] : [token];
|
|
163
|
+
const token = readSecretSourceValue(options.token.source, context.env);
|
|
164
|
+
return token === void 0 ? [] : [token, githubBasicCredential(token)];
|
|
127
165
|
},
|
|
128
166
|
beforeRun: async ({
|
|
129
167
|
options,
|
|
130
168
|
sources
|
|
131
169
|
}) => {
|
|
132
|
-
const { repo,
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
170
|
+
const { repo, token: tokenConfig, optional } = options;
|
|
171
|
+
const { source } = tokenConfig;
|
|
172
|
+
const read = readSecretSource(source, context.env);
|
|
173
|
+
if (read.ok)
|
|
174
|
+
return {
|
|
175
|
+
use: {
|
|
176
|
+
secrets: { token: read.value, basic: githubBasicCredential(read.value) },
|
|
177
|
+
needsVercelCredential: false,
|
|
178
|
+
needsRunnerSandbox: true,
|
|
179
|
+
hiddenVariables: []
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
if (read.problem !== "missing")
|
|
183
|
+
return githubTokenInvalid({ source, repo, problem: read.problem, minLength: SECRET_MIN_LENGTH });
|
|
136
184
|
if (optional)
|
|
137
185
|
return {
|
|
138
|
-
skip: `${
|
|
186
|
+
skip: `${describeSecretSource(source)} is unset and resources.githubFixtureRepo is optional, so the run goes on without ${repo}`
|
|
139
187
|
};
|
|
140
|
-
return githubTokenMissing({
|
|
188
|
+
return githubTokenMissing({ source, repo, requiredBy: sources.optional === "flag" ? "flag" : "config" });
|
|
141
189
|
},
|
|
142
190
|
acquireForRun: async ({
|
|
143
191
|
options,
|
|
@@ -159,8 +207,11 @@ function githubFixtureRepoLifecycle(context) {
|
|
|
159
207
|
take(opened.repo);
|
|
160
208
|
const { nameWithOwner, runPrefix } = opened.repo;
|
|
161
209
|
await report.run(`GitHub fixture repository ${nameWithOwner}, the run's branches under ${runPrefix}/`);
|
|
162
|
-
return {
|
|
210
|
+
return {
|
|
211
|
+
acquired: { payload: fixtureRepoPayload(opened.repo), credentials: fixtureRepoCredentials(secrets.token) }
|
|
212
|
+
};
|
|
163
213
|
},
|
|
214
|
+
split: splitFixtureRepo,
|
|
164
215
|
releaseAfterRun: async ({
|
|
165
216
|
taken: [repo],
|
|
166
217
|
report
|
|
@@ -267,28 +318,28 @@ function liveGitHubFixtureRepoContext({ env, clock }) {
|
|
|
267
318
|
// src/extensions/github/options.ts
|
|
268
319
|
import { z as z2 } from "zod";
|
|
269
320
|
var REPO_NAME = /^[\w.-]+\/[\w.-]+$/;
|
|
270
|
-
var ENV_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
271
321
|
var REPO = "a repository as owner/name";
|
|
272
322
|
var repoName = z2.string(mustBe(REPO)).regex(REPO_NAME, mustBe(REPO));
|
|
273
|
-
var
|
|
274
|
-
var envName = z2.string(mustBe(ENV)).regex(ENV_NAME, mustBe(ENV));
|
|
323
|
+
var tokenOption = z2.strictObject({ source: secretSourceSchema }, mustBe('a token declaration, { source: { kind: "env", name } }')).readonly();
|
|
275
324
|
var githubFixtureRepoRules = {
|
|
276
325
|
/** The repository, as `owner/name`. storm creates no repository; this one must exist. */
|
|
277
326
|
repo: { schema: repoName, required: true },
|
|
278
327
|
/**
|
|
279
|
-
*
|
|
280
|
-
*
|
|
328
|
+
* Where the token for `repo` comes from (`{ source: { kind: "env", name } }`, such as
|
|
329
|
+
* `{ source: { kind: "env", name: "CNC_GITHUB_FIXTURE_TOKEN" } }`). Use a token limited to this one repository:
|
|
330
|
+
* while the command runs, the runner sandbox's firewall adds it to every request to `api.github.com` and
|
|
331
|
+
* `github.com`, so code in the sandbox can use it, though no file, environment, or run payload there holds it.
|
|
281
332
|
*/
|
|
282
|
-
|
|
333
|
+
token: { schema: tokenOption, required: true },
|
|
283
334
|
/**
|
|
284
|
-
* What a run does when `
|
|
285
|
-
* resource and says so in one line.
|
|
335
|
+
* What a run does when `token.source` is unset or empty: `false`, the default, refuses the run; `true` runs without
|
|
336
|
+
* the resource and says so in one line.
|
|
286
337
|
*/
|
|
287
338
|
optional: {
|
|
288
339
|
schema: booleanOption,
|
|
289
340
|
default: false,
|
|
290
341
|
flag: {
|
|
291
|
-
description: "Whether the run goes on without the GitHub fixture repository when the launcher environment variable its
|
|
342
|
+
description: "Whether the run goes on without the GitHub fixture repository when the launcher environment variable its token.source names is unset, overriding resources.githubFixtureRepo.optional in storm.config.ts; default false. --github-optional=false makes the repository required for this run, so a run without its token is refused with github_token_missing before anything starts. Gives the run the GitHub fixture repository resource, whose repo and token only storm.config.ts gives."
|
|
292
343
|
}
|
|
293
344
|
}
|
|
294
345
|
};
|
|
@@ -297,12 +348,11 @@ var githubFixtureRepoRules = {
|
|
|
297
348
|
var GITHUB_FIXTURE_REPO_NAME = "githubFixtureRepo";
|
|
298
349
|
function checkGitHubFixtureRepoPayload(section) {
|
|
299
350
|
if (!isObject(section)) return { ok: false, at: [], problem: "must be an object" };
|
|
300
|
-
const { url, nameWithOwner,
|
|
351
|
+
const { url, nameWithOwner, runPrefix } = section;
|
|
301
352
|
if (!filled(url)) return refused("url");
|
|
302
353
|
if (!filled(nameWithOwner)) return refused("nameWithOwner");
|
|
303
|
-
if (!filled(token)) return refused("token");
|
|
304
354
|
if (!filled(runPrefix)) return refused("runPrefix");
|
|
305
|
-
return { ok: true, value: { url, nameWithOwner,
|
|
355
|
+
return { ok: true, value: { url, nameWithOwner, runPrefix } };
|
|
306
356
|
}
|
|
307
357
|
function isObject(value) {
|
|
308
358
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -527,23 +577,6 @@ var playwrightDriver = defineDriver({
|
|
|
527
577
|
const { failure } = planned;
|
|
528
578
|
return { ok: false, kind: failure.kind, message: describePlaywrightListFailure(failure) };
|
|
529
579
|
},
|
|
530
|
-
help: {
|
|
531
|
-
usage: "[<playwright test args>...] [-- <playwright dash options>...]",
|
|
532
|
-
args: "What playwright test gets, unchanged and in order: every argument that isn't one of storm's flags, such as file filters, then everything after --, such as --project or --grep. Give file filters before --: Playwright reads each argument after --project as another project. playwright test --list gets the same arguments when it counts the tests, where storm.config.ts sets testPlan.",
|
|
533
|
-
// Nothing storm brings a Playwright project reads the run payload's `verbose`: storm's Playwright reporter never
|
|
534
|
-
// prints (`printsToStdio()` is false).
|
|
535
|
-
verbose: "which test code can read; storm's Playwright reporter prints nothing either way",
|
|
536
|
-
examples: [
|
|
537
|
-
{
|
|
538
|
-
argv: "",
|
|
539
|
-
description: "Run every test in a runner sandbox, with the runner recipe, team, project and resources from storm.config.ts. Where it sets testPlan, storm counts the tests first, and each resource that sizes itself is sized from that count."
|
|
540
|
-
},
|
|
541
|
-
{
|
|
542
|
-
argv: "--unsandboxed tests/login.spec.ts -- --project chromium",
|
|
543
|
-
description: "Run the chromium project's tests in tests/login.spec.ts on this machine."
|
|
544
|
-
}
|
|
545
|
-
]
|
|
546
|
-
},
|
|
547
580
|
hints: {
|
|
548
581
|
// No final result: the Playwright config doesn't list storm's Playwright reporter, or a `--reporter` on
|
|
549
582
|
// Playwright's command line replaced it. A config lists a reporter as a tuple of its module name.
|
|
@@ -552,17 +585,15 @@ var playwrightDriver = defineDriver({
|
|
|
552
585
|
// install storm under either of its npm names.
|
|
553
586
|
addReporter: [
|
|
554
587
|
'In the Playwright config the run loads (playwright.config.ts, or the file --config names), set reporter to a list that holds ["@vercel/storm/playwright/reporter"], as in defineConfig({ reporter: [["list"], ["@vercel/storm/playwright/reporter"]] }). If reporter already names reporters, keep them and add ["@vercel/storm/playwright/reporter"] to the list. In a package that installs storm as @cnc-tools/storm, name "@cnc-tools/storm/playwright/reporter".',
|
|
555
|
-
"Remove any --reporter from the arguments given to playwright test, since it replaces the config's reporters, storm's among them. Then run the same storm
|
|
588
|
+
"Remove any --reporter from the arguments given to playwright test, since it replaces the config's reporters, storm's among them. Then run the same storm test command again."
|
|
556
589
|
]
|
|
557
590
|
},
|
|
558
591
|
refusals: {
|
|
559
592
|
noMatchingTests: {
|
|
560
|
-
description: "storm.config.ts sets testPlan, and playwright test --list found no test for the arguments given to playwright test, so nothing was minted, acquired or started.",
|
|
561
593
|
message: ({ args, cwd }) => `playwright test --list found no test for playwright test ${argsText(args)} in ${cwd}. The command didn't run.`,
|
|
562
594
|
next: ({ args }) => `Change the arguments given to playwright test (${argsText(args)}), then retry. Put Playwright's own dash options after --.`
|
|
563
595
|
},
|
|
564
596
|
planFailed: {
|
|
565
|
-
description: "storm couldn't plan the run: playwright wasn't found, or, where storm.config.ts sets testPlan, playwright test --list failed to start, didn't finish within 120s, exited other than 0, or wrote something other than a list of tests. Nothing was minted, acquired or started.",
|
|
566
597
|
next: {
|
|
567
598
|
"start-failed": "Install @playwright/test in the package, or run the command with storm exec, which needs no playwright.",
|
|
568
599
|
"timed-out": "Check why playwright test --list doesn't finish, such as a config file that waits, then retry.",
|
|
@@ -592,60 +623,34 @@ var testserverExtension = defineExtension({
|
|
|
592
623
|
description: "Run a script in a runner sandbox against 4 Testserver sandboxes."
|
|
593
624
|
},
|
|
594
625
|
{
|
|
595
|
-
argv: "--
|
|
596
|
-
description: "Run the tests on
|
|
626
|
+
argv: "--runner launch-machine --testserver-sandboxes 4 --scope vercel --project vercel -- pnpm test",
|
|
627
|
+
description: "Run the tests on the launch machine against 4 Testserver sandboxes on the stable build channel."
|
|
597
628
|
},
|
|
598
629
|
{
|
|
599
|
-
argv: "--
|
|
630
|
+
argv: "--runner launch-machine --testserver-ttl 30m --testserver-min-time-left 25m -- pnpm test",
|
|
600
631
|
description: "Create Testserver sandboxes that live 30 minutes, with team and project from storm.config.ts."
|
|
601
632
|
},
|
|
602
633
|
{
|
|
603
|
-
argv: "--
|
|
604
|
-
description: "Run the tests on
|
|
634
|
+
argv: "--runner launch-machine --testserver-build pr:104196 -- pnpm test",
|
|
635
|
+
description: "Run the tests on the launch machine against the Testserver build of vercel/api pull request 104196's head commit."
|
|
605
636
|
},
|
|
606
637
|
{
|
|
607
|
-
argv: "--
|
|
638
|
+
argv: "--runner launch-machine --testserver-create=false --testserver-sandboxes 4 -- pnpm test",
|
|
608
639
|
description: "Run only on Testserver sandboxes already in the pool, never minting."
|
|
609
640
|
},
|
|
610
641
|
{
|
|
611
|
-
argv: "--
|
|
642
|
+
argv: "--runner launch-machine --verbose --testserver-sandboxes 2 -- pnpm test",
|
|
612
643
|
description: "Run the tests, printing each create's progress and, through storm's Vitest reporters, each test as it ends."
|
|
613
644
|
},
|
|
614
645
|
{
|
|
615
|
-
argv: "--
|
|
646
|
+
argv: "--runner launch-machine --credential github-actions --testserver-ttl 30m --testserver-min-time-left 25m -- pnpm test",
|
|
616
647
|
description: "In a GitHub Actions job, create Testserver sandboxes with a GitHub Actions OIDC token."
|
|
617
648
|
},
|
|
618
649
|
{
|
|
619
|
-
argv: "--
|
|
650
|
+
argv: "--runner launch-machine --testserver-build latest_main --testserver-min-time-left 75m --scope vercel --project vercel -- pnpm test",
|
|
620
651
|
description: "Run them on the newest main build, with Testserver sandboxes that live at least 75 more minutes."
|
|
621
652
|
}
|
|
622
|
-
]
|
|
623
|
-
drivers: {
|
|
624
|
-
vitest: [
|
|
625
|
-
{
|
|
626
|
-
argv: "--testserver-build pr:104196",
|
|
627
|
-
description: "Run every test against the Testserver build of vercel/api pull request 104196's head commit."
|
|
628
|
-
},
|
|
629
|
-
{
|
|
630
|
-
argv: "--unsandboxed --testserver-create=false",
|
|
631
|
-
description: "Run on this machine, on Testserver sandboxes already in the pool, never minting."
|
|
632
|
-
},
|
|
633
|
-
{
|
|
634
|
-
argv: "--testserver-sandboxes 6 -- --project testserver",
|
|
635
|
-
description: "Run vitest's testserver project against 6 Testserver sandboxes, whatever the test count."
|
|
636
|
-
}
|
|
637
|
-
],
|
|
638
|
-
playwright: [
|
|
639
|
-
{
|
|
640
|
-
argv: "--unsandboxed --testserver-sandboxes 1 -- --project chromium",
|
|
641
|
-
description: "Run Playwright's chromium project on this machine against 1 Testserver sandbox."
|
|
642
|
-
},
|
|
643
|
-
{
|
|
644
|
-
argv: "--testserver-build pr:104196",
|
|
645
|
-
description: "Run every test against the Testserver build of vercel/api pull request 104196's head commit."
|
|
646
|
-
}
|
|
647
|
-
]
|
|
648
|
-
}
|
|
653
|
+
]
|
|
649
654
|
}
|
|
650
655
|
});
|
|
651
656
|
|
|
@@ -748,6 +753,7 @@ function listArgv2(args, flags) {
|
|
|
748
753
|
}
|
|
749
754
|
|
|
750
755
|
// src/extensions/vitest/plan/plan-over.ts
|
|
756
|
+
import { relative, sep } from "node:path";
|
|
751
757
|
var LIST_TIMEOUT_MS2 = 6e4;
|
|
752
758
|
async function planVitestRunOver(options, gateway) {
|
|
753
759
|
const timeoutMs = options.timeoutMs ?? LIST_TIMEOUT_MS2;
|
|
@@ -761,12 +767,23 @@ async function planVitestRunOver(options, gateway) {
|
|
|
761
767
|
timeoutMs,
|
|
762
768
|
...options.signal === void 0 ? {} : { signal: options.signal }
|
|
763
769
|
};
|
|
770
|
+
const from = options.cwd ?? process.cwd();
|
|
764
771
|
if (options.countTests === true) {
|
|
765
772
|
const listed2 = await gateway.listTests(request);
|
|
766
|
-
return listed2.ok ? {
|
|
773
|
+
return listed2.ok ? {
|
|
774
|
+
ok: true,
|
|
775
|
+
plan: planOf2(listed2.tests),
|
|
776
|
+
testFiles: testFilesOf(
|
|
777
|
+
from,
|
|
778
|
+
listed2.tests.map(({ file }) => file)
|
|
779
|
+
)
|
|
780
|
+
} : { ok: false, failure: listed2.failure };
|
|
767
781
|
}
|
|
768
782
|
const listed = await gateway.listFiles(request);
|
|
769
|
-
return listed.ok ? { ok: true, plan: planOfFiles(listed.files) } : { ok: false, failure: listed.failure };
|
|
783
|
+
return listed.ok ? { ok: true, plan: planOfFiles(listed.files), testFiles: testFilesOf(from, listed.files) } : { ok: false, failure: listed.failure };
|
|
784
|
+
}
|
|
785
|
+
function testFilesOf(cwd, files) {
|
|
786
|
+
return [...new Set(files.map((file) => relative(cwd, file).split(sep).join("/")))].toSorted();
|
|
770
787
|
}
|
|
771
788
|
function planOf2(tests) {
|
|
772
789
|
return { tests: tests.length, files: new Set(tests.map((test) => test.file)).size };
|
|
@@ -797,6 +814,19 @@ function describeVitestListFailure(failure) {
|
|
|
797
814
|
}
|
|
798
815
|
|
|
799
816
|
// src/extensions/vitest/driver.ts
|
|
817
|
+
function validateVitestShardArgs(args) {
|
|
818
|
+
for (const arg of args) {
|
|
819
|
+
if (arg === "--") break;
|
|
820
|
+
if (arg === "--shard" || arg.startsWith("--shard=")) {
|
|
821
|
+
return {
|
|
822
|
+
ok: false,
|
|
823
|
+
problem: "storm's --sandboxes and --file-lists assign each runner sandbox's test files through STORM_RUN and can't be combined with vitest's --shard; drop --shard from vitest's arguments."
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
return { ok: true };
|
|
828
|
+
}
|
|
829
|
+
var VITEST_EXTRA_MISMATCH_HINT = 'Check that vitest.config.ts includes stormSequencer() (or ...stormVitestConfig()) from "@vercel/storm/vitest/config" so each runner sandbox runs only its assigned test files from STORM_RUN.';
|
|
800
830
|
var vitestDriver = defineDriver({
|
|
801
831
|
name: "vitest",
|
|
802
832
|
program: { bin: "vitest" },
|
|
@@ -806,53 +836,31 @@ var vitestDriver = defineDriver({
|
|
|
806
836
|
// `--count-tests`, which may take 60s (`LIST_TIMEOUT_MS`); a failure in `describeVitestListFailure`'s words.
|
|
807
837
|
plan: ({ list }) => async ({ args, cwd, bin, countTests, signal }) => {
|
|
808
838
|
const planned = await planVitestRunOver({ args, cwd, executable: bin, countTests, signal }, list);
|
|
809
|
-
if (planned.ok) return planned;
|
|
839
|
+
if (planned.ok) return { ok: true, plan: planned.plan, testFiles: planned.testFiles };
|
|
810
840
|
const { failure } = planned;
|
|
811
841
|
return { ok: false, kind: failure.kind, message: describeVitestListFailure(failure) };
|
|
812
842
|
},
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
usage: "[--count-tests] [<vitest run args>...] [-- <vitest dash options>...]",
|
|
818
|
-
args: "What vitest run gets, unchanged and in order: every argument that isn't one of storm's flags, such as file filters, then everything after --, such as -t or --project. vitest list gets the same arguments when it counts the test files, where storm.config.ts sets testPlan, or the tests with --count-tests.",
|
|
819
|
-
// What a Vitest project's storm code does with the run payload's `verbose`: `stormReporters()` picks vitest's
|
|
820
|
-
// `verbose` reporter (`@vercel/storm/vitest/config`), and an extension's Vitest fixtures print as each test
|
|
821
|
-
// goes.
|
|
822
|
-
verbose: "which has storm's Vitest reporters print each test as it finishes and an extension's Vitest fixtures print each setup phase, proxied request, and vercel invocation, for passing tests too",
|
|
823
|
-
examples: [
|
|
824
|
-
{
|
|
825
|
-
argv: "",
|
|
826
|
-
description: "Run every test in a runner sandbox, with the runner recipe, team, project and resources from storm.config.ts. Where it sets testPlan, storm counts the test files first, and each resource that sizes itself is sized from that count."
|
|
827
|
-
},
|
|
828
|
-
{
|
|
829
|
-
argv: "test/api -- -t creates",
|
|
830
|
-
description: "Run the tests named creates in the files under test/api."
|
|
831
|
-
},
|
|
832
|
-
{
|
|
833
|
-
argv: "--count-tests test/api -- -t creates",
|
|
834
|
-
description: "Count the tests named creates in the files under test/api before the run, refusing with no_matching_tests when there is none, then run them."
|
|
835
|
-
}
|
|
836
|
-
]
|
|
843
|
+
countsFilesOnly: true,
|
|
844
|
+
fileLists: {
|
|
845
|
+
validate: validateVitestShardArgs,
|
|
846
|
+
extraMismatchHint: VITEST_EXTRA_MISMATCH_HINT
|
|
837
847
|
},
|
|
838
848
|
hints: {
|
|
839
849
|
// No final result: the Vitest config lacks `stormReporter`, or a `--reporter` on vitest's command line replaced it.
|
|
840
850
|
noFinalResults: "add stormReporter() to vitest.config's reporters (@vercel/storm/vitest/config)",
|
|
841
|
-
// `
|
|
842
|
-
// unconditionally. The package may install storm under either of its npm names.
|
|
851
|
+
// `stormVitestConfig()` returns `{}` outside a storm run and sets reporters, setupFiles, and sequencer under one,
|
|
852
|
+
// so the steps add it unconditionally. The package may install storm under either of its npm names.
|
|
843
853
|
addReporter: [
|
|
844
|
-
'In the Vitest config the run loads (vitest.config.ts, or the file --config names), import {
|
|
845
|
-
"Remove any --reporter from the arguments given to vitest run, since it replaces the config's reporters, storm's among them. Then run the same storm
|
|
854
|
+
'In the Vitest config the run loads (vitest.config.ts, or the file --config names), import { stormVitestConfig } from "@vercel/storm/vitest/config" and spread stormVitestConfig() into test, as in defineConfig({ test: { ...stormVitestConfig() } }). If test.reporters already lists reporters, keep them and add stormReporter() from the same module to the list instead. If test.setupFiles already lists files, keep them and add stormSetupFile() from the same module to the list. In a package that installs storm as @cnc-tools/storm, import from "@cnc-tools/storm/vitest/config".',
|
|
855
|
+
"Remove any --reporter from the arguments given to vitest run, since it replaces the config's reporters, storm's among them. Then run the same storm test command again."
|
|
846
856
|
]
|
|
847
857
|
},
|
|
848
858
|
refusals: {
|
|
849
859
|
noMatchingTests: {
|
|
850
|
-
description: "The run counts, since storm.config.ts sets testPlan or the run took --count-tests, and vitest list found no test file for the arguments given to vitest run, or no test with --count-tests, so nothing was minted, acquired or started.",
|
|
851
860
|
message: ({ args, cwd }) => `vitest list found no test for vitest run ${argsText(args)} in ${cwd}. The command didn't run.`,
|
|
852
861
|
next: ({ args }) => `Change the arguments given to vitest run (${argsText(args)}), then retry. Put vitest's own dash options after --.`
|
|
853
862
|
},
|
|
854
863
|
planFailed: {
|
|
855
|
-
description: "storm couldn't plan the run: vitest wasn't found, or, for a run that counts, vitest list failed to start, didn't finish within 60s, exited other than 0, or printed something other than a list of files or tests. Nothing was minted, acquired or started.",
|
|
856
864
|
next: {
|
|
857
865
|
"start-failed": "Install vitest in the package, or run the command with storm exec, which needs no vitest.",
|
|
858
866
|
"timed-out": "Check why vitest list doesn't finish, such as a global setup that waits, then retry. Without --count-tests it counts only the files, which imports no test file, and without testPlan in storm.config.ts it counts nothing.",
|
|
@@ -874,6 +882,7 @@ function liveResourceContexts(env) {
|
|
|
874
882
|
return DEFINITION_SET.contexts(env);
|
|
875
883
|
}
|
|
876
884
|
var DRIVERS = driversOf(EXTENSIONS);
|
|
885
|
+
var DRIVER_NAMES = DRIVERS.map((driver) => driver.name);
|
|
877
886
|
function driverNamed(name) {
|
|
878
887
|
const drivers = DRIVERS;
|
|
879
888
|
const driver = drivers.find((each) => each.name === name);
|
|
@@ -889,6 +898,7 @@ export {
|
|
|
889
898
|
RESOURCES,
|
|
890
899
|
DEFINITION_SET,
|
|
891
900
|
liveResourceContexts,
|
|
901
|
+
DRIVER_NAMES,
|
|
892
902
|
driverNamed,
|
|
893
903
|
liveDriverContexts
|
|
894
904
|
};
|