@opensip-cli/simulation 0.1.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/LICENSE +202 -0
- package/NOTICE +8 -0
- package/README.md +31 -0
- package/dist/__tests__/internal-surface.test.d.ts +9 -0
- package/dist/__tests__/internal-surface.test.d.ts.map +1 -0
- package/dist/__tests__/internal-surface.test.js +38 -0
- package/dist/__tests__/internal-surface.test.js.map +1 -0
- package/dist/__tests__/plugin-loader.test.d.ts +2 -0
- package/dist/__tests__/plugin-loader.test.d.ts.map +1 -0
- package/dist/__tests__/plugin-loader.test.js +64 -0
- package/dist/__tests__/plugin-loader.test.js.map +1 -0
- package/dist/__tests__/public-api.test.d.ts +15 -0
- package/dist/__tests__/public-api.test.d.ts.map +1 -0
- package/dist/__tests__/public-api.test.js +73 -0
- package/dist/__tests__/public-api.test.js.map +1 -0
- package/dist/__tests__/registry-cross-kind.test.d.ts +6 -0
- package/dist/__tests__/registry-cross-kind.test.d.ts.map +1 -0
- package/dist/__tests__/registry-cross-kind.test.js +86 -0
- package/dist/__tests__/registry-cross-kind.test.js.map +1 -0
- package/dist/__tests__/scenario-execution.test.d.ts +10 -0
- package/dist/__tests__/scenario-execution.test.d.ts.map +1 -0
- package/dist/__tests__/scenario-execution.test.js +92 -0
- package/dist/__tests__/scenario-execution.test.js.map +1 -0
- package/dist/__tests__/sim-capability-contract.test.d.ts +10 -0
- package/dist/__tests__/sim-capability-contract.test.d.ts.map +1 -0
- package/dist/__tests__/sim-capability-contract.test.js +131 -0
- package/dist/__tests__/sim-capability-contract.test.js.map +1 -0
- package/dist/__tests__/sim-config-schema.test.d.ts +5 -0
- package/dist/__tests__/sim-config-schema.test.d.ts.map +1 -0
- package/dist/__tests__/sim-config-schema.test.js +23 -0
- package/dist/__tests__/sim-config-schema.test.js.map +1 -0
- package/dist/__tests__/sim-failure-signal.test.d.ts +10 -0
- package/dist/__tests__/sim-failure-signal.test.d.ts.map +1 -0
- package/dist/__tests__/sim-failure-signal.test.js +86 -0
- package/dist/__tests__/sim-failure-signal.test.js.map +1 -0
- package/dist/__tests__/surviving-surface-edges.test.d.ts +10 -0
- package/dist/__tests__/surviving-surface-edges.test.d.ts.map +1 -0
- package/dist/__tests__/surviving-surface-edges.test.js +122 -0
- package/dist/__tests__/surviving-surface-edges.test.js.map +1 -0
- package/dist/__tests__/test-utils/targets.d.ts +26 -0
- package/dist/__tests__/test-utils/targets.d.ts.map +1 -0
- package/dist/__tests__/test-utils/targets.js +38 -0
- package/dist/__tests__/test-utils/targets.js.map +1 -0
- package/dist/__tests__/test-utils/with-sim-scope.d.ts +12 -0
- package/dist/__tests__/test-utils/with-sim-scope.d.ts.map +1 -0
- package/dist/__tests__/test-utils/with-sim-scope.js +22 -0
- package/dist/__tests__/test-utils/with-sim-scope.js.map +1 -0
- package/dist/__tests__/tool-live-view.test.d.ts +20 -0
- package/dist/__tests__/tool-live-view.test.d.ts.map +1 -0
- package/dist/__tests__/tool-live-view.test.js +146 -0
- package/dist/__tests__/tool-live-view.test.js.map +1 -0
- package/dist/__tests__/tool-show-mode.test.d.ts +10 -0
- package/dist/__tests__/tool-show-mode.test.d.ts.map +1 -0
- package/dist/__tests__/tool-show-mode.test.js +156 -0
- package/dist/__tests__/tool-show-mode.test.js.map +1 -0
- package/dist/__tests__/tool.test.d.ts +15 -0
- package/dist/__tests__/tool.test.d.ts.map +1 -0
- package/dist/__tests__/tool.test.js +250 -0
- package/dist/__tests__/tool.test.js.map +1 -0
- package/dist/cli/__tests__/sim-config.test.d.ts +2 -0
- package/dist/cli/__tests__/sim-config.test.d.ts.map +1 -0
- package/dist/cli/__tests__/sim-config.test.js +94 -0
- package/dist/cli/__tests__/sim-config.test.js.map +1 -0
- package/dist/cli/__tests__/sim-runner.test.d.ts +23 -0
- package/dist/cli/__tests__/sim-runner.test.d.ts.map +1 -0
- package/dist/cli/__tests__/sim-runner.test.js +188 -0
- package/dist/cli/__tests__/sim-runner.test.js.map +1 -0
- package/dist/cli/__tests__/sim-worker.test.d.ts +12 -0
- package/dist/cli/__tests__/sim-worker.test.d.ts.map +1 -0
- package/dist/cli/__tests__/sim-worker.test.js +69 -0
- package/dist/cli/__tests__/sim-worker.test.js.map +1 -0
- package/dist/cli/__tests__/sim.test.d.ts +2 -0
- package/dist/cli/__tests__/sim.test.d.ts.map +1 -0
- package/dist/cli/__tests__/sim.test.js +232 -0
- package/dist/cli/__tests__/sim.test.js.map +1 -0
- package/dist/cli/sim-config-schema.d.ts +30 -0
- package/dist/cli/sim-config-schema.d.ts.map +1 -0
- package/dist/cli/sim-config-schema.js +33 -0
- package/dist/cli/sim-config-schema.js.map +1 -0
- package/dist/cli/sim-config.d.ts +22 -0
- package/dist/cli/sim-config.d.ts.map +1 -0
- package/dist/cli/sim-config.js +73 -0
- package/dist/cli/sim-config.js.map +1 -0
- package/dist/cli/sim-runner.d.ts +60 -0
- package/dist/cli/sim-runner.d.ts.map +1 -0
- package/dist/cli/sim-runner.js +175 -0
- package/dist/cli/sim-runner.js.map +1 -0
- package/dist/cli/sim-worker.d.ts +24 -0
- package/dist/cli/sim-worker.d.ts.map +1 -0
- package/dist/cli/sim-worker.js +65 -0
- package/dist/cli/sim-worker.js.map +1 -0
- package/dist/cli/sim.d.ts +56 -0
- package/dist/cli/sim.d.ts.map +1 -0
- package/dist/cli/sim.js +265 -0
- package/dist/cli/sim.js.map +1 -0
- package/dist/framework/__tests__/assertions.test.d.ts +2 -0
- package/dist/framework/__tests__/assertions.test.d.ts.map +1 -0
- package/dist/framework/__tests__/assertions.test.js +122 -0
- package/dist/framework/__tests__/assertions.test.js.map +1 -0
- package/dist/framework/__tests__/misc-coverage.test.d.ts +18 -0
- package/dist/framework/__tests__/misc-coverage.test.d.ts.map +1 -0
- package/dist/framework/__tests__/misc-coverage.test.js +142 -0
- package/dist/framework/__tests__/misc-coverage.test.js.map +1 -0
- package/dist/framework/__tests__/resolve-metric.test.d.ts +12 -0
- package/dist/framework/__tests__/resolve-metric.test.d.ts.map +1 -0
- package/dist/framework/__tests__/resolve-metric.test.js +124 -0
- package/dist/framework/__tests__/resolve-metric.test.js.map +1 -0
- package/dist/framework/__tests__/result-builder.test.d.ts +2 -0
- package/dist/framework/__tests__/result-builder.test.d.ts.map +1 -0
- package/dist/framework/__tests__/result-builder.test.js +180 -0
- package/dist/framework/__tests__/result-builder.test.js.map +1 -0
- package/dist/framework/__tests__/scenario-logger.test.d.ts +9 -0
- package/dist/framework/__tests__/scenario-logger.test.d.ts.map +1 -0
- package/dist/framework/__tests__/scenario-logger.test.js +110 -0
- package/dist/framework/__tests__/scenario-logger.test.js.map +1 -0
- package/dist/framework/__tests__/validation.test.d.ts +9 -0
- package/dist/framework/__tests__/validation.test.d.ts.map +1 -0
- package/dist/framework/__tests__/validation.test.js +126 -0
- package/dist/framework/__tests__/validation.test.js.map +1 -0
- package/dist/framework/assertions.d.ts +106 -0
- package/dist/framework/assertions.d.ts.map +1 -0
- package/dist/framework/assertions.js +256 -0
- package/dist/framework/assertions.js.map +1 -0
- package/dist/framework/execution/__tests__/execution-engine.test.d.ts +9 -0
- package/dist/framework/execution/__tests__/execution-engine.test.d.ts.map +1 -0
- package/dist/framework/execution/__tests__/execution-engine.test.js +138 -0
- package/dist/framework/execution/__tests__/execution-engine.test.js.map +1 -0
- package/dist/framework/execution/__tests__/fault-builders.test.d.ts +5 -0
- package/dist/framework/execution/__tests__/fault-builders.test.d.ts.map +1 -0
- package/dist/framework/execution/__tests__/fault-builders.test.js +23 -0
- package/dist/framework/execution/__tests__/fault-builders.test.js.map +1 -0
- package/dist/framework/execution/__tests__/fault-model.test.d.ts +6 -0
- package/dist/framework/execution/__tests__/fault-model.test.d.ts.map +1 -0
- package/dist/framework/execution/__tests__/fault-model.test.js +64 -0
- package/dist/framework/execution/__tests__/fault-model.test.js.map +1 -0
- package/dist/framework/execution/__tests__/http-target.test.d.ts +5 -0
- package/dist/framework/execution/__tests__/http-target.test.d.ts.map +1 -0
- package/dist/framework/execution/__tests__/http-target.test.js +36 -0
- package/dist/framework/execution/__tests__/http-target.test.js.map +1 -0
- package/dist/framework/execution/__tests__/run-load-window.test.d.ts +7 -0
- package/dist/framework/execution/__tests__/run-load-window.test.d.ts.map +1 -0
- package/dist/framework/execution/__tests__/run-load-window.test.js +89 -0
- package/dist/framework/execution/__tests__/run-load-window.test.js.map +1 -0
- package/dist/framework/execution/execution-engine.d.ts +55 -0
- package/dist/framework/execution/execution-engine.d.ts.map +1 -0
- package/dist/framework/execution/execution-engine.js +111 -0
- package/dist/framework/execution/execution-engine.js.map +1 -0
- package/dist/framework/execution/fault-builders.d.ts +26 -0
- package/dist/framework/execution/fault-builders.d.ts.map +1 -0
- package/dist/framework/execution/fault-builders.js +24 -0
- package/dist/framework/execution/fault-builders.js.map +1 -0
- package/dist/framework/execution/fault-model.d.ts +49 -0
- package/dist/framework/execution/fault-model.d.ts.map +1 -0
- package/dist/framework/execution/fault-model.js +108 -0
- package/dist/framework/execution/fault-model.js.map +1 -0
- package/dist/framework/execution/fault-spec.d.ts +40 -0
- package/dist/framework/execution/fault-spec.d.ts.map +1 -0
- package/dist/framework/execution/fault-spec.js +23 -0
- package/dist/framework/execution/fault-spec.js.map +1 -0
- package/dist/framework/execution/http-target.d.ts +34 -0
- package/dist/framework/execution/http-target.d.ts.map +1 -0
- package/dist/framework/execution/http-target.js +41 -0
- package/dist/framework/execution/http-target.js.map +1 -0
- package/dist/framework/execution/latency-tracker.d.ts +44 -0
- package/dist/framework/execution/latency-tracker.d.ts.map +1 -0
- package/dist/framework/execution/latency-tracker.js +76 -0
- package/dist/framework/execution/latency-tracker.js.map +1 -0
- package/dist/framework/execution/run-load-window.d.ts +45 -0
- package/dist/framework/execution/run-load-window.d.ts.map +1 -0
- package/dist/framework/execution/run-load-window.js +136 -0
- package/dist/framework/execution/run-load-window.js.map +1 -0
- package/dist/framework/execution/scenario-aborted-error.d.ts +14 -0
- package/dist/framework/execution/scenario-aborted-error.d.ts.map +1 -0
- package/dist/framework/execution/scenario-aborted-error.js +24 -0
- package/dist/framework/execution/scenario-aborted-error.js.map +1 -0
- package/dist/framework/execution/target.d.ts +35 -0
- package/dist/framework/execution/target.d.ts.map +1 -0
- package/dist/framework/execution/target.js +21 -0
- package/dist/framework/execution/target.js.map +1 -0
- package/dist/framework/registry.d.ts +67 -0
- package/dist/framework/registry.d.ts.map +1 -0
- package/dist/framework/registry.js +113 -0
- package/dist/framework/registry.js.map +1 -0
- package/dist/framework/resolve-metric.d.ts +79 -0
- package/dist/framework/resolve-metric.d.ts.map +1 -0
- package/dist/framework/resolve-metric.js +135 -0
- package/dist/framework/resolve-metric.js.map +1 -0
- package/dist/framework/result-builder.d.ts +72 -0
- package/dist/framework/result-builder.d.ts.map +1 -0
- package/dist/framework/result-builder.js +214 -0
- package/dist/framework/result-builder.js.map +1 -0
- package/dist/framework/result-renderers.d.ts +37 -0
- package/dist/framework/result-renderers.d.ts.map +1 -0
- package/dist/framework/result-renderers.js +62 -0
- package/dist/framework/result-renderers.js.map +1 -0
- package/dist/framework/runnable-scenario.d.ts +37 -0
- package/dist/framework/runnable-scenario.d.ts.map +1 -0
- package/dist/framework/runnable-scenario.js +9 -0
- package/dist/framework/runnable-scenario.js.map +1 -0
- package/dist/framework/scenario-executor-result.d.ts +44 -0
- package/dist/framework/scenario-executor-result.d.ts.map +1 -0
- package/dist/framework/scenario-executor-result.js +13 -0
- package/dist/framework/scenario-executor-result.js.map +1 -0
- package/dist/framework/scenario-logger.d.ts +18 -0
- package/dist/framework/scenario-logger.d.ts.map +1 -0
- package/dist/framework/scenario-logger.js +39 -0
- package/dist/framework/scenario-logger.js.map +1 -0
- package/dist/framework/scenario-metric-key.d.ts +24 -0
- package/dist/framework/scenario-metric-key.d.ts.map +1 -0
- package/dist/framework/scenario-metric-key.js +17 -0
- package/dist/framework/scenario-metric-key.js.map +1 -0
- package/dist/framework/validation.d.ts +83 -0
- package/dist/framework/validation.d.ts.map +1 -0
- package/dist/framework/validation.js +93 -0
- package/dist/framework/validation.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +53 -0
- package/dist/index.js.map +1 -0
- package/dist/internal.d.ts +19 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +16 -0
- package/dist/internal.js.map +1 -0
- package/dist/kinds/chaos/__tests__/executor.test.d.ts +6 -0
- package/dist/kinds/chaos/__tests__/executor.test.d.ts.map +1 -0
- package/dist/kinds/chaos/__tests__/executor.test.js +117 -0
- package/dist/kinds/chaos/__tests__/executor.test.js.map +1 -0
- package/dist/kinds/chaos/config.d.ts +48 -0
- package/dist/kinds/chaos/config.d.ts.map +1 -0
- package/dist/kinds/chaos/config.js +15 -0
- package/dist/kinds/chaos/config.js.map +1 -0
- package/dist/kinds/chaos/define.d.ts +32 -0
- package/dist/kinds/chaos/define.d.ts.map +1 -0
- package/dist/kinds/chaos/define.js +111 -0
- package/dist/kinds/chaos/define.js.map +1 -0
- package/dist/kinds/chaos/executor.d.ts +21 -0
- package/dist/kinds/chaos/executor.d.ts.map +1 -0
- package/dist/kinds/chaos/executor.js +107 -0
- package/dist/kinds/chaos/executor.js.map +1 -0
- package/dist/kinds/chaos/result.d.ts +43 -0
- package/dist/kinds/chaos/result.d.ts.map +1 -0
- package/dist/kinds/chaos/result.js +12 -0
- package/dist/kinds/chaos/result.js.map +1 -0
- package/dist/kinds/load/__tests__/executor.test.d.ts +6 -0
- package/dist/kinds/load/__tests__/executor.test.d.ts.map +1 -0
- package/dist/kinds/load/__tests__/executor.test.js +75 -0
- package/dist/kinds/load/__tests__/executor.test.js.map +1 -0
- package/dist/kinds/load/config.d.ts +30 -0
- package/dist/kinds/load/config.d.ts.map +1 -0
- package/dist/kinds/load/config.js +9 -0
- package/dist/kinds/load/config.js.map +1 -0
- package/dist/kinds/load/define.d.ts +47 -0
- package/dist/kinds/load/define.d.ts.map +1 -0
- package/dist/kinds/load/define.js +76 -0
- package/dist/kinds/load/define.js.map +1 -0
- package/dist/kinds/load/executor.d.ts +16 -0
- package/dist/kinds/load/executor.d.ts.map +1 -0
- package/dist/kinds/load/executor.js +90 -0
- package/dist/kinds/load/executor.js.map +1 -0
- package/dist/kinds/load/result.d.ts +21 -0
- package/dist/kinds/load/result.d.ts.map +1 -0
- package/dist/kinds/load/result.js +10 -0
- package/dist/kinds/load/result.js.map +1 -0
- package/dist/persistence/session-payload.d.ts +32 -0
- package/dist/persistence/session-payload.d.ts.map +1 -0
- package/dist/persistence/session-payload.js +46 -0
- package/dist/persistence/session-payload.js.map +1 -0
- package/dist/persistence/session-replay.d.ts +13 -0
- package/dist/persistence/session-replay.d.ts.map +1 -0
- package/dist/persistence/session-replay.js +76 -0
- package/dist/persistence/session-replay.js.map +1 -0
- package/dist/persistence/session-replay.test.d.ts +10 -0
- package/dist/persistence/session-replay.test.d.ts.map +1 -0
- package/dist/persistence/session-replay.test.js +169 -0
- package/dist/persistence/session-replay.test.js.map +1 -0
- package/dist/plugins/__tests__/loader-scenarios.test.d.ts +12 -0
- package/dist/plugins/__tests__/loader-scenarios.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/loader-scenarios.test.js +61 -0
- package/dist/plugins/__tests__/loader-scenarios.test.js.map +1 -0
- package/dist/plugins/__tests__/scenario-package-discovery.test.d.ts +2 -0
- package/dist/plugins/__tests__/scenario-package-discovery.test.d.ts.map +1 -0
- package/dist/plugins/__tests__/scenario-package-discovery.test.js +43 -0
- package/dist/plugins/__tests__/scenario-package-discovery.test.js.map +1 -0
- package/dist/plugins/loader.d.ts +32 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +119 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/scenario-package-discovery.d.ts +23 -0
- package/dist/plugins/scenario-package-discovery.d.ts.map +1 -0
- package/dist/plugins/scenario-package-discovery.js +42 -0
- package/dist/plugins/scenario-package-discovery.js.map +1 -0
- package/dist/plugins/types.d.ts +24 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +18 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/recipes/__tests__/recipes.test.d.ts +2 -0
- package/dist/recipes/__tests__/recipes.test.d.ts.map +1 -0
- package/dist/recipes/__tests__/recipes.test.js +515 -0
- package/dist/recipes/__tests__/recipes.test.js.map +1 -0
- package/dist/recipes/built-in-recipes.d.ts +16 -0
- package/dist/recipes/built-in-recipes.d.ts.map +1 -0
- package/dist/recipes/built-in-recipes.js +37 -0
- package/dist/recipes/built-in-recipes.js.map +1 -0
- package/dist/recipes/define-recipe.d.ts +29 -0
- package/dist/recipes/define-recipe.d.ts.map +1 -0
- package/dist/recipes/define-recipe.js +68 -0
- package/dist/recipes/define-recipe.js.map +1 -0
- package/dist/recipes/registry.d.ts +54 -0
- package/dist/recipes/registry.d.ts.map +1 -0
- package/dist/recipes/registry.js +89 -0
- package/dist/recipes/registry.js.map +1 -0
- package/dist/recipes/service.d.ts +61 -0
- package/dist/recipes/service.d.ts.map +1 -0
- package/dist/recipes/service.js +205 -0
- package/dist/recipes/service.js.map +1 -0
- package/dist/recipes/types.d.ts +62 -0
- package/dist/recipes/types.d.ts.map +1 -0
- package/dist/recipes/types.js +10 -0
- package/dist/recipes/types.js.map +1 -0
- package/dist/scaffold/examples.d.ts +22 -0
- package/dist/scaffold/examples.d.ts.map +1 -0
- package/dist/scaffold/examples.js +91 -0
- package/dist/scaffold/examples.js.map +1 -0
- package/dist/scope-augmentation.d.ts +70 -0
- package/dist/scope-augmentation.d.ts.map +1 -0
- package/dist/scope-augmentation.js +28 -0
- package/dist/scope-augmentation.js.map +1 -0
- package/dist/tool.d.ts +21 -0
- package/dist/tool.d.ts.map +1 -0
- package/dist/tool.js +347 -0
- package/dist/tool.js.map +1 -0
- package/dist/types/base-types.d.ts +35 -0
- package/dist/types/base-types.d.ts.map +1 -0
- package/dist/types/base-types.js +8 -0
- package/dist/types/base-types.js.map +1 -0
- package/dist/types/framework-types.d.ts +62 -0
- package/dist/types/framework-types.d.ts.map +1 -0
- package/dist/types/framework-types.js +15 -0
- package/dist/types/framework-types.js.map +1 -0
- package/dist/types/kind-types.d.ts +24 -0
- package/dist/types/kind-types.d.ts.map +1 -0
- package/dist/types/kind-types.js +22 -0
- package/dist/types/kind-types.js.map +1 -0
- package/dist/types/workload.d.ts +30 -0
- package/dist/types/workload.d.ts.map +1 -0
- package/dist/types/workload.js +20 -0
- package/dist/types/workload.js.map +1 -0
- package/package.json +120 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Test helper — construct a RunScope with the simulation
|
|
3
|
+
* subscope attached, then run a callback inside it.
|
|
4
|
+
*
|
|
5
|
+
* After Item 1 the scenario + recipe registries are per-RunScope. Tests
|
|
6
|
+
* that touch them must build a scope first; this helper centralises the
|
|
7
|
+
* boilerplate.
|
|
8
|
+
*/
|
|
9
|
+
import { RunScope } from '@opensip-cli/core';
|
|
10
|
+
/** Build a fresh RunScope with `scope.simulation` populated. */
|
|
11
|
+
export declare function makeSimTestScope(): RunScope;
|
|
12
|
+
//# sourceMappingURL=with-sim-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-sim-scope.d.ts","sourceRoot":"","sources":["../../../src/__tests__/test-utils/with-sim-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAoB,QAAQ,EAAgB,MAAM,mBAAmB,CAAC;AAW7E,gEAAgE;AAChE,wBAAgB,gBAAgB,IAAI,QAAQ,CAI3C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Test helper — construct a RunScope with the simulation
|
|
3
|
+
* subscope attached, then run a callback inside it.
|
|
4
|
+
*
|
|
5
|
+
* After Item 1 the scenario + recipe registries are per-RunScope. Tests
|
|
6
|
+
* that touch them must build a scope first; this helper centralises the
|
|
7
|
+
* boilerplate.
|
|
8
|
+
*/
|
|
9
|
+
import { LanguageRegistry, RunScope, ToolRegistry } from '@opensip-cli/core';
|
|
10
|
+
import { simulationTool } from '../../tool.js';
|
|
11
|
+
/** Fresh scope with empty registries — local equivalent of the retired
|
|
12
|
+
* `@opensip-cli/core/test-utils` helper (ADR-0040: that sugar moved to
|
|
13
|
+
* `@opensip-cli/test-support`, which this package's tests cannot use
|
|
14
|
+
* without coupling its test graph to the fitness engine). */
|
|
15
|
+
const makeTestScope = () => new RunScope({ languages: new LanguageRegistry(), tools: new ToolRegistry() });
|
|
16
|
+
/** Build a fresh RunScope with `scope.simulation` populated. */
|
|
17
|
+
export function makeSimTestScope() {
|
|
18
|
+
const scope = makeTestScope();
|
|
19
|
+
Object.assign(scope, simulationTool.contributeScope?.() ?? {});
|
|
20
|
+
return scope;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=with-sim-scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-sim-scope.js","sourceRoot":"","sources":["../../../src/__tests__/test-utils/with-sim-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE7E,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C;;;8DAG8D;AAC9D,MAAM,aAAa,GAAG,GAAa,EAAE,CACnC,IAAI,QAAQ,CAAC,EAAE,SAAS,EAAE,IAAI,gBAAgB,EAAE,EAAE,KAAK,EAAE,IAAI,YAAY,EAAE,EAAE,CAAC,CAAC;AAEjF,gEAAgE;AAChE,MAAM,UAAU,gBAAgB;IAC9B,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC;IAC9B,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/D,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Tests for simulationTool's live-view wiring (ADR-0016) — the
|
|
3
|
+
* paths the static-render tool.test.ts can't reach:
|
|
4
|
+
*
|
|
5
|
+
* - the interactive TTY branch of the `sim` handler registers a live view
|
|
6
|
+
* under the `sim` key, and that callback renders the live view then
|
|
7
|
+
* delivers the returned envelope to the composition root (cloud +
|
|
8
|
+
* --report-to egress).
|
|
9
|
+
* - the interactive TTY action branch routes to cli.renderLive +
|
|
10
|
+
* maybeOpenReport instead of the static executeSim path.
|
|
11
|
+
*
|
|
12
|
+
* Since release 2.11.0 Phase 3 sim mounts via a `CommandSpec`; the live-view
|
|
13
|
+
* registration moved from the (removed) `register()` mount hook into the
|
|
14
|
+
* handler's interactive branch, where it runs lazily before `cli.renderLive`.
|
|
15
|
+
* We drive the handler directly (the host invokes it post-parse) with
|
|
16
|
+
* `process.stdout.isTTY` forced on. `renderSimLive` is mocked so we exercise
|
|
17
|
+
* the wiring without spinning up a real Ink render host.
|
|
18
|
+
*/
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=tool-live-view.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-live-view.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/tool-live-view.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Tests for simulationTool's live-view wiring (ADR-0016) — the
|
|
3
|
+
* paths the static-render tool.test.ts can't reach:
|
|
4
|
+
*
|
|
5
|
+
* - the interactive TTY branch of the `sim` handler registers a live view
|
|
6
|
+
* under the `sim` key, and that callback renders the live view then
|
|
7
|
+
* delivers the returned envelope to the composition root (cloud +
|
|
8
|
+
* --report-to egress).
|
|
9
|
+
* - the interactive TTY action branch routes to cli.renderLive +
|
|
10
|
+
* maybeOpenReport instead of the static executeSim path.
|
|
11
|
+
*
|
|
12
|
+
* Since release 2.11.0 Phase 3 sim mounts via a `CommandSpec`; the live-view
|
|
13
|
+
* registration moved from the (removed) `register()` mount hook into the
|
|
14
|
+
* handler's interactive branch, where it runs lazily before `cli.renderLive`.
|
|
15
|
+
* We drive the handler directly (the host invokes it post-parse) with
|
|
16
|
+
* `process.stdout.isTTY` forced on. `renderSimLive` is mocked so we exercise
|
|
17
|
+
* the wiring without spinning up a real Ink render host.
|
|
18
|
+
*/
|
|
19
|
+
import { enterScope, RunScope } from '@opensip-cli/core';
|
|
20
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
21
|
+
import { simulationTool } from '../tool.js';
|
|
22
|
+
// Mock the Ink renderer so the live-view callback can run without a real
|
|
23
|
+
// terminal. The mock returns a deterministic envelope.
|
|
24
|
+
const fakeEnvelope = {
|
|
25
|
+
schemaVersion: 2,
|
|
26
|
+
tool: 'sim',
|
|
27
|
+
verdict: { passed: false, summary: { passed: 0, failed: 1, errors: 0, warnings: 0 } },
|
|
28
|
+
};
|
|
29
|
+
// host-owned-run-timing Phase 2: renderSimLive resolves a ToolRunCompletion
|
|
30
|
+
// ({ envelope, session }); the tool reads `.envelope` for egress and the host
|
|
31
|
+
// persists `.session`.
|
|
32
|
+
vi.mock('../cli/sim-runner.js', () => ({
|
|
33
|
+
renderSimLive: vi.fn(() => Promise.resolve({ envelope: fakeEnvelope })),
|
|
34
|
+
}));
|
|
35
|
+
const { renderSimLive } = await import('../cli/sim-runner.js');
|
|
36
|
+
beforeEach(() => {
|
|
37
|
+
const scope = new RunScope();
|
|
38
|
+
Object.assign(scope, simulationTool.contributeScope?.() ?? {});
|
|
39
|
+
enterScope(scope);
|
|
40
|
+
});
|
|
41
|
+
afterEach(() => {
|
|
42
|
+
vi.clearAllMocks();
|
|
43
|
+
});
|
|
44
|
+
/** The single declarative `sim` command sim exports. */
|
|
45
|
+
function simHandler() {
|
|
46
|
+
const spec = simulationTool.commandSpecs?.[0];
|
|
47
|
+
if (spec === undefined)
|
|
48
|
+
throw new Error('simulationTool exposes no commandSpecs');
|
|
49
|
+
return spec.handler;
|
|
50
|
+
}
|
|
51
|
+
function makeCtx() {
|
|
52
|
+
const liveViews = new Map();
|
|
53
|
+
const delivered = [];
|
|
54
|
+
const renderLiveCalls = [];
|
|
55
|
+
const dashboardCalls = [];
|
|
56
|
+
const exitCodes = [];
|
|
57
|
+
const ctx = {
|
|
58
|
+
scope: new RunScope(),
|
|
59
|
+
render: vi.fn(() => Promise.resolve()),
|
|
60
|
+
registerLiveView: vi.fn((key, cb) => {
|
|
61
|
+
liveViews.set(key, cb);
|
|
62
|
+
}),
|
|
63
|
+
renderLive: vi.fn((key, args) => {
|
|
64
|
+
renderLiveCalls.push([key, args]);
|
|
65
|
+
return Promise.resolve();
|
|
66
|
+
}),
|
|
67
|
+
maybeOpenReport: vi.fn((arg) => {
|
|
68
|
+
dashboardCalls.push(arg);
|
|
69
|
+
return Promise.resolve();
|
|
70
|
+
}),
|
|
71
|
+
logger: { debug: vi.fn(), info: vi.fn(), warn: vi.fn(), error: vi.fn() },
|
|
72
|
+
setExitCode: (code) => exitCodes.push(code),
|
|
73
|
+
emitJson: vi.fn(),
|
|
74
|
+
emitRaw: vi.fn(),
|
|
75
|
+
emitEnvelope: vi.fn(),
|
|
76
|
+
emitError: vi.fn(),
|
|
77
|
+
deliverSignals: vi.fn((envelope, opts) => {
|
|
78
|
+
delivered.push({ envelope, opts });
|
|
79
|
+
return Promise.resolve();
|
|
80
|
+
}),
|
|
81
|
+
writeSarif: vi.fn(() => Promise.resolve()),
|
|
82
|
+
};
|
|
83
|
+
return { ctx, liveViews, delivered, renderLiveCalls, dashboardCalls, exitCodes };
|
|
84
|
+
}
|
|
85
|
+
describe('simulationTool live-view callback (ADR-0016)', () => {
|
|
86
|
+
const originalIsTTY = process.stdout.isTTY;
|
|
87
|
+
afterEach(() => {
|
|
88
|
+
process.stdout.isTTY = originalIsTTY;
|
|
89
|
+
});
|
|
90
|
+
it('registers a live view under the `sim` key and delivers the rendered envelope', async () => {
|
|
91
|
+
process.stdout.isTTY = true;
|
|
92
|
+
const cap = makeCtx();
|
|
93
|
+
// The interactive branch registers the live view, so run the handler once
|
|
94
|
+
// to install it, then exercise the registered callback directly.
|
|
95
|
+
await simHandler()({ cwd: '/proj' }, cap.ctx);
|
|
96
|
+
const callback = cap.liveViews.get('sim');
|
|
97
|
+
expect(callback).toBeDefined();
|
|
98
|
+
// Invoke the live-view callback the dispatcher would call.
|
|
99
|
+
await callback?.({ cwd: '/proj', reportTo: 'https://cloud.example', apiKey: 'k' });
|
|
100
|
+
// The Ink renderer ran with setExitCode wired through (once per run via the
|
|
101
|
+
// handler's renderLive, once here via the direct callback invocation).
|
|
102
|
+
expect(renderSimLive).toHaveBeenCalled();
|
|
103
|
+
// The returned envelope was delivered to the composition root with egress
|
|
104
|
+
// options derived from the args. ADR-0035: a normal run does NOT pass
|
|
105
|
+
// `runFailed` — the host derives the findings exit from envelope.verdict.passed.
|
|
106
|
+
expect(cap.delivered.length).toBeGreaterThanOrEqual(1);
|
|
107
|
+
const last = cap.delivered.at(-1);
|
|
108
|
+
expect(last?.envelope).toBe(fakeEnvelope);
|
|
109
|
+
expect(last?.opts).toMatchObject({
|
|
110
|
+
cwd: '/proj',
|
|
111
|
+
reportTo: 'https://cloud.example',
|
|
112
|
+
apiKey: 'k',
|
|
113
|
+
});
|
|
114
|
+
expect(last?.opts).not.toHaveProperty('runFailed');
|
|
115
|
+
});
|
|
116
|
+
it('does not deliver when the renderer returns no envelope', async () => {
|
|
117
|
+
process.stdout.isTTY = true;
|
|
118
|
+
// The handler's own renderLive (the live view) is dispatched through
|
|
119
|
+
// cli.renderLive (mocked to a no-op), so it does not invoke renderSimLive;
|
|
120
|
+
// only the directly-invoked callback below does, returning a completion with
|
|
121
|
+
// no envelope (host-owned-run-timing Phase 2).
|
|
122
|
+
renderSimLive.mockResolvedValueOnce({ envelope: undefined });
|
|
123
|
+
const cap = makeCtx();
|
|
124
|
+
await simHandler()({ cwd: '/proj' }, cap.ctx);
|
|
125
|
+
await cap.liveViews.get('sim')?.({ cwd: '/proj' });
|
|
126
|
+
expect(cap.delivered).toHaveLength(0);
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
describe('simulationTool action — interactive TTY branch', () => {
|
|
130
|
+
const originalIsTTY = process.stdout.isTTY;
|
|
131
|
+
afterEach(() => {
|
|
132
|
+
process.stdout.isTTY = originalIsTTY;
|
|
133
|
+
});
|
|
134
|
+
it('routes to renderLive + maybeOpenReport when stdout is a TTY (non-json)', async () => {
|
|
135
|
+
process.stdout.isTTY = true;
|
|
136
|
+
const cap = makeCtx();
|
|
137
|
+
await simHandler()({ open: true }, cap.ctx);
|
|
138
|
+
// Interactive path: the static executeSim render is bypassed in favour of
|
|
139
|
+
// the live view, then the report auto-open hook fires.
|
|
140
|
+
expect(cap.renderLiveCalls).toHaveLength(1);
|
|
141
|
+
expect(cap.renderLiveCalls[0]?.[0]).toBe('sim');
|
|
142
|
+
expect(cap.dashboardCalls).toHaveLength(1);
|
|
143
|
+
expect(cap.dashboardCalls[0]).toMatchObject({ openRequested: true, jsonOutput: false });
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
//# sourceMappingURL=tool-live-view.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-live-view.test.js","sourceRoot":"","sources":["../../src/__tests__/tool-live-view.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAK5C,yEAAyE;AACzE,uDAAuD;AACvD,MAAM,YAAY,GAAG;IACnB,aAAa,EAAE,CAAC;IAChB,IAAI,EAAE,K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H,QAAQ,CAAC,gDAAgD,EAAE,GAAG,EAAE;IAC9D,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;IAE3C,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,aAAa,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wEAAwE,EAAE,KAAK,IAAI,EAAE;QACtF,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;QAC5B,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;QAEtB,MAAM,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;QAE5C,0EAA0E;QAC1E,uDAAuD;QACvD,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC5C,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAChD,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC3C,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coverage for sim's `--show` session-replay handler (`runSimShowMode`).
|
|
3
|
+
*
|
|
4
|
+
* Unlike `fit`, which exposes a dedicated `session show` command, `sim` wires
|
|
5
|
+
* replay into its run command as a `--show <session>` flag handled inside
|
|
6
|
+
* `tool.ts`. This drives that handler through the real `simSpec().handler`
|
|
7
|
+
* entry point with a fake `ToolCliContext` whose scope carries a datastore.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=tool-show-mode.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-show-mode.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/tool-show-mode.test.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coverage for sim's `--show` session-replay handler (`runSimShowMode`).
|
|
3
|
+
*
|
|
4
|
+
* Unlike `fit`, which exposes a dedicated `session show` command, `sim` wires
|
|
5
|
+
* replay into its run command as a `--show <session>` flag handled inside
|
|
6
|
+
* `tool.ts`. This drives that handler through the real `simSpec().handler`
|
|
7
|
+
* entry point with a fake `ToolCliContext` whose scope carries a datastore.
|
|
8
|
+
*/
|
|
9
|
+
import { enterScope, RunScope } from '@opensip-cli/core';
|
|
10
|
+
import { DataStoreFactory } from '@opensip-cli/datastore';
|
|
11
|
+
import { SessionRepo } from '@opensip-cli/session-store';
|
|
12
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
13
|
+
import { simulationTool } from '../tool.js';
|
|
14
|
+
function simSpec() {
|
|
15
|
+
const spec = simulationTool.commandSpecs?.[0];
|
|
16
|
+
if (spec === undefined)
|
|
17
|
+
throw new Error('simulationTool exposes no commandSpecs');
|
|
18
|
+
return spec;
|
|
19
|
+
}
|
|
20
|
+
function simSession(overrides = {}) {
|
|
21
|
+
return {
|
|
22
|
+
id: 'SIM_1',
|
|
23
|
+
tool: 'sim',
|
|
24
|
+
cwd: '/repo',
|
|
25
|
+
startedAt: '2026-06-08T00:00:00.000Z',
|
|
26
|
+
completedAt: '2026-06-08T00:00:00.000Z',
|
|
27
|
+
score: 100,
|
|
28
|
+
passed: true,
|
|
29
|
+
durationMs: 5,
|
|
30
|
+
payload: {
|
|
31
|
+
summary: { total: 0, passed: 0, failed: 0, errors: 0, warnings: 0 },
|
|
32
|
+
checks: [],
|
|
33
|
+
},
|
|
34
|
+
...overrides,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function makeContext(datastore) {
|
|
38
|
+
const rendered = [];
|
|
39
|
+
const emitted = [];
|
|
40
|
+
const exitCodes = [];
|
|
41
|
+
const scope = new RunScope({ datastore: () => datastore });
|
|
42
|
+
Object.assign(scope, simulationTool.contributeScope?.() ?? {});
|
|
43
|
+
const ctx = {
|
|
44
|
+
scope,
|
|
45
|
+
render: vi.fn((result) => {
|
|
46
|
+
rendered.push(result);
|
|
47
|
+
return Promise.resolve();
|
|
48
|
+
}),
|
|
49
|
+
registerLiveView: vi.fn(),
|
|
50
|
+
renderLive: vi.fn(() => Promise.resolve()),
|
|
51
|
+
maybeOpenReport: vi.fn(() => Promise.resolve()),
|
|
52
|
+
logger: { debug: vi.fn(), info: vi.fn(), warn: vi.fn(), error: vi.fn() },
|
|
53
|
+
setExitCode: (code) => {
|
|
54
|
+
exitCodes.push(code);
|
|
55
|
+
},
|
|
56
|
+
emitJson: (value) => {
|
|
57
|
+
emitted.push(value);
|
|
58
|
+
},
|
|
59
|
+
emitRaw: (value) => {
|
|
60
|
+
emitted.push(value);
|
|
61
|
+
},
|
|
62
|
+
emitEnvelope: (value) => {
|
|
63
|
+
emitted.push(value);
|
|
64
|
+
},
|
|
65
|
+
emitError: (detail) => {
|
|
66
|
+
exitCodes.push(detail.exitCode);
|
|
67
|
+
emitted.push(detail);
|
|
68
|
+
},
|
|
69
|
+
deliverSignals: () => Promise.resolve({ cloudAccepted: 0 }),
|
|
70
|
+
writeSarif: () => Promise.resolve(),
|
|
71
|
+
saveBaseline: () => Promise.resolve(),
|
|
72
|
+
compareBaseline: () => Promise.resolve({ added: [], resolved: [], unchanged: [], degraded: false }),
|
|
73
|
+
exportBaselineSarif: () => Promise.resolve(),
|
|
74
|
+
exportBaselineFingerprints: () => Promise.resolve(),
|
|
75
|
+
toolState: {
|
|
76
|
+
get: () => Promise.resolve(undefined),
|
|
77
|
+
put: () => Promise.resolve(),
|
|
78
|
+
delete: () => Promise.resolve(),
|
|
79
|
+
list: () => Promise.resolve([]),
|
|
80
|
+
},
|
|
81
|
+
runSession: {
|
|
82
|
+
timing: {
|
|
83
|
+
startedAt: new Date().toISOString(),
|
|
84
|
+
startedAtEpochMs: Date.now(),
|
|
85
|
+
elapsedMs: () => 0,
|
|
86
|
+
snapshot: () => ({
|
|
87
|
+
startedAt: new Date().toISOString(),
|
|
88
|
+
completedAt: new Date().toISOString(),
|
|
89
|
+
durationMs: 0,
|
|
90
|
+
}),
|
|
91
|
+
complete: () => ({
|
|
92
|
+
startedAt: new Date().toISOString(),
|
|
93
|
+
completedAt: new Date().toISOString(),
|
|
94
|
+
durationMs: 0,
|
|
95
|
+
}),
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
return { ctx, rendered, emitted, exitCodes };
|
|
100
|
+
}
|
|
101
|
+
let ds;
|
|
102
|
+
beforeEach(() => {
|
|
103
|
+
ds = DataStoreFactory.open({ backend: 'memory' });
|
|
104
|
+
enterScope(new RunScope({ datastore: () => ds }));
|
|
105
|
+
});
|
|
106
|
+
afterEach(() => {
|
|
107
|
+
ds.close();
|
|
108
|
+
});
|
|
109
|
+
describe('sim --show (runSimShowMode)', () => {
|
|
110
|
+
it('replays a stored session by id and renders the result (non-JSON)', async () => {
|
|
111
|
+
new SessionRepo(ds).save(simSession());
|
|
112
|
+
const { ctx, rendered } = makeContext(ds);
|
|
113
|
+
await simSpec().handler({ cwd: '/repo', show: 'SIM_1' }, ctx);
|
|
114
|
+
expect(rendered).toHaveLength(1);
|
|
115
|
+
// Replays render through the tool-agnostic session-replay view, not sim-done.
|
|
116
|
+
expect(rendered[0]).toMatchObject({
|
|
117
|
+
type: 'session-replay',
|
|
118
|
+
session: { id: 'SIM_1', tool: 'sim' },
|
|
119
|
+
envelope: { tool: 'sim' },
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
it('emits a JSON replay wrapper when --json is passed', async () => {
|
|
123
|
+
new SessionRepo(ds).save(simSession());
|
|
124
|
+
const { ctx, emitted } = makeContext(ds);
|
|
125
|
+
await simSpec().handler({ cwd: '/repo', show: 'SIM_1', json: true }, ctx);
|
|
126
|
+
expect(emitted).toHaveLength(1);
|
|
127
|
+
expect(emitted[0]).toMatchObject({
|
|
128
|
+
session: { id: 'SIM_1', tool: 'sim' },
|
|
129
|
+
fidelity: 'projection',
|
|
130
|
+
envelope: { tool: 'sim', runId: 'SIM_1' },
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
it('errors with datastore-unavailable when no datastore is present', async () => {
|
|
134
|
+
const { ctx, emitted, exitCodes } = makeContext(undefined);
|
|
135
|
+
await simSpec().handler({ cwd: '/repo', show: 'latest', json: true }, ctx);
|
|
136
|
+
expect(exitCodes).toContain(2);
|
|
137
|
+
expect(emitted[0]).toEqual({
|
|
138
|
+
message: 'session replay requires a datastore',
|
|
139
|
+
exitCode: 2,
|
|
140
|
+
code: 'datastore-unavailable',
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
it('errors (non-JSON) with a rendered error result when the session is missing', async () => {
|
|
144
|
+
const { ctx, rendered, exitCodes } = makeContext(ds);
|
|
145
|
+
await simSpec().handler({ cwd: '/repo', show: 'MISSING' }, ctx);
|
|
146
|
+
expect(exitCodes).toContain(2);
|
|
147
|
+
expect(rendered[0]).toMatchObject({ type: 'error' });
|
|
148
|
+
});
|
|
149
|
+
it('surfaces a decode-error when the stored payload is corrupt', async () => {
|
|
150
|
+
new SessionRepo(ds).save(simSession({ id: 'SIM_BAD', payload: { not: 'valid' } }));
|
|
151
|
+
const { ctx, emitted } = makeContext(ds);
|
|
152
|
+
await simSpec().handler({ cwd: '/repo', show: 'SIM_BAD', json: true }, ctx);
|
|
153
|
+
expect(emitted[0]).toMatchObject({ code: 'decode-error' });
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
//# sourceMappingURL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AG,CAAC,CAAC;QAE5E,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Smoke tests for simulationTool — the Tool plugin
|
|
3
|
+
* descriptor wired into the CLI dispatcher.
|
|
4
|
+
*
|
|
5
|
+
* Since release 2.11.0 Phase 3 (the reference migration) sim mounts via a
|
|
6
|
+
* declarative `CommandSpec` (`simulationTool.commandSpecs`) rather than the
|
|
7
|
+
* deprecated `register()` hook. The host-owned mount path
|
|
8
|
+
* (`mountCommandSpec` → parse → handler → dispatch) is covered in
|
|
9
|
+
* `cli/src/__tests__/mount-command-spec.test.ts`; this file exercises the
|
|
10
|
+
* descriptor metadata, the declared command surface, and the command
|
|
11
|
+
* handler directly with a fake ToolCliContext (the handler is what the host
|
|
12
|
+
* invokes after parsing).
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=tool.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/tool.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|