@cnc-tools/storm 0.11.0 → 0.13.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/bin/storm.js +7 -12
- package/dist/build-info.js +1 -1
- package/dist/chunks/chunk-2NZXL6OH.js +62 -0
- package/dist/chunks/{chunk-3ZZVZPMG.js → chunk-43MWZLJR.js} +1 -1
- package/dist/chunks/{chunk-NPPJ57W7.js → chunk-5UMJNVKT.js} +498 -215
- package/dist/chunks/{chunk-KR7WIYLG.js → chunk-6EQKA7LI.js} +200 -985
- package/dist/chunks/{chunk-4EU4AH7E.js → chunk-AX4EQZUS.js} +186 -144
- package/dist/chunks/{chunk-ETCZ6WP7.js → chunk-BW2ADH7U.js} +1 -1
- package/dist/chunks/chunk-DOFB2ACU.js +49 -0
- package/dist/chunks/chunk-EGNP3S6C.js +161 -0
- package/dist/chunks/chunk-GQIL3AHY.js +20 -0
- package/dist/chunks/{chunk-ICB4BZJX.js → chunk-GSC6SRTW.js} +7 -2
- package/dist/chunks/{chunk-OJOKQRM6.js → chunk-IYM44FUX.js} +30 -26
- package/dist/chunks/{chunk-GRMD7G4J.js → chunk-LQKNI3EG.js} +6 -5
- package/dist/chunks/chunk-N7E6DAUE.js +40 -0
- package/dist/chunks/chunk-NMVODY3P.js +19 -0
- package/dist/chunks/{chunk-TRFEAYNC.js → chunk-Q4TKRILH.js} +261 -354
- package/dist/chunks/{chunk-VZZTHCBW.js → chunk-RTILVSYQ.js} +5 -18
- package/dist/chunks/{chunk-L4ZPMSKQ.js → chunk-T6AZIDZD.js} +43 -363
- package/dist/chunks/chunk-X4WBJIOF.js +308 -0
- package/dist/chunks/chunk-YGS5VRQT.js +794 -0
- package/dist/chunks/{chunk-4PRAB24Y.js → chunk-YM6TZV4L.js} +394 -396
- package/dist/chunks/{chunk-AMTYHUYB.js → chunk-YT5OROR7.js} +22 -8
- package/dist/chunks/{chunk-O4BUT7BE.js → chunk-ZDJLKF2G.js} +1625 -1583
- package/dist/chunks/{live-app-LOGYUBKB.js → live-app-QFHS54SX.js} +25 -46
- package/dist/command-tree.d.ts +4 -1
- package/dist/command-tree.js +4 -1
- package/dist/commands/exec/cleanup.js +4 -4
- package/dist/commands/exec/command.d.ts +6 -55
- package/dist/commands/exec/command.js +51 -46
- package/dist/commands/exec/define-run-command.d.ts +664 -0
- package/dist/commands/exec/define-run-command.js +58 -0
- package/dist/commands/exec/driver-plan.d.ts +30 -0
- package/dist/commands/exec/driver-plan.js +44 -0
- package/dist/commands/exec/driver-refusals.d.ts +89 -0
- package/dist/commands/exec/driver-refusals.js +65 -0
- package/dist/commands/exec/exec-words.d.ts +5 -0
- package/dist/commands/exec/exec-words.js +31 -0
- package/dist/commands/exec/live-view.js +68 -42
- package/dist/commands/exec/mint-failed.js +4 -4
- package/dist/commands/exec/outcomes.d.ts +6 -48
- package/dist/commands/exec/outcomes.js +10 -12
- package/dist/commands/exec/plan-run.js +3 -3
- package/dist/commands/exec/progress.d.ts +21 -17
- package/dist/commands/exec/progress.js +59 -78
- package/dist/commands/exec/resource-flags.d.ts +10 -3
- package/dist/commands/exec/resource-flags.js +25 -14
- package/dist/commands/exec/resource-refusals.d.ts +1 -1
- package/dist/commands/exec/resource-refusals.js +9 -9
- package/dist/commands/exec/run-bin.d.ts +35 -0
- package/dist/commands/exec/run-bin.js +32 -0
- package/dist/commands/exec/run-command.d.ts +64 -23
- package/dist/commands/exec/run-command.js +35 -94
- package/dist/commands/exec/run-metadata.d.ts +25 -19
- package/dist/commands/exec/run-metadata.js +34 -18
- package/dist/commands/exec/snapshot-text.d.ts +31 -0
- package/dist/commands/exec/snapshot-text.js +72 -0
- package/dist/commands/exec/test-plan.d.ts +2 -2
- package/dist/commands/exec/test-plan.js +11 -8
- package/dist/commands/exec/tests-summary.d.ts +21 -12
- package/dist/commands/exec/tests-summary.js +67 -39
- package/dist/commands/exec/text.d.ts +5 -0
- package/dist/commands/exec/text.js +7 -0
- package/dist/commands/exec/view.js +12 -13
- package/dist/commands/exec/waterfall.js +4 -4
- package/dist/commands/exec/worker-chart.d.ts +19 -11
- package/dist/commands/exec/worker-chart.js +66 -36
- package/dist/commands/playwright/command.d.ts +658 -0
- package/dist/commands/playwright/command.js +31 -0
- package/dist/commands/playwright/metadata.js +8 -0
- package/dist/commands/runs/facts.d.ts +5 -28
- package/dist/commands/runs/facts.js +11 -33
- package/dist/commands/runs/list/command.d.ts +4 -50
- package/dist/commands/runs/list/command.js +15 -11
- package/dist/commands/runs/list/outcomes.d.ts +2 -25
- package/dist/commands/runs/logs/command.js +13 -9
- package/dist/commands/runs/logs/outcomes.js +1 -1
- package/dist/commands/runs/show/command.d.ts +6 -50
- package/dist/commands/runs/show/command.js +37 -47
- package/dist/commands/runs/show/metadata.js +1 -1
- package/dist/commands/runs/show/outcomes.d.ts +3 -25
- package/dist/commands/runs/show/outcomes.js +18 -31
- package/dist/commands/snapshots/build/command.d.ts +501 -0
- package/dist/commands/snapshots/build/command.js +336 -0
- package/dist/commands/snapshots/build/metadata.d.ts +28 -0
- package/dist/commands/snapshots/build/metadata.js +37 -0
- package/dist/commands/snapshots/build/outcomes.d.ts +254 -0
- package/dist/commands/snapshots/build/outcomes.js +155 -0
- package/dist/commands/snapshots/list/command.d.ts +238 -0
- package/dist/commands/snapshots/list/command.js +269 -0
- package/dist/commands/snapshots/list/metadata.d.ts +16 -0
- package/dist/commands/snapshots/list/metadata.js +24 -0
- package/dist/commands/snapshots/list/outcomes.d.ts +148 -0
- package/dist/commands/snapshots/list/outcomes.js +217 -0
- package/dist/commands/snapshots/metadata.d.ts +3 -0
- package/dist/commands/snapshots/metadata.js +7 -0
- package/dist/commands/vitest/command.d.ts +185 -304
- package/dist/commands/vitest/command.js +23 -181
- package/dist/commands/vitest/metadata.js +1 -1
- package/dist/config-file/define.d.ts +1 -1
- package/dist/context.d.ts +32 -30
- package/dist/context.js +13 -17
- package/dist/core/before-run.d.ts +5 -5
- package/dist/core/before-run.js +8 -8
- package/dist/core/definition-lookup.d.ts +5 -5
- package/dist/core/definition-lookup.js +13 -12
- package/dist/core/drivers-of.d.ts +23 -0
- package/dist/core/drivers-of.js +13 -0
- package/dist/core/events.d.ts +6 -9
- package/dist/core/gateways.d.ts +32 -24
- package/dist/core/index.d.ts +7 -5
- package/dist/core/index.js +9 -6
- package/dist/core/launcher-context.d.ts +11 -0
- package/dist/core/launcher-context.js +31 -0
- package/dist/core/live/package-bin-gateway.d.ts +6 -0
- package/dist/core/live/package-bin-gateway.js +24 -0
- package/dist/core/package-bin.d.ts +7 -0
- package/dist/core/package-bin.js +30 -0
- package/dist/core/presentations.d.ts +1 -1
- package/dist/core/presentations.js +6 -5
- package/dist/core/{resource-registry.d.ts → resource-definition-set.d.ts} +15 -14
- package/dist/core/resource-definition-set.js +31 -0
- package/dist/core/resource-reports.d.ts +1 -1
- package/dist/core/resource-reports.js +16 -15
- package/dist/core/resource.d.ts +4 -4
- package/dist/core/resources.d.ts +6 -6
- package/dist/core/resources.js +11 -11
- package/dist/core/run-state.d.ts +20 -31
- package/dist/core/run-state.js +34 -25
- package/dist/core/run.d.ts +30 -32
- package/dist/core/run.js +33 -39
- package/dist/core/setup-phases.d.ts +14 -0
- package/dist/core/setup-phases.js +24 -0
- package/dist/core/state-directory.d.ts +2 -2
- package/dist/core/state-directory.js +3 -3
- package/dist/core/timeline.d.ts +4 -2
- package/dist/core/timeline.js +11 -5
- package/dist/extension-commands.js +6 -10
- package/dist/extensions/github/{world.d.ts → context.d.ts} +1 -1
- package/dist/extensions/github/context.js +3 -0
- package/dist/extensions/github/definition.d.ts +1 -1
- package/dist/extensions/github/definition.js +3 -3
- package/dist/extensions/github/extension.d.ts +1 -1
- package/dist/extensions/github/index.d.ts +2 -2
- package/dist/extensions/github/index.js +4 -4
- package/dist/extensions/github/lifecycle.d.ts +3 -3
- package/dist/extensions/github/lifecycle.js +14 -14
- package/dist/extensions/github/live/context.d.ts +6 -0
- package/dist/extensions/github/live/context.js +16 -0
- package/dist/extensions/github/resource.d.ts +1 -1
- package/dist/extensions/playwright/driver.d.ts +8 -0
- package/dist/extensions/playwright/driver.js +60 -0
- package/dist/extensions/playwright/extension.d.ts +2 -0
- package/dist/extensions/playwright/extension.js +12 -0
- package/dist/extensions/playwright/plan/gateways.d.ts +62 -0
- package/dist/extensions/playwright/plan/gateways.js +4 -0
- package/dist/extensions/playwright/plan/list-output.d.ts +26 -0
- package/dist/extensions/playwright/plan/list-output.js +101 -0
- package/dist/extensions/playwright/plan/live/list-gateway.d.ts +15 -0
- package/dist/extensions/playwright/plan/live/list-gateway.js +100 -0
- package/dist/extensions/playwright/plan/plan.d.ts +44 -0
- package/dist/extensions/playwright/plan/plan.js +53 -0
- package/dist/extensions/testserver/command-tree.d.ts +1 -1
- package/dist/extensions/testserver/command-tree.js +2 -2
- package/dist/extensions/testserver/commands/app.d.ts +7 -7
- package/dist/extensions/testserver/commands/pool/create/command.d.ts +5 -5
- package/dist/extensions/testserver/commands/pool/create/command.js +12 -13
- package/dist/extensions/testserver/commands/pool/list/command.js +5 -6
- package/dist/extensions/testserver/{world.d.ts → context.d.ts} +1 -1
- package/dist/extensions/testserver/context.js +4 -0
- package/dist/extensions/testserver/definition.d.ts +2 -2
- package/dist/extensions/testserver/definition.js +8 -7
- package/dist/extensions/testserver/events.d.ts +1 -1
- package/dist/extensions/testserver/extension.d.ts +4 -3
- package/dist/extensions/testserver/extension.js +33 -20
- package/dist/extensions/testserver/index.d.ts +2 -2
- package/dist/extensions/testserver/index.js +2 -2
- package/dist/extensions/testserver/lifecycle.d.ts +6 -5
- package/dist/extensions/testserver/lifecycle.js +9 -8
- package/dist/extensions/testserver/live/context.d.ts +8 -0
- package/dist/extensions/testserver/live/{world.js → context.js} +6 -7
- package/dist/extensions/testserver/options/rules.d.ts +3 -3
- package/dist/extensions/testserver/options/rules.js +5 -4
- package/dist/extensions/testserver/options/sandboxes.d.ts +3 -2
- package/dist/extensions/testserver/options/sandboxes.js +3 -2
- package/dist/extensions/testserver/playwright/index.d.ts +33 -0
- package/dist/extensions/testserver/playwright/index.js +43 -0
- package/dist/extensions/testserver/presentation.d.ts +4 -4
- package/dist/extensions/testserver/presentation.js +7 -7
- package/dist/extensions/testserver/progress.d.ts +3 -3
- package/dist/extensions/testserver/progress.js +3 -3
- package/dist/extensions/testserver/provision.d.ts +2 -2
- package/dist/extensions/testserver/provision.js +10 -10
- package/dist/extensions/testserver/resource.d.ts +2 -2
- package/dist/extensions/testserver/result.d.ts +2 -2
- package/dist/extensions/testserver/result.js +1 -1
- package/dist/extensions/testserver/run/connection.d.ts +1 -1
- package/dist/extensions/testserver/run/connection.js +3 -3
- package/dist/extensions/testserver/run/sandbox.d.ts +31 -0
- package/dist/extensions/testserver/run/sandbox.js +58 -0
- package/dist/extensions/testserver/run-sandbox.d.ts +2 -2
- package/dist/extensions/testserver/run-sandbox.js +3 -3
- package/dist/extensions/testserver/vercel-cli/arguments.d.ts +2 -2
- package/dist/extensions/testserver/vercel-cli/arguments.js +6 -6
- package/dist/extensions/testserver/vercel-cli/auth-config.d.ts +7 -7
- package/dist/extensions/testserver/vercel-cli/auth-config.js +4 -4
- package/dist/extensions/testserver/vercel-cli/clock.js +1 -1
- package/dist/extensions/testserver/vercel-cli/config-files.js +1 -1
- package/dist/extensions/testserver/vercel-cli/context.d.ts +1 -1
- package/dist/extensions/testserver/vercel-cli/context.js +2 -2
- package/dist/extensions/testserver/vercel-cli/entry.d.ts +1 -1
- package/dist/extensions/testserver/vercel-cli/entry.js +1 -1
- package/dist/extensions/testserver/vercel-cli/environment.d.ts +5 -5
- package/dist/extensions/testserver/vercel-cli/environment.js +6 -6
- package/dist/extensions/testserver/vercel-cli/gateways.d.ts +1 -1
- package/dist/extensions/testserver/vercel-cli/gateways.js +3 -3
- package/dist/extensions/testserver/vercel-cli/index.d.ts +1 -1
- package/dist/extensions/testserver/vercel-cli/index.js +8 -9
- package/dist/extensions/testserver/vercel-cli/invocation.d.ts +13 -12
- package/dist/extensions/testserver/vercel-cli/invocation.js +1 -1
- package/dist/extensions/testserver/vercel-cli/{driver.d.ts → invoker.d.ts} +18 -17
- package/dist/extensions/testserver/vercel-cli/{driver.js → invoker.js} +8 -8
- package/dist/extensions/testserver/vercel-cli/live/config-files.d.ts +2 -2
- package/dist/extensions/testserver/vercel-cli/live/config-files.js +2 -2
- package/dist/extensions/testserver/vercel-cli/live/process-gateway.js +1 -1
- package/dist/extensions/testserver/vercel-cli/report.js +2 -2
- package/dist/extensions/testserver/vercel-cli/verbose.js +1 -1
- package/dist/extensions/testserver/vitest/config.d.ts +3 -3
- package/dist/extensions/testserver/vitest/config.js +5 -13
- package/dist/extensions/testserver/vitest/container-scope.d.ts +11 -11
- package/dist/extensions/testserver/vitest/container-scope.js +9 -9
- package/dist/extensions/testserver/vitest/container-start.d.ts +6 -6
- package/dist/extensions/testserver/vitest/container-start.js +14 -11
- package/dist/extensions/testserver/vitest/diagnostics.d.ts +1 -1
- package/dist/extensions/testserver/vitest/fixtures.d.ts +11 -11
- package/dist/extensions/testserver/vitest/fixtures.js +14 -23
- package/dist/extensions/testserver/vitest/index.d.ts +1 -1
- package/dist/extensions/testserver/vitest/index.js +4 -4
- package/dist/extensions/testserver/vitest/types.d.ts +16 -18
- package/dist/extensions/testserver/vitest/types.js +2 -2
- package/dist/extensions/testserver/vitest/worker-sandbox.d.ts +8 -0
- package/dist/extensions/testserver/vitest/worker-sandbox.js +17 -0
- package/dist/extensions/vitest/driver.d.ts +8 -0
- package/dist/extensions/vitest/driver.js +62 -0
- package/dist/extensions/vitest/extension.d.ts +2 -0
- package/dist/extensions/vitest/extension.js +8 -0
- package/dist/{vitest → extensions/vitest/plan}/gateways.d.ts +1 -26
- package/dist/extensions/vitest/plan/gateways.js +3 -0
- package/dist/{vitest → extensions/vitest/plan}/live/list-gateway.d.ts +1 -2
- package/dist/{vitest → extensions/vitest/plan}/live/list-gateway.js +1 -20
- package/dist/extensions/vitest/plan/plan-over.d.ts +38 -0
- package/dist/extensions/vitest/plan/plan-over.js +31 -0
- package/dist/extensions/vitest/plan/plan.d.ts +24 -0
- package/dist/{vitest → extensions/vitest/plan}/plan.js +11 -26
- package/dist/extensions.d.ts +40 -18
- package/dist/extensions.js +49 -22
- package/dist/forward-sigterm.js +1 -1
- package/dist/launcher-resolvers/index.d.ts +1 -1
- package/dist/launcher-resolvers/local-services.d.ts +9 -44
- package/dist/launcher-resolvers/local-services.js +4 -5
- package/dist/live-app.js +7 -6
- package/dist/local-services.d.ts +7 -15
- package/dist/local-services.js +8 -29
- package/dist/playwright/index.d.ts +1 -0
- package/dist/playwright/index.js +4 -0
- package/dist/playwright/reporter.d.ts +96 -0
- package/dist/playwright/reporter.js +162 -0
- package/dist/playwright/worker-index.d.ts +7 -0
- package/dist/playwright/worker-index.js +20 -0
- package/dist/run-directory/index.d.ts +1 -1
- package/dist/run-directory/index.js +2 -3
- package/dist/run-directory/plan.d.ts +3 -3
- package/dist/run-directory/plan.js +5 -5
- package/dist/run-directory/reader.js +2 -2
- package/dist/run-directory/recording.d.ts +8 -5
- package/dist/run-directory/recording.js +6 -6
- package/dist/run-directory/run-collector.d.ts +5 -5
- package/dist/run-directory/run-collector.js +5 -5
- package/dist/run-directory/run-record.d.ts +17 -90
- package/dist/run-directory/run-record.js +15 -55
- package/dist/run-directory/timeline-facts.d.ts +2 -1
- package/dist/run-directory/timeline-facts.js +4 -2
- package/dist/runner/build-snapshots.d.ts +115 -0
- package/dist/runner/build-snapshots.js +146 -0
- package/dist/runner/context.js +2 -1
- package/dist/runner/events.d.ts +24 -69
- package/dist/runner/gateways.d.ts +20 -18
- package/dist/runner/index.d.ts +8 -7
- package/dist/runner/index.js +5 -3
- package/dist/runner/live/checkout-gateway.js +15 -7
- package/dist/runner/live/snapshot-records.js +7 -17
- package/dist/runner/prepare.d.ts +17 -50
- package/dist/runner/prepare.js +21 -25
- package/dist/runner/ready.d.ts +15 -11
- package/dist/runner/ready.js +32 -40
- package/dist/runner/recipe.d.ts +4 -18
- package/dist/runner/recipe.js +1 -13
- package/dist/runner/scope.d.ts +8 -32
- package/dist/runner/scope.js +4 -12
- package/dist/runner/secrets.d.ts +6 -0
- package/dist/runner/secrets.js +10 -0
- package/dist/runner/session.d.ts +19 -38
- package/dist/runner/session.js +16 -55
- package/dist/runner/snapshot-build.d.ts +21 -11
- package/dist/runner/snapshot-build.js +11 -16
- package/dist/runner/snapshot-cache.d.ts +98 -72
- package/dist/runner/snapshot-cache.js +69 -118
- package/dist/runner/snapshot-inspect.d.ts +85 -0
- package/dist/runner/snapshot-inspect.js +164 -0
- package/dist/runner/snapshot-key.d.ts +13 -15
- package/dist/runner/snapshot-key.js +15 -22
- package/dist/sdk/extension/commands.d.ts +35 -17
- package/dist/sdk/extension/commands.js +13 -11
- package/dist/sdk/extension/driver.d.ts +143 -0
- package/dist/sdk/extension/driver.js +28 -0
- package/dist/sdk/extension/index.d.ts +2 -1
- package/dist/sdk/extension/index.js +15 -9
- package/dist/sdk/extension/{launcher-supplies.d.ts → launcher-context.d.ts} +3 -3
- package/dist/sdk/extension/launcher-context.js +5 -0
- package/dist/sdk/extension/lifecycle.d.ts +6 -5
- package/dist/sdk/extension/lifecycle.js +2 -2
- package/dist/sdk/extension/resource-definition.d.ts +13 -13
- package/dist/sdk/extension/resource-definition.js +2 -2
- package/dist/sdk/extension/resource.d.ts +13 -13
- package/dist/sdk/extension/resource.js +11 -11
- package/dist/sdk/extension/time.js +2 -2
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/index.js +3 -1
- package/dist/sdk/run/launcher.d.ts +1 -1
- package/dist/sdk/run/launcher.js +4 -3
- package/dist/sdk/run/payload.js +1 -1
- package/dist/sdk/run/test-events.d.ts +24 -18
- package/dist/sdk/run/test-events.js +5 -4
- package/dist/sdk/run/test-result-writer.d.ts +77 -0
- package/dist/sdk/run/test-result-writer.js +143 -0
- package/dist/sdk/run/worker-test-event-writer.d.ts +13 -0
- package/dist/sdk/run/worker-test-event-writer.js +31 -0
- package/dist/vendor/testserver-sdk/container/container.d.ts +1 -6
- package/dist/vendor/testserver-sdk/container/container.js +1 -5
- package/dist/vendor/testserver-sdk/factories/build.d.ts +12 -40
- package/dist/vendor/testserver-sdk/factories/build.js +15 -66
- package/dist/vendor/testserver-sdk/factories/gateways.d.ts +1 -2
- package/dist/vendor/testserver-sdk/factories/index.d.ts +1 -3
- package/dist/vendor/testserver-sdk/factories/index.js +3 -5
- package/dist/vendor/testserver-sdk/index.d.ts +1 -2
- package/dist/vendor/testserver-sdk/index.js +5 -6
- package/dist/vendor/testserver-sdk/records/body.d.ts +1 -1
- package/dist/vendor/testserver-sdk/records/body.js +1 -1
- package/dist/vitest/index.d.ts +2 -1
- package/dist/vitest/index.js +6 -4
- package/dist/vitest/test-events.d.ts +6 -16
- package/dist/vitest/test-events.js +15 -40
- package/dist/vitest/test-results.d.ts +9 -31
- package/dist/vitest/test-results.js +34 -105
- package/dist/vitest/worker-index.d.ts +6 -0
- package/dist/vitest/worker-index.js +17 -0
- package/package.json +23 -9
- package/skills/overview.md +6 -8
- package/skills/read-run-output.md +21 -7
- package/dist/chunks/chunk-FVMQKYTT.js +0 -10
- package/dist/chunks/chunk-SLNKW4ZM.js +0 -40
- package/dist/chunks/chunk-WNIQA5J6.js +0 -19
- package/dist/chunks/chunk-WSIF7SR6.js +0 -10
- package/dist/commands/vitest/outcomes.d.ts +0 -379
- package/dist/commands/vitest/outcomes.js +0 -70
- package/dist/core/launcher-supplies.d.ts +0 -11
- package/dist/core/launcher-supplies.js +0 -28
- package/dist/core/live/terminal-command-gateway.d.ts +0 -8
- package/dist/core/live/terminal-command-gateway.js +0 -49
- package/dist/core/resource-registry.js +0 -30
- package/dist/extensions/github/live/world.d.ts +0 -6
- package/dist/extensions/github/live/world.js +0 -16
- package/dist/extensions/github/world.js +0 -3
- package/dist/extensions/story/command-tree.d.ts +0 -6
- package/dist/extensions/story/command-tree.js +0 -21
- package/dist/extensions/story/commands/app.d.ts +0 -23
- package/dist/extensions/story/commands/app.js +0 -5
- package/dist/extensions/story/commands/run/command.d.ts +0 -211
- package/dist/extensions/story/commands/run/command.js +0 -259
- package/dist/extensions/story/commands/run/metadata.js +0 -8
- package/dist/extensions/story/commands/run/outcomes.d.ts +0 -101
- package/dist/extensions/story/commands/run/outcomes.js +0 -73
- package/dist/extensions/story/commands/tree.d.ts +0 -2
- package/dist/extensions/story/commands/tree.js +0 -6
- package/dist/extensions/story/extension.d.ts +0 -2
- package/dist/extensions/story/extension.js +0 -8
- package/dist/extensions/testserver/live/world.d.ts +0 -8
- package/dist/extensions/testserver/vitest/sandbox.d.ts +0 -25
- package/dist/extensions/testserver/vitest/sandbox.js +0 -43
- package/dist/extensions/testserver/world.js +0 -4
- package/dist/runner/snapshot-save.d.ts +0 -56
- package/dist/runner/snapshot-save.js +0 -151
- package/dist/sdk/extension/launcher-supplies.js +0 -3
- package/dist/story/align.d.ts +0 -37
- package/dist/story/align.js +0 -39
- package/dist/story/command-line.d.ts +0 -24
- package/dist/story/command-line.js +0 -88
- package/dist/story/definition.d.ts +0 -59
- package/dist/story/definition.js +0 -9
- package/dist/story/diff.d.ts +0 -9
- package/dist/story/diff.js +0 -97
- package/dist/story/errors.d.ts +0 -14
- package/dist/story/errors.js +0 -21
- package/dist/story/gateways.d.ts +0 -94
- package/dist/story/gateways.js +0 -3
- package/dist/story/host.d.ts +0 -30
- package/dist/story/host.js +0 -97
- package/dist/story/index.d.ts +0 -8
- package/dist/story/index.js +0 -11
- package/dist/story/json.d.ts +0 -16
- package/dist/story/json.js +0 -59
- package/dist/story/launch.d.ts +0 -70
- package/dist/story/launch.js +0 -77
- package/dist/story/live/recording-gateway.d.ts +0 -2
- package/dist/story/live/recording-gateway.js +0 -103
- package/dist/story/orphans.d.ts +0 -35
- package/dist/story/orphans.js +0 -51
- package/dist/story/recording.d.ts +0 -62
- package/dist/story/recording.js +0 -97
- package/dist/story/report.d.ts +0 -42
- package/dist/story/report.js +0 -129
- package/dist/story/sequence.d.ts +0 -30
- package/dist/story/sequence.js +0 -74
- package/dist/story/settle.d.ts +0 -96
- package/dist/story/settle.js +0 -71
- package/dist/story/start.d.ts +0 -50
- package/dist/story/start.js +0 -183
- package/dist/vendor/testserver-sdk/factories/definition.d.ts +0 -39
- package/dist/vendor/testserver-sdk/factories/definition.js +0 -16
- package/dist/vendor/testserver-sdk/factories/definitions.d.ts +0 -169
- package/dist/vendor/testserver-sdk/factories/definitions.js +0 -245
- package/dist/vendor/testserver-sdk/seed/index.d.ts +0 -1
- package/dist/vendor/testserver-sdk/seed/index.js +0 -3
- package/dist/vendor/testserver-sdk/seed/seed.d.ts +0 -221
- package/dist/vendor/testserver-sdk/seed/seed.js +0 -171
- package/dist/vitest/find-vitest.d.ts +0 -7
- package/dist/vitest/find-vitest.js +0 -28
- package/dist/vitest/gateways.js +0 -4
- package/dist/vitest/plan.d.ts +0 -51
- /package/dist/{extensions/story/commands/run → commands/playwright}/metadata.d.ts +0 -0
- /package/dist/{vitest → extensions/vitest/plan}/list-output.d.ts +0 -0
- /package/dist/{vitest → extensions/vitest/plan}/list-output.js +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { WORKERS_PER_SANDBOX } from "
|
|
1
|
+
export { WORKERS_PER_SANDBOX } from "../run/sandbox.ts";
|
|
2
2
|
/**
|
|
3
3
|
* A vitest `retry` for a testserver project: one more attempt for a test that failed because Testserver couldn't
|
|
4
4
|
* serve a call for a reason outside the test (`TESTSERVER_TRANSIENT_FAILURE`): its connection failed, such as a
|
|
5
5
|
* `read ECONNRESET` between the runner and the Testserver URL, or Testserver had stopped the container, as its idle
|
|
6
6
|
* eviction does to a container no request has reached for a while, whether the test made the call, its proxy
|
|
7
|
-
* forwarded it, or the call was the start of its container. None for any other failure. The
|
|
7
|
+
* forwarded it, or the call was the start of its container. None for any other failure. The library ends a file's
|
|
8
8
|
* container after a test whose factory call, API request or proxied request failed so, so the retry runs on a new
|
|
9
9
|
* container, where a factory call that half-happened on the old one can't collide with it. vitest's own output marks
|
|
10
10
|
* a test it rescued `(retry x1)`. Spread it to change the count: `retry: { ...testserverTransientRetry, count: 2 }`;
|
|
11
|
-
* under Vitest before 5.0.4, only the first retry can start a container again after a failed start (the
|
|
11
|
+
* under Vitest before 5.0.4, only the first retry can start a container again after a failed start (the library's
|
|
12
12
|
* `README.md`, `stormContainer`).
|
|
13
13
|
*/
|
|
14
14
|
export declare const testserverTransientRetry: {
|
|
@@ -3,20 +3,18 @@
|
|
|
3
3
|
// `@vercel/storm/testserver/vitest`: loading the fixtures' `test` extends vitest's, which throws inside a config file.
|
|
4
4
|
// So nothing here imports `./fixtures.ts` or vitest.
|
|
5
5
|
import { TESTSERVER_TRANSIENT_FAILURE } from "../../../vendor/testserver-sdk/index.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import { sandboxCount, WORKERS_PER_SANDBOX } from "./sandbox.js";
|
|
9
|
-
export { WORKERS_PER_SANDBOX } from "./sandbox.js";
|
|
6
|
+
import { workersForSandboxes, WORKERS_PER_SANDBOX } from "../run/sandbox.js";
|
|
7
|
+
export { WORKERS_PER_SANDBOX } from "../run/sandbox.js";
|
|
10
8
|
/**
|
|
11
9
|
* A vitest `retry` for a testserver project: one more attempt for a test that failed because Testserver couldn't
|
|
12
10
|
* serve a call for a reason outside the test (`TESTSERVER_TRANSIENT_FAILURE`): its connection failed, such as a
|
|
13
11
|
* `read ECONNRESET` between the runner and the Testserver URL, or Testserver had stopped the container, as its idle
|
|
14
12
|
* eviction does to a container no request has reached for a while, whether the test made the call, its proxy
|
|
15
|
-
* forwarded it, or the call was the start of its container. None for any other failure. The
|
|
13
|
+
* forwarded it, or the call was the start of its container. None for any other failure. The library ends a file's
|
|
16
14
|
* container after a test whose factory call, API request or proxied request failed so, so the retry runs on a new
|
|
17
15
|
* container, where a factory call that half-happened on the old one can't collide with it. vitest's own output marks
|
|
18
16
|
* a test it rescued `(retry x1)`. Spread it to change the count: `retry: { ...testserverTransientRetry, count: 2 }`;
|
|
19
|
-
* under Vitest before 5.0.4, only the first retry can start a container again after a failed start (the
|
|
17
|
+
* under Vitest before 5.0.4, only the first retry can start a container again after a failed start (the library's
|
|
20
18
|
* `README.md`, `stormContainer`).
|
|
21
19
|
*/
|
|
22
20
|
export const testserverTransientRetry = {
|
|
@@ -31,11 +29,5 @@ export const testserverTransientRetry = {
|
|
|
31
29
|
*/
|
|
32
30
|
export function testserverWorkers(options = {}) {
|
|
33
31
|
const { workersPerSandbox = WORKERS_PER_SANDBOX, env = process.env } = options;
|
|
34
|
-
|
|
35
|
-
throw new Error(`workersPerSandbox is ${String(workersPerSandbox)}, not a positive integer`);
|
|
36
|
-
}
|
|
37
|
-
const raw = env[RUN_PAYLOAD_VARIABLE];
|
|
38
|
-
if (raw === undefined || raw === "")
|
|
39
|
-
return workersPerSandbox;
|
|
40
|
-
return workersPerSandbox * sandboxCount(readRunPayload(env).get(testserverConnection));
|
|
32
|
+
return workersForSandboxes(workersPerSandbox, env);
|
|
41
33
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { type Container, type ServiceWarmup, type TestserverServiceId } from "../../../vendor/testserver-sdk/index.js";
|
|
2
2
|
/**
|
|
3
|
-
* How long the Vitest
|
|
4
|
-
* after a test that failed because of a Testserver failure (`endsSharedContainer`), for a test with different
|
|
3
|
+
* How long the Testserver Vitest fixtures' container lives: `'file'`, one container shared by a test file's tests and
|
|
4
|
+
* replaced after a test that failed because of a Testserver failure (`endsSharedContainer`), for a test with different
|
|
5
5
|
* feature flags, or for a test it reached after Testserver had stopped it, as Testserver's idle eviction does, or
|
|
6
6
|
* `'test'`, one per test.
|
|
7
7
|
*/
|
|
8
8
|
export type ContainerScope = "file" | "test";
|
|
9
9
|
/** The default container scope: a test file's tests share one container. */
|
|
10
10
|
export declare const CONTAINER_SCOPE: ContainerScope;
|
|
11
|
-
/** What the
|
|
11
|
+
/** What the library needs of a container to share it: the `Container` fields it reports on, and `end`. */
|
|
12
12
|
export type SharedContainer = Pick<Container, "testId" | "testserverUrl" | "featureFlags" | "factoryCalls" | "apiRequests" | "externalCalls" | "setupCalls" | "warmups" | "log" | "redact" | "end">;
|
|
13
13
|
/**
|
|
14
14
|
* Where the container `FileContainer.acquire` hands out came from: `reused`, the file's running container; `new`,
|
|
@@ -97,15 +97,15 @@ export interface ContainerRequest<C extends SharedContainer> {
|
|
|
97
97
|
*
|
|
98
98
|
* In `'file'` scope, hands the test the file's container, starting it if need be, or replacing it when its feature
|
|
99
99
|
* flags differ from the test's. A test that aborts while it is starting never gets it, but the container stays the
|
|
100
|
-
* file's, for its next test. A test handed a container an earlier test used notes its container log's last record,
|
|
101
|
-
*
|
|
100
|
+
* file's, for its next test. A test handed a container an earlier test used notes its container log's last record, so
|
|
101
|
+
* its report can print only the records after it. When that note finds Testserver has stopped the container
|
|
102
102
|
* (`container-stopped`), as its idle eviction does between tests, the test gets a new container in its place, before
|
|
103
|
-
* its body runs.
|
|
104
|
-
*
|
|
105
|
-
* the
|
|
106
|
-
* test
|
|
107
|
-
*
|
|
108
|
-
*
|
|
103
|
+
* its body runs. After a failed test, the test's failure handler, which Vitest awaits even when a fixture's cleanup
|
|
104
|
+
* throws, reads the container log, then ends the container when the failure may come from it (`endsSharedContainer`),
|
|
105
|
+
* so the next test that asks starts a new one, and otherwise keeps it for the next test. The failure report covers only
|
|
106
|
+
* this test's activity (its setup calls, factory calls, API requests and external calls) and container log, and says
|
|
107
|
+
* whether the container was kept, ended, or failed to end. A concurrent test can't share the file's container, and
|
|
108
|
+
* fails before anything starts.
|
|
109
109
|
*/
|
|
110
110
|
export declare function provideContainer<C extends SharedContainer>(request: ContainerRequest<C>): Promise<C>;
|
|
111
111
|
/**
|
|
@@ -115,15 +115,15 @@ export class FileContainer {
|
|
|
115
115
|
*
|
|
116
116
|
* In `'file'` scope, hands the test the file's container, starting it if need be, or replacing it when its feature
|
|
117
117
|
* flags differ from the test's. A test that aborts while it is starting never gets it, but the container stays the
|
|
118
|
-
* file's, for its next test. A test handed a container an earlier test used notes its container log's last record,
|
|
119
|
-
*
|
|
118
|
+
* file's, for its next test. A test handed a container an earlier test used notes its container log's last record, so
|
|
119
|
+
* its report can print only the records after it. When that note finds Testserver has stopped the container
|
|
120
120
|
* (`container-stopped`), as its idle eviction does between tests, the test gets a new container in its place, before
|
|
121
|
-
* its body runs.
|
|
122
|
-
*
|
|
123
|
-
* the
|
|
124
|
-
* test
|
|
125
|
-
*
|
|
126
|
-
*
|
|
121
|
+
* its body runs. After a failed test, the test's failure handler, which Vitest awaits even when a fixture's cleanup
|
|
122
|
+
* throws, reads the container log, then ends the container when the failure may come from it (`endsSharedContainer`),
|
|
123
|
+
* so the next test that asks starts a new one, and otherwise keeps it for the next test. The failure report covers only
|
|
124
|
+
* this test's activity (its setup calls, factory calls, API requests and external calls) and container log, and says
|
|
125
|
+
* whether the container was kept, ended, or failed to end. A concurrent test can't share the file's container, and
|
|
126
|
+
* fails before anything starts.
|
|
127
127
|
*/
|
|
128
128
|
export async function provideContainer(request) {
|
|
129
129
|
const { signal, onCleanup, onTestFailed, report } = request;
|
|
@@ -179,7 +179,7 @@ export async function provideContainer(request) {
|
|
|
179
179
|
}
|
|
180
180
|
/**
|
|
181
181
|
* Whether a failed test's failure may come from the file's container, so `'file'` scope ends the container rather
|
|
182
|
-
* than hand it to the file's next test. It reads what the
|
|
182
|
+
* than hand it to the file's next test. It reads what the library recorded of the test, never the test's errors: the
|
|
183
183
|
* test was aborted (a timeout aborts it); one of the setup calls, factory calls, API requests or external calls it
|
|
184
184
|
* made, those after the counts in `before`, failed (`activityFailed`), whether the test caught the error or not; a
|
|
185
185
|
* fixture saw Testserver fail the test
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ServiceWarmup } from "../../../vendor/testserver-sdk/index.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { WorkerTestEventWriter } from "../../../sdk/index.ts";
|
|
3
3
|
/** A container start `reportedStart` reported: what `start` returned, how long it took, and any warmup after it. */
|
|
4
4
|
export interface ReportedStart<T> {
|
|
5
5
|
readonly value: T;
|
|
@@ -11,9 +11,9 @@ export interface ReportedStart<T> {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* `start`, then `warm` on what it returned when given, reporting to `report`, for `file`: `
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* `warm` that throws, which leaves ending the container to `warm`.
|
|
14
|
+
* `start`, then `warm` on what it returned when given, reporting to `report`, for `file`: `setup-started`, then, once
|
|
15
|
+
* both have ended, `setup-finished` with the start's `ms` and, when `warm` ran, `warmupMs`, each with the label
|
|
16
|
+
* "container" and the Testserver pool's name as its resource. A start that throws reports `ok: false` without
|
|
17
|
+
* `warmupMs`, and so does a `warm` that throws, which leaves ending the container to `warm`.
|
|
18
18
|
*/
|
|
19
|
-
export declare function reportedStart<T>(report:
|
|
19
|
+
export declare function reportedStart<T>(report: WorkerTestEventWriter, file: string, start: () => Promise<T>, warm?: (value: T) => Promise<ServiceWarmup>, now?: () => number): Promise<ReportedStart<T>>;
|
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
// How a vitest worker reports a container start as test events (`
|
|
2
|
-
// the warmup after it),
|
|
1
|
+
// How a vitest worker reports a container start as a setup phase of its test events (`setup-started`, then
|
|
2
|
+
// `setup-finished`, with the warmup after it), labelled "container" and owned by the Testserver pool, through the
|
|
3
|
+
// worker's test event writer (`testEventReporter`, `src/vitest/`).
|
|
4
|
+
import { TESTSERVER_POOL_NAME } from "../run/connection.js";
|
|
5
|
+
/** What every container start's setup events carry: the label the launcher words its text with, and the resource. */
|
|
6
|
+
const CONTAINER_SETUP = { label: "container", resource: TESTSERVER_POOL_NAME };
|
|
3
7
|
/**
|
|
4
|
-
* `start`, then `warm` on what it returned when given, reporting to `report`, for `file`: `
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `warm` that throws, which leaves ending the container to `warm`.
|
|
8
|
+
* `start`, then `warm` on what it returned when given, reporting to `report`, for `file`: `setup-started`, then, once
|
|
9
|
+
* both have ended, `setup-finished` with the start's `ms` and, when `warm` ran, `warmupMs`, each with the label
|
|
10
|
+
* "container" and the Testserver pool's name as its resource. A start that throws reports `ok: false` without
|
|
11
|
+
* `warmupMs`, and so does a `warm` that throws, which leaves ending the container to `warm`.
|
|
8
12
|
*/
|
|
9
13
|
export async function reportedStart(report, file, start, warm, now = Date.now) {
|
|
10
14
|
const startedAt = now();
|
|
11
|
-
report({ kind: "
|
|
15
|
+
report({ kind: "setup-started", file, ...CONTAINER_SETUP });
|
|
12
16
|
let startMs;
|
|
13
17
|
try {
|
|
14
18
|
const value = await start();
|
|
15
19
|
startMs = now() - startedAt;
|
|
16
20
|
if (warm === undefined) {
|
|
17
|
-
report({ kind: "
|
|
21
|
+
report({ kind: "setup-finished", file, ...CONTAINER_SETUP, ms: startMs, ok: true });
|
|
18
22
|
return { value, startMs };
|
|
19
23
|
}
|
|
20
24
|
const warmStartedAt = now();
|
|
21
25
|
const warmup = await warm(value);
|
|
22
26
|
const warmupMs = now() - warmStartedAt;
|
|
23
|
-
|
|
24
|
-
report({ kind: "container-started", file, ms: startMs, ok: true, warmupMs, warmupFailed });
|
|
27
|
+
report({ kind: "setup-finished", file, ...CONTAINER_SETUP, ms: startMs, ok: true, warmupMs });
|
|
25
28
|
return { value, startMs, warmup: { ms: warmupMs, warmup } };
|
|
26
29
|
}
|
|
27
30
|
catch (error) {
|
|
28
|
-
report({ kind: "
|
|
31
|
+
report({ kind: "setup-finished", file, ...CONTAINER_SETUP, ms: startMs ?? now() - startedAt, ok: false });
|
|
29
32
|
throw error;
|
|
30
33
|
}
|
|
31
34
|
}
|
|
@@ -103,7 +103,7 @@ export interface ContainerReport extends ContainerActivity {
|
|
|
103
103
|
readonly testserverUrl: string;
|
|
104
104
|
/** The feature flags the container was started with; `{}` for none. */
|
|
105
105
|
readonly featureFlags: FeatureFlags;
|
|
106
|
-
/** The container's warmups: one when the
|
|
106
|
+
/** The container's warmups: one when the library started it with `warmServices`, none without. */
|
|
107
107
|
readonly warmups: readonly ServiceWarmup[];
|
|
108
108
|
readonly log: ContainerLogSlice;
|
|
109
109
|
readonly redact: Redact;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TestserverTest } from "./types.ts";
|
|
2
2
|
declare module "vitest" {
|
|
3
3
|
interface TaskMeta {
|
|
4
4
|
/**
|
|
5
|
-
* What the
|
|
5
|
+
* What the Testserver Vitest fixtures recorded for the test: the Testserver URL its container is on, and the
|
|
6
6
|
* container's test id once the test was handed it (missing if its start failed or the test aborted first).
|
|
7
7
|
*/
|
|
8
8
|
storm?: {
|
|
@@ -19,15 +19,16 @@ declare module "vitest" {
|
|
|
19
19
|
* the file's start and finish, each attempt at a test, its start and how it ended, and each container start and how
|
|
20
20
|
* long it took. A retried test reports each attempt; its final result comes from `stormReporter`
|
|
21
21
|
* (`@vercel/storm/vitest/config`), in vitest's main process. `stormEvents`, `stormFileEvents` and
|
|
22
|
-
* `stormTestEvents` are the
|
|
22
|
+
* `stormTestEvents` are the library's own, which tests don't use.
|
|
23
23
|
*
|
|
24
24
|
* - `verbose` (per worker): whether the run is verbose, under a run's `--verbose`, from the run payload. Then
|
|
25
25
|
* `container` prints each container start and `proxy` each request as it is recorded, for passing tests too, and
|
|
26
|
-
* a test's own fixture can print what it does, as the Vercel CLI
|
|
27
|
-
* - `testserverUrl` (per worker): this worker's Testserver sandbox, `sandboxes[
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
26
|
+
* a test's own fixture can print what it does, as the Vercel CLI invoker's invocations.
|
|
27
|
+
* - `testserverUrl` (per worker): this worker's Testserver sandbox, `sandboxes[workerIndex % N]` from the Testserver
|
|
28
|
+
* connection the run payload holds (`readRunPayload().get(testserverConnection)`), by the worker's worker index,
|
|
29
|
+
* its `VITEST_POOL_ID` less one (`workerTestserverUrl`, `worker-sandbox.ts`). Outside a storm run, or with a
|
|
30
|
+
* `VITEST_POOL_ID` that isn't a positive integer, it throws, so the test fails rather than skips.
|
|
31
|
+
* - `stormFile` (per file): the library's own state for the file, which tests don't use: its `container`, the
|
|
31
32
|
* holder of the file's container, and its `acquisitions`, the container and proxy starts still in flight. Creating
|
|
32
33
|
* it starts nothing. When the file finishes, it ends the file's container once any start in flight settles, and
|
|
33
34
|
* waits for every other start, so the file's worker can't exit while one is still starting.
|
|
@@ -50,8 +51,7 @@ declare module "vitest" {
|
|
|
50
51
|
* name, and ended after it. The test's `task.meta.storm` records the Testserver URL and, once the test has the
|
|
51
52
|
* container, its test id.
|
|
52
53
|
* A retry of a test whose container failed to start starts one again, once: Vitest before 5.0.4 sets no fixture up
|
|
53
|
-
* again after its setup throws, so in a later attempt `
|
|
54
|
-
* - `seed`: a `Seeder` over `container`, per test.
|
|
54
|
+
* again after its setup throws, so in a later attempt `proxy` fails, saying the attempt has no container.
|
|
55
55
|
* - `proxy`: a proxy adding `container`'s test id, per test, closed after it. Once closed, its cleanup fails the
|
|
56
56
|
* test when a fault rule forwarded a request and Testserver failed (`fault.upstream.error`), or Testserver refused a
|
|
57
57
|
* request because it had stopped the container; a rule with hits left doesn't.
|
|
@@ -66,4 +66,4 @@ declare module "vitest" {
|
|
|
66
66
|
* prints the requests it received, each a fault rule matched tagged with the fault, then each fault rule with hits
|
|
67
67
|
* left. Tokens are redacted throughout.
|
|
68
68
|
*/
|
|
69
|
-
export declare const test:
|
|
69
|
+
export declare const test: TestserverTest;
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import { test as vitestTest } from "vitest";
|
|
2
2
|
import { readRunPayload } from "../../../sdk/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import { featureFlagsKey, seeder, startContainer, startProxy, } from "../../../vendor/testserver-sdk/index.js";
|
|
3
|
+
import { featureFlagsKey, startContainer, startProxy, } from "../../../vendor/testserver-sdk/index.js";
|
|
5
4
|
import { CONTAINER_SCOPE, closeFile, FileContainer, provideContainer, warmNewContainer, } from "./container-scope.js";
|
|
6
5
|
import { containerStartReport, proxyFailureReport, proxyRequestReport, proxyTestserverFailure } from "./diagnostics.js";
|
|
7
|
-
import {
|
|
6
|
+
import { workerTestserverUrl } from "./worker-sandbox.js";
|
|
8
7
|
import { acquireOwned, Acquisitions, countTests, testEventReporter, testEventState } from "../../../vitest/index.js";
|
|
9
8
|
import { reportedStart } from "./container-start.js";
|
|
10
|
-
/**
|
|
11
|
-
* The Testserver URL of this worker's Testserver sandbox, `sandboxes[(VITEST_POOL_ID - 1) % N]` of the Testserver
|
|
12
|
-
* connection the run payload holds. Throws outside a storm run, and outside a vitest worker.
|
|
13
|
-
*/
|
|
14
|
-
function workerTestserverUrl() {
|
|
15
|
-
return sandboxForWorker(readRunPayload().get(testserverConnection), process.env["VITEST_POOL_ID"]);
|
|
16
|
-
}
|
|
17
9
|
/** The default `warmServices`: no service is warmed. */
|
|
18
10
|
const NO_SERVICES = [];
|
|
19
11
|
/** The default `featureFlags`: none. */
|
|
@@ -21,14 +13,14 @@ const NO_FEATURE_FLAGS = {};
|
|
|
21
13
|
/**
|
|
22
14
|
* `container`, the `container` fixture's value as another fixture reads it, or an error when there is none. Vitest
|
|
23
15
|
* before 5.0.4 never sets up again a test's fixture whose setup threw, and hands its dependents `undefined` in every
|
|
24
|
-
* later attempt (vitest-dev/vitest#11237). The
|
|
16
|
+
* later attempt (vitest-dev/vitest#11237). The library sets a container up again for one retry (`stormContainer`);
|
|
25
17
|
* when that fails too, a later attempt has none, and this says so in place of a `TypeError` from the first read of it.
|
|
26
18
|
*/
|
|
27
19
|
function startedContainer(container) {
|
|
28
20
|
if (container === undefined) {
|
|
29
21
|
throw new Error("storm: this attempt at the test has no container. Setting it up failed in each earlier attempt, whose errors " +
|
|
30
22
|
"say why. Vitest before 5.0.4 doesn't set a fixture up again after its setup throws " +
|
|
31
|
-
"(vitest-dev/vitest#11237), so the
|
|
23
|
+
"(vitest-dev/vitest#11237), so the Testserver Vitest fixtures can set a container up again for one retry only.");
|
|
32
24
|
}
|
|
33
25
|
return container;
|
|
34
26
|
}
|
|
@@ -131,7 +123,6 @@ const fixtures = vitestTest
|
|
|
131
123
|
const provided = stormContainer;
|
|
132
124
|
return provided ?? stormContainerSetup(onCleanup);
|
|
133
125
|
})
|
|
134
|
-
.extend("seed", ({ container }) => seeder(startedContainer(container)))
|
|
135
126
|
.extend("proxy", async ({ container, stormFile, stormTestserverFailure, verbose, signal, onTestFailed, onTestFinished }, { onCleanup }) => {
|
|
136
127
|
startedContainer(container);
|
|
137
128
|
// Under a verbose run, each request prints as the proxy records it, for passing tests too.
|
|
@@ -173,15 +164,16 @@ const fixtures = vitestTest
|
|
|
173
164
|
* the file's start and finish, each attempt at a test, its start and how it ended, and each container start and how
|
|
174
165
|
* long it took. A retried test reports each attempt; its final result comes from `stormReporter`
|
|
175
166
|
* (`@vercel/storm/vitest/config`), in vitest's main process. `stormEvents`, `stormFileEvents` and
|
|
176
|
-
* `stormTestEvents` are the
|
|
167
|
+
* `stormTestEvents` are the library's own, which tests don't use.
|
|
177
168
|
*
|
|
178
169
|
* - `verbose` (per worker): whether the run is verbose, under a run's `--verbose`, from the run payload. Then
|
|
179
170
|
* `container` prints each container start and `proxy` each request as it is recorded, for passing tests too, and
|
|
180
|
-
* a test's own fixture can print what it does, as the Vercel CLI
|
|
181
|
-
* - `testserverUrl` (per worker): this worker's Testserver sandbox, `sandboxes[
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
171
|
+
* a test's own fixture can print what it does, as the Vercel CLI invoker's invocations.
|
|
172
|
+
* - `testserverUrl` (per worker): this worker's Testserver sandbox, `sandboxes[workerIndex % N]` from the Testserver
|
|
173
|
+
* connection the run payload holds (`readRunPayload().get(testserverConnection)`), by the worker's worker index,
|
|
174
|
+
* its `VITEST_POOL_ID` less one (`workerTestserverUrl`, `worker-sandbox.ts`). Outside a storm run, or with a
|
|
175
|
+
* `VITEST_POOL_ID` that isn't a positive integer, it throws, so the test fails rather than skips.
|
|
176
|
+
* - `stormFile` (per file): the library's own state for the file, which tests don't use: its `container`, the
|
|
185
177
|
* holder of the file's container, and its `acquisitions`, the container and proxy starts still in flight. Creating
|
|
186
178
|
* it starts nothing. When the file finishes, it ends the file's container once any start in flight settles, and
|
|
187
179
|
* waits for every other start, so the file's worker can't exit while one is still starting.
|
|
@@ -204,8 +196,7 @@ const fixtures = vitestTest
|
|
|
204
196
|
* name, and ended after it. The test's `task.meta.storm` records the Testserver URL and, once the test has the
|
|
205
197
|
* container, its test id.
|
|
206
198
|
* A retry of a test whose container failed to start starts one again, once: Vitest before 5.0.4 sets no fixture up
|
|
207
|
-
* again after its setup throws, so in a later attempt `
|
|
208
|
-
* - `seed`: a `Seeder` over `container`, per test.
|
|
199
|
+
* again after its setup throws, so in a later attempt `proxy` fails, saying the attempt has no container.
|
|
209
200
|
* - `proxy`: a proxy adding `container`'s test id, per test, closed after it. Once closed, its cleanup fails the
|
|
210
201
|
* test when a fault rule forwarded a request and Testserver failed (`fault.upstream.error`), or Testserver refused a
|
|
211
202
|
* request because it had stopped the container; a rule with hits left doesn't.
|
|
@@ -220,7 +211,7 @@ const fixtures = vitestTest
|
|
|
220
211
|
* prints the requests it received, each a fault rule matched tagged with the fault, then each fault rule with hits
|
|
221
212
|
* left. Tokens are redacted throughout.
|
|
222
213
|
*/
|
|
223
|
-
// The chain also holds the
|
|
214
|
+
// The chain also holds the library's own fixtures (`stormEvents`, `stormFileEvents`, `stormTestEvents`, `stormFile`,
|
|
224
215
|
// `stormTestserverFailure`, `stormContainerSetup`, `stormContainer`), which exist at run time but aren't published,
|
|
225
|
-
// so vitest's types can't see the chain as a `
|
|
216
|
+
// so vitest's types can't see the chain as a `TestserverTest`; the cast drops them from the type.
|
|
226
217
|
export const test = fixtures;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { CONTAINER_SCOPE, type ContainerScope } from "./container-scope.ts";
|
|
2
2
|
export { test } from "./fixtures.ts";
|
|
3
|
-
export type {
|
|
3
|
+
export type { TestserverScopeMap, TestserverTest, TestserverTestContext, TestserverTestFixtureSet, TestserverWorkerFixtureSet, } from "./types.ts";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// The Testserver fixtures
|
|
2
|
-
//
|
|
3
|
-
// `containerScope` is `'test'`),
|
|
1
|
+
// The Testserver Vitest fixtures, a support library exported as `@vercel/storm/testserver/vitest`: vitest's `test`
|
|
2
|
+
// extended with fixtures for the worker's Testserver sandbox, a container (shared by a test file's tests unless
|
|
3
|
+
// `containerScope` is `'test'`), and its proxy. A `vitest.config.ts` can't import it, since extending
|
|
4
4
|
// vitest's `test` throws there; `testserverWorkers` is in `./config.ts` (`@vercel/storm/testserver/vitest/config`) for
|
|
5
5
|
// that reason, and isn't re-exported here. It imports storm only through the run API (`src/sdk/index.ts`) and storm's
|
|
6
|
-
//
|
|
6
|
+
// Vitest library's entry (`src/vitest/index.ts`), with the Testserver extension's `run/` directory and the Testserver
|
|
7
7
|
// SDK. Besides those, it depends only on Node builtins and `vitest`, an optional peer dependency of `@vercel/storm`;
|
|
8
8
|
// `.oxlintrc.json` checks the boundary.
|
|
9
9
|
export { CONTAINER_SCOPE } from "./container-scope.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { TestAPI } from "vitest";
|
|
2
|
-
import type { Container, ContainerProxy, FeatureFlags,
|
|
2
|
+
import type { Container, ContainerProxy, FeatureFlags, TestserverServiceId } from "../../../vendor/testserver-sdk/index.js";
|
|
3
3
|
import type { ContainerScope } from "./container-scope.ts";
|
|
4
|
-
/** The
|
|
5
|
-
export interface
|
|
4
|
+
/** The library's fixtures set up once per worker. */
|
|
5
|
+
export interface TestserverWorkerFixtureSet {
|
|
6
6
|
/** This worker's Testserver sandbox, `sandboxes[(VITEST_POOL_ID - 1) % N]` of the run payload's Testserver pool. */
|
|
7
7
|
testserverUrl: string;
|
|
8
8
|
/** Whether the run is verbose (its `--verbose`). */
|
|
9
9
|
verbose: boolean;
|
|
10
10
|
}
|
|
11
|
-
/** The
|
|
12
|
-
export interface
|
|
11
|
+
/** The library's fixtures set up for each test. */
|
|
12
|
+
export interface TestserverTestFixtureSet {
|
|
13
13
|
/** How long `container` lives: `'file'` (the default) or `'test'`, set with `test.override`. */
|
|
14
14
|
containerScope: ContainerScope;
|
|
15
15
|
/**
|
|
@@ -27,42 +27,40 @@ export interface StormTestFixtures {
|
|
|
27
27
|
featureFlags: FeatureFlags;
|
|
28
28
|
/** The file's container in `'file'` scope, or the test's own in `'test'` scope. */
|
|
29
29
|
container: Container;
|
|
30
|
-
/** A `Seeder` over `container`. */
|
|
31
|
-
seed: Seeder;
|
|
32
30
|
/** A proxy adding `container`'s test id, closed after the test. */
|
|
33
31
|
proxy: ContainerProxy;
|
|
34
32
|
}
|
|
35
33
|
/**
|
|
36
|
-
* The fixtures a test of the
|
|
34
|
+
* The fixtures a test of the library's `test` can ask for. The library's own fixtures for its state and test events
|
|
37
35
|
* exist at run time too, but aren't named here: tests don't use them.
|
|
38
36
|
*/
|
|
39
|
-
export interface
|
|
37
|
+
export interface TestserverTestContext extends TestserverWorkerFixtureSet, TestserverTestFixtureSet {
|
|
40
38
|
}
|
|
41
39
|
/**
|
|
42
40
|
* A suite's own fixtures by scope, keyed as in vitest's object-form `test.extend<{ $worker?, $file?, $test? }>`.
|
|
43
41
|
*/
|
|
44
|
-
export interface
|
|
42
|
+
export interface TestserverScopeMap {
|
|
45
43
|
$worker?: object;
|
|
46
44
|
$file?: object;
|
|
47
45
|
$test?: object;
|
|
48
46
|
}
|
|
49
47
|
/** The fixtures `F` names for scope `K`, or `object` when it names none. */
|
|
50
|
-
type ScopeOf<F extends
|
|
48
|
+
type ScopeOf<F extends TestserverScopeMap, K extends keyof TestserverScopeMap> = K extends keyof F ? [Exclude<F[K], undefined>] extends [never] ? object : Exclude<F[K], undefined> : object;
|
|
51
49
|
/**
|
|
52
|
-
* The type of the
|
|
50
|
+
* The type of the library's `test`, or of a suite's `test` that extends it with its own fixtures, by scope:
|
|
53
51
|
*
|
|
54
52
|
* ```ts
|
|
55
|
-
* export const test:
|
|
53
|
+
* export const test: TestserverTest<{ $test: { vercel: VercelCli } }> = storm.extend("vercel", ...);
|
|
56
54
|
* ```
|
|
57
55
|
*
|
|
58
56
|
* `$__worker`, `$__file` and `$__test` are the markers vitest's builder `extend` reads to tell a later fixture which
|
|
59
57
|
* fixtures its scope can see. vitest doesn't export the types that write them, so this is the one place storm
|
|
60
|
-
* names them; `test/unit/vitest/test-types.test.ts` pins them, so a vitest release that changes
|
|
61
|
-
* storm's checks rather than a suite's.
|
|
58
|
+
* names them; `test/unit/extensions/testserver/vitest/test-types.test.ts` pins them, so a vitest release that changes
|
|
59
|
+
* them fails storm's checks rather than a suite's.
|
|
62
60
|
*/
|
|
63
|
-
export type
|
|
64
|
-
readonly $__worker?:
|
|
61
|
+
export type TestserverTest<F extends TestserverScopeMap = TestserverScopeMap> = TestAPI<TestserverTestContext & ScopeOf<F, "$worker"> & ScopeOf<F, "$file"> & ScopeOf<F, "$test"> & {
|
|
62
|
+
readonly $__worker?: TestserverWorkerFixtureSet & ScopeOf<F, "$worker">;
|
|
65
63
|
readonly $__file?: ScopeOf<F, "$file">;
|
|
66
|
-
readonly $__test?:
|
|
64
|
+
readonly $__test?: TestserverTestFixtureSet & ScopeOf<F, "$test">;
|
|
67
65
|
}>;
|
|
68
66
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// The published types of the Vitest
|
|
2
|
-
// suite's `test` that extends it. Types only; it imports nothing from `./fixtures.ts`, so a module that names a
|
|
1
|
+
// The published types of the Testserver Vitest fixtures' `test`: the fixtures it names and `TestserverTest`, the type
|
|
2
|
+
// of a suite's `test` that extends it. Types only; it imports nothing from `./fixtures.ts`, so a module that names a
|
|
3
3
|
// fixture type doesn't extend vitest's `test`.
|
|
4
4
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Testserver URL of this Vitest worker's Testserver sandbox: `sandboxes[workerIndex % N]` of the Testserver
|
|
3
|
+
* connection the run payload in `env` holds, the worker index being the worker's `VITEST_POOL_ID` less one, so pool
|
|
4
|
+
* id 1 uses the first Testserver sandbox. Throws a `RunPayloadError` outside a storm run, and an `Error` outside a
|
|
5
|
+
* Vitest worker, where the pool id is missing or not a positive integer, or when the run has no Testserver sandbox
|
|
6
|
+
* (`NO_TESTSERVER_MESSAGE`). It never falls back to the first Testserver sandbox.
|
|
7
|
+
*/
|
|
8
|
+
export declare function workerTestserverUrl(env?: Readonly<Record<string, string | undefined>>): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Which of the run's Testserver sandboxes a Vitest worker uses. The worker's index is storm's Vitest
|
|
2
|
+
// library's (`workerIndex`, `src/vitest/index.ts`), and the arithmetic the extension's `run/` directory's
|
|
3
|
+
// (`../run/sandbox.ts`), which the Testserver Playwright helpers spread their workers with too. No vitest import.
|
|
4
|
+
import { readRunPayload } from "../../../sdk/index.js";
|
|
5
|
+
import { workerIndex } from "../../../vitest/index.js";
|
|
6
|
+
import { testserverConnection } from "../run/connection.js";
|
|
7
|
+
import { sandboxAt } from "../run/sandbox.js";
|
|
8
|
+
/**
|
|
9
|
+
* The Testserver URL of this Vitest worker's Testserver sandbox: `sandboxes[workerIndex % N]` of the Testserver
|
|
10
|
+
* connection the run payload in `env` holds, the worker index being the worker's `VITEST_POOL_ID` less one, so pool
|
|
11
|
+
* id 1 uses the first Testserver sandbox. Throws a `RunPayloadError` outside a storm run, and an `Error` outside a
|
|
12
|
+
* Vitest worker, where the pool id is missing or not a positive integer, or when the run has no Testserver sandbox
|
|
13
|
+
* (`NO_TESTSERVER_MESSAGE`). It never falls back to the first Testserver sandbox.
|
|
14
|
+
*/
|
|
15
|
+
export function workerTestserverUrl(env = process.env) {
|
|
16
|
+
return sandboxAt(readRunPayload(env).get(testserverConnection), workerIndex(env));
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { VitestListGateway } from "./plan/gateways.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The Vitest driver's Context: what its plan step reaches vitest on this machine through, to count the tests.
|
|
4
|
+
*/
|
|
5
|
+
export interface VitestDriverContext {
|
|
6
|
+
readonly list: VitestListGateway;
|
|
7
|
+
}
|
|
8
|
+
export declare const vitestDriver: import("../../sdk/extension/driver.ts").Driver<"vitest", VitestDriverContext>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// storm's Vitest driver: what the launcher knows of vitest, the program `storm vitest`'s command starts. It names the
|
|
2
|
+
// binary, builds the `vitest run` argv, counts the tests with `vitest list` over its Context (`plan/`), and holds
|
|
3
|
+
// the words that name vitest: `storm vitest`'s leaf help, what its run's summary says to do next, and what its two
|
|
4
|
+
// refusals say. The launcher makes `storm vitest` from it (`defineRunCommand`), reaching it through the registry
|
|
5
|
+
// (`src/extensions.ts`).
|
|
6
|
+
import { argsText, defineDriver } from "../../sdk/extension/index.js";
|
|
7
|
+
import { liveVitestListGateway } from "./plan/live/list-gateway.js";
|
|
8
|
+
import { describeVitestListFailure, vitestRunArgv } from "./plan/plan.js";
|
|
9
|
+
import { planVitestRunOver } from "./plan/plan-over.js";
|
|
10
|
+
export const vitestDriver = defineDriver({
|
|
11
|
+
name: "vitest",
|
|
12
|
+
program: { bin: "vitest" },
|
|
13
|
+
context: () => ({ list: liveVitestListGateway }),
|
|
14
|
+
launch: vitestRunArgv,
|
|
15
|
+
// `vitest list --json <args>`, which may take 60s (`LIST_TIMEOUT_MS`); a failure in `describeVitestListFailure`'s
|
|
16
|
+
// words.
|
|
17
|
+
plan: ({ list }) => async ({ args, cwd, bin, signal }) => {
|
|
18
|
+
const planned = await planVitestRunOver({ args, cwd, executable: bin, signal }, list);
|
|
19
|
+
if (planned.ok)
|
|
20
|
+
return planned;
|
|
21
|
+
const { failure } = planned;
|
|
22
|
+
return { ok: false, kind: failure.kind, message: describeVitestListFailure(failure) };
|
|
23
|
+
},
|
|
24
|
+
help: {
|
|
25
|
+
usage: "[<vitest run args>...] [-- <vitest dash options>...]",
|
|
26
|
+
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 --json gets the same arguments when it counts the tests.",
|
|
27
|
+
// What a Vitest project's storm code does with the run payload's `verbose`: `stormReporters()` picks vitest's
|
|
28
|
+
// `verbose` reporter (`@vercel/storm/vitest/config`), and an extension's Vitest fixtures print as each test
|
|
29
|
+
// goes.
|
|
30
|
+
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",
|
|
31
|
+
examples: [
|
|
32
|
+
{
|
|
33
|
+
argv: "",
|
|
34
|
+
description: "Run every test in a runner sandbox, with the runner recipe, team, project and resources from storm.config.ts, each resource that sizes itself sized from the test count.",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
argv: "test/api -- -t creates",
|
|
38
|
+
description: "Run the tests named creates in the files under test/api.",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
hints: {
|
|
43
|
+
// No final result: the Vitest config lacks `stormReporter`, or a `--reporter` on vitest's command line replaced it.
|
|
44
|
+
noFinalResults: "add stormReporter() to vitest.config's reporters (@vercel/storm/vitest/config)",
|
|
45
|
+
},
|
|
46
|
+
refusals: {
|
|
47
|
+
noMatchingTests: {
|
|
48
|
+
description: "vitest list found no test for the arguments given to vitest run, so nothing was minted, acquired or started.",
|
|
49
|
+
message: ({ args, cwd }) => `vitest list found no test for vitest run ${argsText(args)} in ${cwd}. The command didn't run.`,
|
|
50
|
+
next: ({ args }) => `Change the arguments given to vitest run (${argsText(args)}), then retry. Put vitest's own dash options after --.`,
|
|
51
|
+
},
|
|
52
|
+
planFailed: {
|
|
53
|
+
description: "storm couldn't count the tests before the run: vitest wasn't found or failed to start, didn't finish within 60s, exited other than 0, or printed something other than a list of tests. Nothing was minted, acquired or started.",
|
|
54
|
+
next: {
|
|
55
|
+
"start-failed": "Install vitest in the package, or run the command with storm exec, which counts nothing.",
|
|
56
|
+
"timed-out": "Check why vitest list doesn't finish, such as a global setup that waits, then retry.",
|
|
57
|
+
exited: "Fix what vitest list reports, then retry. vitest list takes the arguments vitest run does, but refuses some run-only options.",
|
|
58
|
+
"unreadable-output": "Check that the package's vitest prints its list with --json, then retry.",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/** The Vitest extension. Its one driver is storm's Vitest driver. */
|
|
2
|
+
export declare const vitestExtension: import("../../sdk/extension/commands.ts").Extension<"vitest", readonly [], unknown, readonly [import("../../sdk/extension/driver.ts").Driver<"vitest", import("./driver.ts").VitestDriverContext>]>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// The Vitest extension: storm's Vitest driver (`driver.ts`), which it lists for the registry (`src/extensions.ts`). It
|
|
2
|
+
// brings no resource and no commands of its own: the launcher makes `storm vitest` from the driver. The one value the
|
|
3
|
+
// folder hands the registry. What test code uses with Vitest is the test runner library (`src/vitest/`), which knows
|
|
4
|
+
// nothing of this extension.
|
|
5
|
+
import { defineExtension } from "../../sdk/extension/commands.js";
|
|
6
|
+
import { vitestDriver } from "./driver.js";
|
|
7
|
+
/** The Vitest extension. Its one driver is storm's Vitest driver. */
|
|
8
|
+
export const vitestExtension = defineExtension({ name: "vitest", resources: [], drivers: [vitestDriver] });
|