@cnc-tools/storm 0.11.0 → 0.12.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-3ZZVZPMG.js → chunk-43MWZLJR.js} +1 -1
- package/dist/chunks/chunk-4XT5RC5T.js +98 -0
- package/dist/chunks/chunk-7D6LC5JY.js +340 -0
- package/dist/chunks/{chunk-ETCZ6WP7.js → chunk-BW2ADH7U.js} +1 -1
- package/dist/chunks/chunk-FK4RLDEK.js +40 -0
- package/dist/chunks/{chunk-KR7WIYLG.js → chunk-FSP3SJ35.js} +209 -964
- package/dist/chunks/chunk-GQIL3AHY.js +20 -0
- package/dist/chunks/{chunk-ICB4BZJX.js → chunk-GSC6SRTW.js} +7 -2
- package/dist/chunks/{chunk-NPPJ57W7.js → chunk-ISGQJIQM.js} +498 -215
- 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-NMVODY3P.js +19 -0
- package/dist/chunks/{chunk-O4BUT7BE.js → chunk-ODQHQJLE.js} +3063 -2646
- package/dist/chunks/chunk-RYRJNHL7.js +55 -0
- package/dist/chunks/chunk-SXW6XN4R.js +161 -0
- package/dist/chunks/{chunk-L4ZPMSKQ.js → chunk-T6AZIDZD.js} +43 -363
- package/dist/chunks/chunk-TEEZL3GA.js +851 -0
- package/dist/chunks/{chunk-VZZTHCBW.js → chunk-TMQQYHUX.js} +5 -18
- package/dist/chunks/{chunk-TRFEAYNC.js → chunk-U7M3ZB3Z.js} +345 -304
- package/dist/chunks/{chunk-4EU4AH7E.js → chunk-Y3BUNNRG.js} +186 -144
- 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/{live-app-LOGYUBKB.js → live-app-AZ5N5HBD.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 +54 -15
- package/dist/commands/exec/command.js +51 -46
- package/dist/commands/exec/define-run-command.d.ts +752 -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 +58 -28
- package/dist/commands/exec/mint-failed.js +4 -4
- package/dist/commands/exec/outcomes.d.ts +70 -8
- package/dist/commands/exec/outcomes.js +37 -8
- package/dist/commands/exec/plan-run.js +3 -3
- package/dist/commands/exec/progress.d.ts +35 -15
- package/dist/commands/exec/progress.js +82 -57
- 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 +84 -24
- package/dist/commands/exec/run-command.js +84 -69
- package/dist/commands/exec/run-metadata.d.ts +29 -17
- package/dist/commands/exec/run-metadata.js +38 -16
- package/dist/commands/exec/snapshot-text.d.ts +40 -0
- package/dist/commands/exec/snapshot-text.js +112 -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 +22 -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 +746 -0
- package/dist/commands/playwright/command.js +31 -0
- package/dist/commands/playwright/metadata.js +8 -0
- package/dist/commands/runs/facts.d.ts +21 -8
- package/dist/commands/runs/facts.js +19 -9
- package/dist/commands/runs/list/command.d.ts +34 -8
- package/dist/commands/runs/list/command.js +15 -11
- package/dist/commands/runs/list/outcomes.d.ts +17 -4
- 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 +36 -8
- package/dist/commands/runs/show/command.js +48 -31
- package/dist/commands/runs/show/metadata.js +1 -1
- package/dist/commands/runs/show/outcomes.d.ts +18 -4
- package/dist/commands/runs/show/outcomes.js +35 -14
- package/dist/commands/snapshots/build/command.d.ts +898 -0
- package/dist/commands/snapshots/build/command.js +511 -0
- package/dist/commands/snapshots/build/metadata.d.ts +28 -0
- package/dist/commands/snapshots/build/metadata.js +34 -0
- package/dist/commands/snapshots/build/outcomes.d.ts +484 -0
- package/dist/commands/snapshots/build/outcomes.js +322 -0
- package/dist/commands/snapshots/list/command.d.ts +272 -0
- package/dist/commands/snapshots/list/command.js +305 -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 +183 -0
- package/dist/commands/snapshots/list/outcomes.js +257 -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 +267 -298
- 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 +2 -4
- 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 +27 -16
- package/dist/core/run-state.js +50 -18
- package/dist/core/run.d.ts +33 -27
- package/dist/core/run.js +24 -19
- 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 +3 -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 +5 -5
- 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 +69 -24
- package/dist/run-directory/run-record.js +39 -19
- 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 +179 -0
- package/dist/runner/build-snapshots.js +235 -0
- package/dist/runner/context.js +2 -1
- package/dist/runner/events.d.ts +71 -32
- package/dist/runner/gateways.d.ts +30 -10
- package/dist/runner/index.d.ts +8 -6
- package/dist/runner/index.js +5 -3
- package/dist/runner/live/checkout-gateway.js +15 -7
- package/dist/runner/live/snapshot-records.js +8 -7
- package/dist/runner/prepare.d.ts +24 -46
- package/dist/runner/prepare.js +27 -20
- package/dist/runner/ready.d.ts +43 -10
- package/dist/runner/ready.js +51 -34
- package/dist/runner/recipe.d.ts +42 -12
- package/dist/runner/recipe.js +36 -7
- package/dist/runner/scope.d.ts +5 -12
- package/dist/runner/scope.js +0 -4
- package/dist/runner/secrets.d.ts +6 -0
- package/dist/runner/secrets.js +10 -0
- package/dist/runner/session.d.ts +46 -18
- package/dist/runner/session.js +58 -29
- package/dist/runner/snapshot-build.d.ts +21 -11
- package/dist/runner/snapshot-build.js +11 -16
- package/dist/runner/snapshot-cache.d.ts +140 -62
- package/dist/runner/snapshot-cache.js +145 -102
- package/dist/runner/snapshot-inspect.d.ts +89 -0
- package/dist/runner/snapshot-inspect.js +173 -0
- package/dist/runner/snapshot-key.d.ts +5 -2
- package/dist/runner/snapshot-key.js +1 -1
- package/dist/runner/snapshot-save.d.ts +34 -20
- package/dist/runner/snapshot-save.js +46 -37
- package/dist/runner/snapshot-start.d.ts +25 -0
- package/dist/runner/snapshot-start.js +16 -0
- 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 +22 -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/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,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
+
DEFINITION_SET,
|
|
2
3
|
EXTENSIONS,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
formatPlan
|
|
6
|
-
} from "./chunk-NPPJ57W7.js";
|
|
4
|
+
RESOURCES
|
|
5
|
+
} from "./chunk-ISGQJIQM.js";
|
|
7
6
|
import {
|
|
8
7
|
median,
|
|
9
8
|
paint,
|
|
@@ -11,103 +10,28 @@ import {
|
|
|
11
10
|
shortFile,
|
|
12
11
|
truncate,
|
|
13
12
|
visibleLength
|
|
14
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-TMQQYHUX.js";
|
|
15
14
|
import {
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
megabytesText,
|
|
16
|
+
sameRow,
|
|
17
|
+
setupPhaseKey,
|
|
18
|
+
setupPhaseWords
|
|
19
|
+
} from "./chunk-FSP3SJ35.js";
|
|
18
20
|
import {
|
|
19
21
|
CONFIG_FILE_NAME
|
|
20
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ODQHQJLE.js";
|
|
21
23
|
import {
|
|
22
24
|
defaultResourceKey,
|
|
23
25
|
optionKeyPath
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
|
|
26
|
-
// src/commands/exec/resource-flags.ts
|
|
27
|
-
import { z } from "zod";
|
|
28
|
-
function flagField(prefix, option) {
|
|
29
|
-
return `${prefix}${option.charAt(0).toUpperCase()}${option.slice(1)}`;
|
|
30
|
-
}
|
|
31
|
-
function flagSpelling(field) {
|
|
32
|
-
return `--${field.replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase()}`;
|
|
33
|
-
}
|
|
34
|
-
var RESOURCE_FLAGS = RESOURCES.flatMap((definition) => {
|
|
35
|
-
const options = definition.options;
|
|
36
|
-
return Object.entries(options).flatMap(([option, rule]) => {
|
|
37
|
-
const help = rule.flag;
|
|
38
|
-
if (help === void 0) return [];
|
|
39
|
-
const field = flagField(definition.flagPrefix, option);
|
|
40
|
-
return [
|
|
41
|
-
{
|
|
42
|
-
definition: definition.name,
|
|
43
|
-
resource: defaultResourceKey(definition),
|
|
44
|
-
option,
|
|
45
|
-
field,
|
|
46
|
-
flag: flagSpelling(field),
|
|
47
|
-
rule,
|
|
48
|
-
help
|
|
49
|
-
}
|
|
50
|
-
];
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
var RESOURCE_FLAG_HELP = Object.fromEntries(
|
|
54
|
-
RESOURCE_FLAGS.map(({ field, help }) => [field, help])
|
|
55
|
-
);
|
|
56
|
-
var RESOURCE_USAGE_FLAGS = RESOURCE_FLAGS.map(({ flag, help, rule }) => {
|
|
57
|
-
if (help.valueLabel !== void 0) return `[${flag} <${help.valueLabel}>]`;
|
|
58
|
-
return rule.default === true ? `[${flag}=false]` : `[${flag}]`;
|
|
59
|
-
}).join(" ");
|
|
60
|
-
function resourceRunExamples(command) {
|
|
61
|
-
return EXTENSIONS.flatMap((extension) => extension.examples?.[command] ?? []);
|
|
62
|
-
}
|
|
63
|
-
function baseType(schema, field) {
|
|
64
|
-
let input = schema;
|
|
65
|
-
while (input instanceof z.ZodPipe) input = input.in;
|
|
66
|
-
if (input instanceof z.ZodNumber) return z.number();
|
|
67
|
-
if (input instanceof z.ZodString) return z.string();
|
|
68
|
-
if (input instanceof z.ZodBoolean) return z.boolean();
|
|
69
|
-
if (input instanceof z.ZodEnum) return input;
|
|
70
|
-
throw new Error(`The run flag ${field}'s option schema has no number, string, boolean or enum base`);
|
|
71
|
-
}
|
|
72
|
-
function resourceFlagFields(taken) {
|
|
73
|
-
const fields = {};
|
|
74
|
-
for (const { field, rule } of RESOURCE_FLAGS) {
|
|
75
|
-
if (Object.hasOwn(fields, field) || taken.includes(field))
|
|
76
|
-
throw new Error(`Two run flags share the request field ${field}`);
|
|
77
|
-
fields[field] = baseType(rule.schema, field).optional();
|
|
78
|
-
}
|
|
79
|
-
return fields;
|
|
80
|
-
}
|
|
81
|
-
function readResourceFlags(request) {
|
|
82
|
-
const values = {};
|
|
83
|
-
const problems = [];
|
|
84
|
-
for (const { definition, option, field, flag, rule } of RESOURCE_FLAGS) {
|
|
85
|
-
const value = request[field];
|
|
86
|
-
if (value === void 0) continue;
|
|
87
|
-
const checked = rule.schema.safeParse(value);
|
|
88
|
-
if (checked.success) values[definition] = { ...values[definition], [option]: checked.data };
|
|
89
|
-
else problems.push(...checked.error.issues.map(({ message }) => ({ field, message: `${flag} ${message}.` })));
|
|
90
|
-
}
|
|
91
|
-
if (problems.length > 0) return { ok: false, problems };
|
|
92
|
-
return { ok: true, values };
|
|
93
|
-
}
|
|
94
|
-
function resourceFlagProblems(request) {
|
|
95
|
-
const read = readResourceFlags(request);
|
|
96
|
-
return read.ok ? [] : read.problems;
|
|
97
|
-
}
|
|
98
|
-
function resourceFlagValues(request) {
|
|
99
|
-
const read = readResourceFlags(request);
|
|
100
|
-
if (!read.ok) throw new Error(`The flags should have been refused: ${read.problems.map((p) => p.message).join(" ")}`);
|
|
101
|
-
return read.values;
|
|
102
|
-
}
|
|
26
|
+
} from "./chunk-YT5OROR7.js";
|
|
103
27
|
|
|
104
28
|
// src/commands/exec/tests-summary.ts
|
|
105
29
|
var SLOWEST_FILES = 3;
|
|
106
|
-
function testsSummaryLines(events, unreadable = 0, incomplete) {
|
|
107
|
-
const summary = testsSummary(events, unreadable, incomplete);
|
|
30
|
+
function testsSummaryLines(events, hints, unreadable = 0, incomplete) {
|
|
31
|
+
const summary = testsSummary(events, hints, unreadable, incomplete);
|
|
108
32
|
return [
|
|
109
33
|
summary.tests,
|
|
110
|
-
summary.
|
|
34
|
+
...summary.setups.map((line) => ` ${line}`),
|
|
111
35
|
summary.slowest === void 0 ? void 0 : ` ${summary.slowest}`,
|
|
112
36
|
summary.unreadable,
|
|
113
37
|
summary.incomplete
|
|
@@ -116,8 +40,10 @@ function testsSummaryLines(events, unreadable = 0, incomplete) {
|
|
|
116
40
|
function incompleteText(message) {
|
|
117
41
|
return `the test results may be incomplete: couldn't read the test events file once the command ended: ${message}`;
|
|
118
42
|
}
|
|
119
|
-
|
|
120
|
-
|
|
43
|
+
function noFinalResultsText(hint) {
|
|
44
|
+
return `no final test results: ${hint}`;
|
|
45
|
+
}
|
|
46
|
+
function testsSummary(events, hints, unreadable = 0, incomplete) {
|
|
121
47
|
const results = [];
|
|
122
48
|
const reported = [];
|
|
123
49
|
for (const event of events) {
|
|
@@ -125,7 +51,7 @@ function testsSummary(events, unreadable = 0, incomplete) {
|
|
|
125
51
|
else reported.push(event);
|
|
126
52
|
}
|
|
127
53
|
let tests;
|
|
128
|
-
let
|
|
54
|
+
let setups = [];
|
|
129
55
|
let slowestText;
|
|
130
56
|
if (events.length > 0) {
|
|
131
57
|
const attempts = reported.flatMap((event) => event.kind === "test-attempt-finished" ? [event] : []);
|
|
@@ -134,7 +60,7 @@ function testsSummary(events, unreadable = 0, incomplete) {
|
|
|
134
60
|
let first = Infinity;
|
|
135
61
|
let last = -Infinity;
|
|
136
62
|
for (const event of reported) {
|
|
137
|
-
workers = Math.max(workers, event.worker);
|
|
63
|
+
workers = Math.max(workers, event.worker + 1);
|
|
138
64
|
first = Math.min(first, event.at);
|
|
139
65
|
last = Math.max(last, event.at);
|
|
140
66
|
}
|
|
@@ -142,7 +68,7 @@ function testsSummary(events, unreadable = 0, incomplete) {
|
|
|
142
68
|
const files = new Set(events.map((event) => event.file)).size;
|
|
143
69
|
const filesText = `${files} ${files === 1 ? "file" : "files"}`;
|
|
144
70
|
const outcome = results.length === 0 ? [
|
|
145
|
-
|
|
71
|
+
noFinalResultsText(hints.noFinalResults),
|
|
146
72
|
...attempts.length === 0 ? [] : [`${attempts.length} test ${attempts.length === 1 ? "attempt" : "attempts"}`],
|
|
147
73
|
filesText
|
|
148
74
|
] : resultTotals(results, filesText);
|
|
@@ -151,38 +77,49 @@ function testsSummary(events, unreadable = 0, incomplete) {
|
|
|
151
77
|
`${seconds(testMs)} of attempts on ${workers} ${workers === 1 ? "worker" : "workers"} in ${seconds(wallMs)}${busy}`
|
|
152
78
|
];
|
|
153
79
|
tests = ` tests ${[...outcome, ...timing].join(" \xB7 ")}`;
|
|
154
|
-
|
|
155
|
-
const warmups = [];
|
|
156
|
-
for (const event of reported) {
|
|
157
|
-
if (event.kind !== "container-started" || !event.ok) continue;
|
|
158
|
-
starts.push(event.ms);
|
|
159
|
-
if (event.warmupMs !== void 0) warmups.push(event.warmupMs);
|
|
160
|
-
}
|
|
161
|
-
if (starts.length > 0) {
|
|
162
|
-
let startMs = 0;
|
|
163
|
-
let fastest = Infinity;
|
|
164
|
-
let slowest2 = -Infinity;
|
|
165
|
-
for (const ms of starts) {
|
|
166
|
-
startMs += ms;
|
|
167
|
-
fastest = Math.min(fastest, ms);
|
|
168
|
-
slowest2 = Math.max(slowest2, ms);
|
|
169
|
-
}
|
|
170
|
-
const share = testMs > 0 ? ` \xB7 ~${Math.round(startMs / testMs * 100)}% of attempt time` : "";
|
|
171
|
-
const warmup = warmups.length === 0 ? "" : ` \xB7 warmup median ${seconds(median(warmups) ?? 0)}`;
|
|
172
|
-
containers = `container starts ${starts.length} \xB7 ${seconds(fastest)}\u2013${seconds(slowest2)} \xB7 median ${seconds(median(starts) ?? 0)}${share}${warmup}`;
|
|
173
|
-
}
|
|
80
|
+
setups = setupsText(reported, testMs);
|
|
174
81
|
const slowest = slowestFiles(reported);
|
|
175
82
|
if (slowest.length > 0)
|
|
176
83
|
slowestText = `slowest: ${slowest.map(({ file, ms }) => `${shortFile(file)} ${seconds(ms)}`).join(", ")}`;
|
|
177
84
|
}
|
|
178
85
|
return {
|
|
179
86
|
tests,
|
|
180
|
-
|
|
87
|
+
setups,
|
|
181
88
|
slowest: slowestText,
|
|
182
89
|
unreadable: unreadable > 0 ? ` tests skipped ${unreadable} unreadable test event ${unreadable === 1 ? "line" : "lines"}` : void 0,
|
|
183
90
|
incomplete: incomplete === void 0 ? void 0 : ` tests ${incompleteText(incomplete)}`
|
|
184
91
|
};
|
|
185
92
|
}
|
|
93
|
+
function setupWordsOf(events) {
|
|
94
|
+
return setupPhaseWords(
|
|
95
|
+
events.flatMap((event) => event.kind === "setup-started" || event.kind === "setup-finished" ? [event] : [])
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
function setupsText(events, testMs) {
|
|
99
|
+
const words = setupWordsOf(events);
|
|
100
|
+
const groups = /* @__PURE__ */ new Map();
|
|
101
|
+
for (const event of events) {
|
|
102
|
+
if (event.kind !== "setup-finished" || !event.ok) continue;
|
|
103
|
+
const key = setupPhaseKey(event);
|
|
104
|
+
const group = groups.get(key) ?? { label: words(event), starts: [], warmups: [] };
|
|
105
|
+
groups.set(key, group);
|
|
106
|
+
group.starts.push(event.ms);
|
|
107
|
+
if (event.warmupMs !== void 0) group.warmups.push(event.warmupMs);
|
|
108
|
+
}
|
|
109
|
+
return [...groups.values()].map(({ label, starts, warmups }) => {
|
|
110
|
+
let startMs = 0;
|
|
111
|
+
let fastest = Infinity;
|
|
112
|
+
let slowest = -Infinity;
|
|
113
|
+
for (const ms of starts) {
|
|
114
|
+
startMs += ms;
|
|
115
|
+
fastest = Math.min(fastest, ms);
|
|
116
|
+
slowest = Math.max(slowest, ms);
|
|
117
|
+
}
|
|
118
|
+
const share = testMs > 0 ? ` \xB7 ~${Math.round(startMs / testMs * 100)}% of attempt time` : "";
|
|
119
|
+
const warmup = warmups.length === 0 ? "" : ` \xB7 warmup median ${seconds(median(warmups) ?? 0)}`;
|
|
120
|
+
return `${label} starts ${starts.length} \xB7 ${seconds(fastest)}\u2013${seconds(slowest)} \xB7 median ${seconds(median(starts) ?? 0)}${share}${warmup}`;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
186
123
|
function resultTotals(results, filesText) {
|
|
187
124
|
const count = (state) => results.filter((event) => event.state === state).length;
|
|
188
125
|
const failed = count("fail");
|
|
@@ -213,21 +150,31 @@ var MAX_WORKER_ROWS = 16;
|
|
|
213
150
|
var MAX_LABEL_SHARE = 0.3;
|
|
214
151
|
var MAX_LABEL_WIDTH = 32;
|
|
215
152
|
var INDENT = " ";
|
|
216
|
-
function testsChart(events, unreadable, clock, incomplete) {
|
|
153
|
+
function testsChart(events, hints, unreadable, clock, incomplete) {
|
|
217
154
|
const lanes = workerLanes(events, clock);
|
|
218
155
|
if (lanes.length === 0) return void 0;
|
|
219
|
-
const summary = testsSummary(events, unreadable, incomplete);
|
|
220
|
-
const failed = lanes.reduce((sum, lane) => sum + lane.starts.filter((start) => !start.ok).length, 0);
|
|
156
|
+
const summary = testsSummary(events, hints, unreadable, incomplete);
|
|
221
157
|
const notes = [
|
|
222
158
|
summary.tests,
|
|
223
|
-
summary.
|
|
224
|
-
|
|
159
|
+
...summary.setups.map((line) => ` \u2591 ${line}`),
|
|
160
|
+
...failedSetupsText(lanes, setupWordsOf(events)).map((line) => ` \xD7 ${line}`),
|
|
225
161
|
lanes.some((lane) => lane.files.length > 1) ? " \u2588\u2593 a worker's files, in turn" : void 0,
|
|
226
162
|
summary.unreadable,
|
|
227
163
|
summary.incomplete
|
|
228
164
|
].filter((line) => line !== void 0);
|
|
229
165
|
return { lanes, notes };
|
|
230
166
|
}
|
|
167
|
+
function failedSetupsText(lanes, words) {
|
|
168
|
+
const failed = /* @__PURE__ */ new Map();
|
|
169
|
+
for (const setup of lanes.flatMap((lane) => lane.setups)) {
|
|
170
|
+
if (setup.ok) continue;
|
|
171
|
+
const key = setupPhaseKey(setup);
|
|
172
|
+
const group = failed.get(key) ?? { label: words(setup), count: 0 };
|
|
173
|
+
failed.set(key, group);
|
|
174
|
+
group.count += 1;
|
|
175
|
+
}
|
|
176
|
+
return [...failed.values()].map(({ label, count }) => `${count} ${label} ${count === 1 ? "start" : "starts"} failed`);
|
|
177
|
+
}
|
|
231
178
|
function workerLanes(events, clock) {
|
|
232
179
|
const reported = events.filter((event) => event.kind !== "test-result");
|
|
233
180
|
const lanes = lanesOf(reported, clock.runStartedAt - clock.offsetMs);
|
|
@@ -246,7 +193,7 @@ function workerLanes(events, clock) {
|
|
|
246
193
|
return lanes.map((lane) => ({
|
|
247
194
|
...moved(lane),
|
|
248
195
|
files: lane.files.map((run) => ({ ...moved(run), name: names.get(run.file) ?? run.file })),
|
|
249
|
-
|
|
196
|
+
setups: lane.setups.map(moved)
|
|
250
197
|
}));
|
|
251
198
|
}
|
|
252
199
|
function fileNames(files) {
|
|
@@ -302,10 +249,11 @@ function lanesOf(events, origin) {
|
|
|
302
249
|
const lanes = [];
|
|
303
250
|
for (const [worker, own] of [...byWorker].toSorted(([a], [b]) => a - b)) {
|
|
304
251
|
const files = [];
|
|
305
|
-
const
|
|
252
|
+
const setups = [];
|
|
306
253
|
const tests = /* @__PURE__ */ new Set();
|
|
307
254
|
const openFiles = /* @__PURE__ */ new Map();
|
|
308
|
-
const
|
|
255
|
+
const settingUp = /* @__PURE__ */ new Map();
|
|
256
|
+
const phase = (event) => `${event.file}\0${setupPhaseKey(event)}`;
|
|
309
257
|
let lastMs = -Infinity;
|
|
310
258
|
for (const event of own) {
|
|
311
259
|
const atMs = event.at - origin;
|
|
@@ -320,12 +268,18 @@ function lanesOf(events, origin) {
|
|
|
320
268
|
openFiles.delete(event.file);
|
|
321
269
|
break;
|
|
322
270
|
}
|
|
323
|
-
case "
|
|
324
|
-
|
|
271
|
+
case "setup-started":
|
|
272
|
+
settingUp.set(phase(event), { startMs: atMs, label: event.label, resource: event.resource });
|
|
325
273
|
break;
|
|
326
|
-
case "
|
|
327
|
-
|
|
328
|
-
|
|
274
|
+
case "setup-finished":
|
|
275
|
+
setups.push({
|
|
276
|
+
startMs: atMs - event.ms - (event.warmupMs ?? 0),
|
|
277
|
+
endMs: atMs,
|
|
278
|
+
ok: event.ok,
|
|
279
|
+
label: event.label,
|
|
280
|
+
resource: event.resource
|
|
281
|
+
});
|
|
282
|
+
settingUp.delete(phase(event));
|
|
329
283
|
break;
|
|
330
284
|
case "test-started":
|
|
331
285
|
tests.add(`${event.file}\0${event.test}`);
|
|
@@ -335,7 +289,7 @@ function lanesOf(events, origin) {
|
|
|
335
289
|
}
|
|
336
290
|
}
|
|
337
291
|
for (const [file, startMs2] of openFiles) files.push({ file, startMs: startMs2, endMs: lastMs });
|
|
338
|
-
for (const
|
|
292
|
+
for (const setup of settingUp.values()) setups.push({ ...setup, endMs: lastMs, ok: true });
|
|
339
293
|
if (files.length === 0) continue;
|
|
340
294
|
files.sort((a, b) => a.startMs - b.startMs);
|
|
341
295
|
let startMs = Infinity;
|
|
@@ -347,7 +301,7 @@ function lanesOf(events, origin) {
|
|
|
347
301
|
lanes.push({
|
|
348
302
|
worker,
|
|
349
303
|
files: files.map((run) => ({ ...run, name: run.file })),
|
|
350
|
-
|
|
304
|
+
setups,
|
|
351
305
|
startMs,
|
|
352
306
|
endMs,
|
|
353
307
|
tests: tests.size
|
|
@@ -359,15 +313,18 @@ function shownLanes(lanes) {
|
|
|
359
313
|
if (lanes.length <= MAX_WORKER_ROWS) return lanes;
|
|
360
314
|
return [...lanes].toSorted((a, b) => b.endMs - a.endMs || a.worker - b.worker).slice(0, MAX_WORKER_ROWS).toSorted((a, b) => a.worker - b.worker);
|
|
361
315
|
}
|
|
316
|
+
function workerNumber(lane) {
|
|
317
|
+
return lane.worker + 1;
|
|
318
|
+
}
|
|
362
319
|
function digitsOf(lanes) {
|
|
363
320
|
let worker = 1;
|
|
364
|
-
for (const lane of lanes) worker = Math.max(worker, lane
|
|
321
|
+
for (const lane of lanes) worker = Math.max(worker, workerNumber(lane));
|
|
365
322
|
return String(worker).length;
|
|
366
323
|
}
|
|
367
324
|
function labelText(lane, digits, room) {
|
|
368
325
|
const [first] = lane.files;
|
|
369
326
|
const more = lane.files.length > 1 ? ` +${lane.files.length - 1}` : "";
|
|
370
|
-
const head = `${INDENT}w${String(lane
|
|
327
|
+
const head = `${INDENT}w${String(workerNumber(lane)).padEnd(digits)} `;
|
|
371
328
|
const name = first?.name ?? "";
|
|
372
329
|
return `${head}${shortened(name, Math.max(1, room - head.length - more.length))}${more}`;
|
|
373
330
|
}
|
|
@@ -387,7 +344,7 @@ function workerTailWidth(lanes) {
|
|
|
387
344
|
for (const lane of shownLanes(lanes)) widest = Math.max(widest, tailText(lane).length);
|
|
388
345
|
return widest + 1;
|
|
389
346
|
}
|
|
390
|
-
var GLYPH = { file: "\u2588", "next-file": "\u2593",
|
|
347
|
+
var GLYPH = { file: "\u2588", "next-file": "\u2593", setup: "\u2591", "failed-setup": "\xD7" };
|
|
391
348
|
function laneLines(lane, digits, layout, waitedOn) {
|
|
392
349
|
const { labelWidth, column, width, paint: paint2 } = layout;
|
|
393
350
|
const startColumn = column(lane.startMs);
|
|
@@ -399,7 +356,7 @@ function laneLines(lane, digits, layout, waitedOn) {
|
|
|
399
356
|
for (let index = from; index < to; index += 1) cells[index] = cell;
|
|
400
357
|
};
|
|
401
358
|
lane.files.forEach((run, index) => fill(run, index % 2 === 0 ? "file" : "next-file"));
|
|
402
|
-
for (const
|
|
359
|
+
for (const setup of lane.setups) fill(setup, setup.ok ? "setup" : "failed-setup", !setup.ok);
|
|
403
360
|
const label = labelText(lane, digits, Math.min(labelWidth - 1, labelRoom(width))).padEnd(labelWidth);
|
|
404
361
|
const text = tailText(lane);
|
|
405
362
|
const line = `${label}${paintedBar(cells, paint2, waitedOn)}\u258F${text}`;
|
|
@@ -419,8 +376,8 @@ function paintedBar(cells, paint2, waitedOn) {
|
|
|
419
376
|
let end = index + 1;
|
|
420
377
|
while (end < cells.length && cells[end] === cell) end += 1;
|
|
421
378
|
const run = cell === void 0 ? " ".repeat(end - index) : GLYPH[cell].repeat(end - index);
|
|
422
|
-
if (cell === "
|
|
423
|
-
else if (cell === "failed-
|
|
379
|
+
if (cell === "setup") text += paint2.faint(run);
|
|
380
|
+
else if (cell === "failed-setup") text += paint2.failed(run);
|
|
424
381
|
else if (cell !== void 0 && waitedOn) text += paint2.active(run);
|
|
425
382
|
else text += run;
|
|
426
383
|
index = end;
|
|
@@ -442,7 +399,7 @@ var LANE_LABELS = [
|
|
|
442
399
|
"runner-setup",
|
|
443
400
|
"tests",
|
|
444
401
|
"cleanup",
|
|
445
|
-
...
|
|
402
|
+
...DEFINITION_SET.presentations.laneKinds.map(({ label }) => label)
|
|
446
403
|
];
|
|
447
404
|
function criticalPathStep(step, timeline) {
|
|
448
405
|
const row = timeline.rows.find((candidate) => sameRow(candidate, step));
|
|
@@ -512,13 +469,95 @@ function rowLines(row, layout, critical) {
|
|
|
512
469
|
}
|
|
513
470
|
function breakdownText(row) {
|
|
514
471
|
const steps = row.steps.map(
|
|
515
|
-
(step) => `${step.name} ${seconds(step.endMs - step.startMs)}${step.outcome === "done" ? "" : ` ${step.outcome}`}`
|
|
472
|
+
(step) => `${step.name} ${seconds(step.endMs - step.startMs)}${step.bytes === void 0 ? "" : ` (${megabytesText(step.bytes)})`}${step.outcome === "done" ? "" : ` ${step.outcome}`}`
|
|
516
473
|
);
|
|
517
474
|
if (row.sandboxes === void 0) return steps.join(" \xB7 ");
|
|
518
475
|
const counts = `${row.sandboxes.reused} reused, ${row.sandboxes.created} created`;
|
|
519
476
|
return [counts, ...steps.length > 1 ? steps : []].join(" \xB7 ");
|
|
520
477
|
}
|
|
521
478
|
|
|
479
|
+
// src/commands/exec/resource-flags.ts
|
|
480
|
+
import { z } from "zod";
|
|
481
|
+
function flagField(prefix, option) {
|
|
482
|
+
return `${prefix}${option.charAt(0).toUpperCase()}${option.slice(1)}`;
|
|
483
|
+
}
|
|
484
|
+
function flagSpelling(field) {
|
|
485
|
+
return `--${field.replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase()}`;
|
|
486
|
+
}
|
|
487
|
+
var RESOURCE_FLAGS = RESOURCES.flatMap((definition) => {
|
|
488
|
+
const options = definition.options;
|
|
489
|
+
return Object.entries(options).flatMap(([option, rule]) => {
|
|
490
|
+
const help = rule.flag;
|
|
491
|
+
if (help === void 0) return [];
|
|
492
|
+
const field = flagField(definition.flagPrefix, option);
|
|
493
|
+
return [
|
|
494
|
+
{
|
|
495
|
+
definition: definition.name,
|
|
496
|
+
resource: defaultResourceKey(definition),
|
|
497
|
+
option,
|
|
498
|
+
field,
|
|
499
|
+
flag: flagSpelling(field),
|
|
500
|
+
rule,
|
|
501
|
+
help
|
|
502
|
+
}
|
|
503
|
+
];
|
|
504
|
+
});
|
|
505
|
+
});
|
|
506
|
+
var RESOURCE_FLAG_HELP = Object.fromEntries(
|
|
507
|
+
RESOURCE_FLAGS.map(({ field, help }) => [field, help])
|
|
508
|
+
);
|
|
509
|
+
var RESOURCE_USAGE_FLAGS = RESOURCE_FLAGS.map(({ flag, help, rule }) => {
|
|
510
|
+
if (help.valueLabel !== void 0) return `[${flag} <${help.valueLabel}>]`;
|
|
511
|
+
return rule.default === true ? `[${flag}=false]` : `[${flag}]`;
|
|
512
|
+
}).join(" ");
|
|
513
|
+
function resourceRunExamples(of) {
|
|
514
|
+
return EXTENSIONS.flatMap(({ examples }) => {
|
|
515
|
+
if (examples === void 0) return [];
|
|
516
|
+
if (of === "exec") return examples.exec;
|
|
517
|
+
return Object.hasOwn(examples.drivers, of.driver) ? examples.drivers[of.driver] ?? [] : [];
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
function baseType(schema, field) {
|
|
521
|
+
let input = schema;
|
|
522
|
+
while (input instanceof z.ZodPipe) input = input.in;
|
|
523
|
+
if (input instanceof z.ZodNumber) return z.number();
|
|
524
|
+
if (input instanceof z.ZodString) return z.string();
|
|
525
|
+
if (input instanceof z.ZodBoolean) return z.boolean();
|
|
526
|
+
if (input instanceof z.ZodEnum) return input;
|
|
527
|
+
throw new Error(`The run flag ${field}'s option schema has no number, string, boolean or enum base`);
|
|
528
|
+
}
|
|
529
|
+
function resourceFlagFields(taken) {
|
|
530
|
+
const fields = {};
|
|
531
|
+
for (const { field, rule } of RESOURCE_FLAGS) {
|
|
532
|
+
if (Object.hasOwn(fields, field) || taken.includes(field))
|
|
533
|
+
throw new Error(`Two run flags share the request field ${field}`);
|
|
534
|
+
fields[field] = baseType(rule.schema, field).optional();
|
|
535
|
+
}
|
|
536
|
+
return fields;
|
|
537
|
+
}
|
|
538
|
+
function readResourceFlags(request) {
|
|
539
|
+
const values = {};
|
|
540
|
+
const problems = [];
|
|
541
|
+
for (const { definition, option, field, flag, rule } of RESOURCE_FLAGS) {
|
|
542
|
+
const value = request[field];
|
|
543
|
+
if (value === void 0) continue;
|
|
544
|
+
const checked = rule.schema.safeParse(value);
|
|
545
|
+
if (checked.success) values[definition] = { ...values[definition], [option]: checked.data };
|
|
546
|
+
else problems.push(...checked.error.issues.map(({ message }) => ({ field, message: `${flag} ${message}.` })));
|
|
547
|
+
}
|
|
548
|
+
if (problems.length > 0) return { ok: false, problems };
|
|
549
|
+
return { ok: true, values };
|
|
550
|
+
}
|
|
551
|
+
function resourceFlagProblems(request) {
|
|
552
|
+
const read = readResourceFlags(request);
|
|
553
|
+
return read.ok ? [] : read.problems;
|
|
554
|
+
}
|
|
555
|
+
function resourceFlagValues(request) {
|
|
556
|
+
const read = readResourceFlags(request);
|
|
557
|
+
if (!read.ok) throw new Error(`The flags should have been refused: ${read.problems.map((p) => p.message).join(" ")}`);
|
|
558
|
+
return read.values;
|
|
559
|
+
}
|
|
560
|
+
|
|
522
561
|
// src/commands/exec/test-plan.ts
|
|
523
562
|
function recordedPlan(testPlan, options) {
|
|
524
563
|
return testPlan.kind === "counted" ? { tests: testPlan.tests, files: testPlan.files, options: options.map((option) => ({ ...option })) } : void 0;
|
|
@@ -527,7 +566,10 @@ function testPlanLine(plan) {
|
|
|
527
566
|
return `Running ${testPlanText(plan)}`;
|
|
528
567
|
}
|
|
529
568
|
function testPlanText(plan) {
|
|
530
|
-
return [
|
|
569
|
+
return [countText(plan), ...plan.options.map(planOptionText)].join("; ");
|
|
570
|
+
}
|
|
571
|
+
function countText({ tests, files }) {
|
|
572
|
+
return `${tests} ${tests === 1 ? "test" : "tests"} in ${files} ${files === 1 ? "file" : "files"}`;
|
|
531
573
|
}
|
|
532
574
|
function planOptionText({ path, value, from }) {
|
|
533
575
|
return `${path} ${String(value)} (${fromText(path, from)})`;
|
|
@@ -544,16 +586,16 @@ function fromText(path, from) {
|
|
|
544
586
|
}
|
|
545
587
|
|
|
546
588
|
export {
|
|
589
|
+
testsSummaryLines,
|
|
590
|
+
testsChart,
|
|
591
|
+
criticalPathStep,
|
|
592
|
+
waterfallLines,
|
|
547
593
|
RESOURCE_FLAG_HELP,
|
|
548
594
|
RESOURCE_USAGE_FLAGS,
|
|
549
595
|
resourceRunExamples,
|
|
550
596
|
resourceFlagFields,
|
|
551
597
|
resourceFlagProblems,
|
|
552
598
|
resourceFlagValues,
|
|
553
|
-
testsSummaryLines,
|
|
554
|
-
testsChart,
|
|
555
|
-
criticalPathStep,
|
|
556
|
-
waterfallLines,
|
|
557
599
|
recordedPlan,
|
|
558
600
|
testPlanLine,
|
|
559
601
|
testPlanText
|