@probelabs/visor 0.1.124 → 0.1.126
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/config.d.ts.map +1 -1
- package/dist/docs/DEPLOYMENT.md +117 -11
- package/dist/docs/GITHUB_CHECKS.md +18 -4
- package/dist/docs/NPM_USAGE.md +112 -39
- package/dist/docs/action-reference.md +63 -9
- package/dist/docs/advanced-ai.md +58 -51
- package/dist/docs/ai-configuration.md +99 -11
- package/dist/docs/ai-custom-tools-usage.md +70 -33
- package/dist/docs/ai-custom-tools.md +50 -27
- package/dist/docs/architecture.md +1232 -0
- package/dist/docs/bot-transports-rfc.md +13 -3
- package/dist/docs/ci-cli-mode.md +116 -8
- package/dist/docs/claude-code.md +111 -41
- package/dist/docs/command-provider.md +37 -15
- package/dist/docs/commands.md +252 -6
- package/dist/docs/configuration.md +138 -4
- package/dist/docs/contributing.md +737 -0
- package/dist/docs/custom-tools.md +39 -8
- package/dist/docs/dashboards/README.md +33 -19
- package/dist/docs/debug-visualizer-progress.md +14 -13
- package/dist/docs/debug-visualizer-rfc.md +14 -13
- package/dist/docs/debug-visualizer.md +30 -5
- package/dist/docs/debugging.md +73 -8
- package/dist/docs/default-output-schema.md +24 -20
- package/dist/docs/dependencies.md +75 -21
- package/dist/docs/dev-playbook.md +85 -9
- package/dist/docs/engine-pause-resume-rfc.md +11 -11
- package/dist/docs/engine-state-machine-plan.md +10 -3
- package/dist/docs/event-driven-github-integration-rfc.md +20 -11
- package/dist/docs/event-triggers.md +95 -6
- package/dist/docs/execution-statistics-rfc.md +16 -4
- package/dist/docs/fact-validator-gap-analysis.md +12 -1
- package/dist/docs/fact-validator-implementation-plan.md +19 -11
- package/dist/docs/fail-if.md +116 -11
- package/dist/docs/failure-conditions-implementation.md +40 -6
- package/dist/docs/failure-conditions-schema.md +243 -87
- package/dist/docs/failure-routing-rfc.md +43 -18
- package/dist/docs/failure-routing.md +80 -23
- package/dist/docs/faq.md +836 -0
- package/dist/docs/foreach-dependency-propagation.md +32 -15
- package/dist/docs/github-ops.md +6 -5
- package/dist/docs/glossary.md +322 -0
- package/dist/docs/goto-forward-run-plan.md +23 -10
- package/dist/docs/guides/criticality-modes.md +15 -13
- package/dist/docs/guides/fault-management-and-contracts.md +8 -5
- package/dist/docs/guides/workflow-style-guide.md +17 -8
- package/dist/docs/http.md +102 -3
- package/dist/docs/human-input-provider.md +20 -36
- package/dist/docs/index.md +206 -0
- package/dist/docs/lifecycle-hooks.md +322 -2
- package/dist/docs/limits.md +20 -5
- package/dist/docs/liquid-templates.md +86 -14
- package/dist/docs/loop-routing-refactor.md +4 -2
- package/dist/docs/mcp-provider.md +53 -19
- package/dist/docs/mcp.md +27 -1
- package/dist/docs/memory.md +7 -2
- package/dist/docs/migration.md +596 -0
- package/dist/docs/observability.md +227 -6
- package/dist/docs/output-formats.md +388 -9
- package/dist/docs/output-history.md +36 -6
- package/dist/docs/performance.md +510 -4
- package/dist/docs/pluggable.md +95 -4
- package/dist/docs/proposals/snapshot-scope-execution.md +6 -5
- package/dist/docs/providers/git-checkout.md +16 -14
- package/dist/docs/providers/noop.md +696 -0
- package/dist/docs/recipes.md +8 -9
- package/dist/docs/rfc/git-checkout-step.md +3 -1
- package/dist/docs/rfc/on_init-hook.md +18 -5
- package/dist/docs/rfc/workspace-isolation.md +16 -0
- package/dist/docs/roadmap/criticality-implementation-tasks.md +27 -27
- package/dist/docs/router-patterns.md +155 -43
- package/dist/docs/schema-templates.md +51 -15
- package/dist/docs/script.md +162 -13
- package/dist/docs/sdk.md +46 -12
- package/dist/docs/security.md +464 -5
- package/dist/docs/slack-integration.md +481 -0
- package/dist/docs/tag-filtering.md +60 -20
- package/dist/docs/telemetry-setup.md +157 -46
- package/dist/docs/test-framework-rfc.md +37 -36
- package/dist/docs/testing/assertions.md +92 -4
- package/dist/docs/testing/ci.md +56 -7
- package/dist/docs/testing/cli.md +57 -15
- package/dist/docs/testing/cookbook.md +53 -20
- package/dist/docs/testing/dsl-reference.md +110 -9
- package/dist/docs/testing/fixtures-and-mocks.md +28 -3
- package/dist/docs/testing/flows.md +59 -4
- package/dist/docs/testing/getting-started.md +14 -13
- package/dist/docs/testing/troubleshooting.md +39 -2
- package/dist/docs/timeouts.md +174 -18
- package/dist/docs/troubleshooting.md +176 -6
- package/dist/docs/workflow-creation-guide.md +101 -3
- package/dist/docs/workflows.md +138 -41
- package/dist/examples/README.md +169 -4
- package/dist/examples/ai-custom-tools-simple.yaml +2 -3
- package/dist/examples/cron-webhook-config.yaml +15 -0
- package/dist/examples/forEach-example.yaml +6 -0
- package/dist/examples/git-checkout-basic.yaml +4 -0
- package/dist/examples/git-checkout-compare.yaml +6 -0
- package/dist/examples/git-checkout-cross-repo.yaml +7 -0
- package/dist/examples/http-integration-config.yaml +30 -0
- package/dist/examples/https-server-config.yaml +15 -0
- package/dist/examples/mcp-provider-example.yaml +10 -10
- package/dist/examples/transform-example.yaml +3 -0
- package/dist/examples/webhook-pipeline-config.yaml +18 -0
- package/dist/examples/workflows/workflow-composition-example.yaml +4 -0
- package/dist/frontends/slack-frontend.d.ts +2 -0
- package/dist/frontends/slack-frontend.d.ts.map +1 -1
- package/dist/generated/config-schema.d.ts +11 -7
- package/dist/generated/config-schema.d.ts.map +1 -1
- package/dist/generated/config-schema.json +11 -7
- package/dist/index.js +3127 -974
- package/dist/output/traces/{run-2026-01-28T16-15-24-569Z.ndjson → run-2026-01-31T16-37-22-321Z.ndjson} +84 -84
- package/dist/output/traces/{run-2026-01-28T16-16-09-757Z.ndjson → run-2026-01-31T16-38-06-031Z.ndjson} +1013 -1013
- package/dist/providers/ai-check-provider.d.ts +9 -2
- package/dist/providers/ai-check-provider.d.ts.map +1 -1
- package/dist/providers/command-check-provider.d.ts.map +1 -1
- package/dist/providers/mcp-custom-sse-server.d.ts +17 -1
- package/dist/providers/mcp-custom-sse-server.d.ts.map +1 -1
- package/dist/providers/workflow-check-provider.d.ts.map +1 -1
- package/dist/providers/workflow-tool-executor.d.ts +68 -0
- package/dist/providers/workflow-tool-executor.d.ts.map +1 -0
- package/dist/sdk/{check-provider-registry-AQ3JETBG.mjs → check-provider-registry-3KI5RKXT.mjs} +6 -5
- package/dist/sdk/check-provider-registry-IYILYY35.mjs +28 -0
- package/dist/sdk/chunk-2CPMMNIX.mjs +1459 -0
- package/dist/sdk/chunk-2CPMMNIX.mjs.map +1 -0
- package/dist/sdk/chunk-5LI6T4O3.mjs +3600 -0
- package/dist/sdk/chunk-5LI6T4O3.mjs.map +1 -0
- package/dist/sdk/{chunk-YLQ4UN62.mjs → chunk-A4PGHURG.mjs} +6838 -6257
- package/dist/sdk/chunk-A4PGHURG.mjs.map +1 -0
- package/dist/sdk/chunk-EXFGO4FX.mjs +147 -0
- package/dist/sdk/chunk-EXFGO4FX.mjs.map +1 -0
- package/dist/sdk/chunk-PJ7K5UFC.mjs +17732 -0
- package/dist/sdk/chunk-PJ7K5UFC.mjs.map +1 -0
- package/dist/sdk/{chunk-BHZ4CKUS.mjs → chunk-PXFIALUH.mjs} +77 -8
- package/dist/sdk/chunk-PXFIALUH.mjs.map +1 -0
- package/dist/sdk/{chunk-PVITVJ6J.mjs → chunk-RTKJXNZS.mjs} +32 -9
- package/dist/sdk/chunk-RTKJXNZS.mjs.map +1 -0
- package/dist/sdk/chunk-VW2GBXQT.mjs +606 -0
- package/dist/sdk/chunk-VW2GBXQT.mjs.map +1 -0
- package/dist/sdk/{config-RQQPMLRD.mjs → config-5AUYQFHE.mjs} +2 -2
- package/dist/sdk/config-6CUVEH7H.mjs +16 -0
- package/dist/sdk/config-6CUVEH7H.mjs.map +1 -0
- package/dist/sdk/{github-frontend-6Q4BISZX.mjs → github-frontend-BZ4N3BFZ.mjs} +7 -3
- package/dist/sdk/github-frontend-BZ4N3BFZ.mjs.map +1 -0
- package/dist/sdk/host-4MT3EW2I.mjs +52 -0
- package/dist/sdk/{host-P5NQICP7.mjs → host-NYWXLIFC.mjs} +2 -2
- package/dist/sdk/host-NYWXLIFC.mjs.map +1 -0
- package/dist/sdk/{routing-DEY2AIXM.mjs → routing-6R42GXUO.mjs} +2 -2
- package/dist/sdk/routing-6R42GXUO.mjs.map +1 -0
- package/dist/sdk/routing-7FXPULTO.mjs +24 -0
- package/dist/sdk/routing-7FXPULTO.mjs.map +1 -0
- package/dist/sdk/sdk.d.mts +3 -1
- package/dist/sdk/sdk.d.ts +3 -1
- package/dist/sdk/sdk.js +12163 -11204
- package/dist/sdk/sdk.js.map +1 -1
- package/dist/sdk/sdk.mjs +14 -10
- package/dist/sdk/sdk.mjs.map +1 -1
- package/dist/sdk/slack-frontend-JUT3TYVC.mjs +821 -0
- package/dist/sdk/slack-frontend-JUT3TYVC.mjs.map +1 -0
- package/dist/sdk/workflow-check-provider-H3CUOLUD.mjs +28 -0
- package/dist/sdk/workflow-check-provider-H3CUOLUD.mjs.map +1 -0
- package/dist/sdk/workflow-check-provider-YUNNF4KC.mjs +28 -0
- package/dist/sdk/workflow-check-provider-YUNNF4KC.mjs.map +1 -0
- package/dist/sdk/workflow-registry-KFWSDSLM.mjs +12 -0
- package/dist/sdk/workflow-registry-KFWSDSLM.mjs.map +1 -0
- package/dist/slack/socket-runner.d.ts +2 -0
- package/dist/slack/socket-runner.d.ts.map +1 -1
- package/dist/state-machine/context/workflow-inputs.d.ts +20 -0
- package/dist/state-machine/context/workflow-inputs.d.ts.map +1 -0
- package/dist/state-machine/dispatch/execution-invoker.d.ts.map +1 -1
- package/dist/state-machine/dispatch/foreach-processor.d.ts.map +1 -1
- package/dist/state-machine/dispatch/stats-manager.d.ts.map +1 -1
- package/dist/state-machine/states/level-dispatch.d.ts.map +1 -1
- package/dist/state-machine/states/routing.d.ts +2 -1
- package/dist/state-machine/states/routing.d.ts.map +1 -1
- package/dist/traces/{run-2026-01-28T16-15-24-569Z.ndjson → run-2026-01-31T16-37-22-321Z.ndjson} +84 -84
- package/dist/traces/{run-2026-01-28T16-16-09-757Z.ndjson → run-2026-01-31T16-38-06-031Z.ndjson} +1013 -1013
- package/dist/types/config.d.ts +3 -1
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/human-id.d.ts +12 -0
- package/dist/utils/human-id.d.ts.map +1 -0
- package/dist/utils/worktree-manager.d.ts +3 -0
- package/dist/utils/worktree-manager.d.ts.map +1 -1
- package/dist/workflow-executor.d.ts.map +1 -1
- package/dist/workflow-registry.d.ts +1 -0
- package/dist/workflow-registry.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/sdk/chunk-BHZ4CKUS.mjs.map +0 -1
- package/dist/sdk/chunk-PVITVJ6J.mjs.map +0 -1
- package/dist/sdk/chunk-YLQ4UN62.mjs.map +0 -1
- package/dist/sdk/github-frontend-6Q4BISZX.mjs.map +0 -1
- /package/dist/sdk/{check-provider-registry-AQ3JETBG.mjs.map → check-provider-registry-3KI5RKXT.mjs.map} +0 -0
- /package/dist/sdk/{config-RQQPMLRD.mjs.map → check-provider-registry-IYILYY35.mjs.map} +0 -0
- /package/dist/sdk/{routing-DEY2AIXM.mjs.map → config-5AUYQFHE.mjs.map} +0 -0
- /package/dist/sdk/{host-P5NQICP7.mjs.map → host-4MT3EW2I.mjs.map} +0 -0
|
@@ -4,34 +4,66 @@ This guide shows how to enable Visor telemetry and tracing with OpenTelemetry, e
|
|
|
4
4
|
|
|
5
5
|
## Quick Start (CLI)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
Enable telemetry to serverless NDJSON traces:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
export VISOR_TELEMETRY_ENABLED=true
|
|
11
|
+
export VISOR_TELEMETRY_SINK=file
|
|
12
|
+
export VISOR_TRACE_DIR=output/traces # optional, defaults to output/traces
|
|
13
|
+
|
|
14
|
+
visor --config ./.visor.yaml --output json
|
|
15
|
+
|
|
16
|
+
# Inspect traces
|
|
17
|
+
ls output/traces/*.ndjson
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Environment Variables
|
|
21
|
+
|
|
22
|
+
Telemetry is configured via environment variables (highest precedence):
|
|
23
|
+
|
|
24
|
+
| Variable | Description | Default |
|
|
25
|
+
|----------|-------------|---------|
|
|
26
|
+
| `VISOR_TELEMETRY_ENABLED` | Enable telemetry (`true`/`false`) | `false` |
|
|
27
|
+
| `VISOR_TELEMETRY_SINK` | Sink type: `otlp`, `file`, or `console` | `file` |
|
|
28
|
+
| `VISOR_TRACE_DIR` | Directory for trace files | `output/traces` |
|
|
29
|
+
| `VISOR_TRACE_REPORT` | Generate static HTML trace report (`true`/`false`) | `false` |
|
|
30
|
+
| `VISOR_TELEMETRY_AUTO_INSTRUMENTATIONS` | Enable auto‑instrumentations (`true`/`false`) | `false` |
|
|
31
|
+
| `VISOR_TELEMETRY_FULL_CAPTURE` | Capture full AI prompts/responses in spans | `false` |
|
|
32
|
+
| `VISOR_FALLBACK_TRACE_FILE` | Explicit path for NDJSON trace file | auto-generated |
|
|
33
|
+
| `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP endpoint URL (for both traces and metrics) | - |
|
|
34
|
+
| `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` | OTLP endpoint for traces (overrides above) | - |
|
|
35
|
+
| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | OTLP endpoint for metrics (overrides above) | - |
|
|
36
|
+
| `OTEL_EXPORTER_OTLP_HEADERS` | Headers for OTLP requests (e.g., auth tokens) | - |
|
|
23
37
|
|
|
24
38
|
Examples:
|
|
25
|
-
|
|
26
|
-
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# File sink (serverless mode)
|
|
42
|
+
VISOR_TELEMETRY_ENABLED=true \
|
|
43
|
+
VISOR_TELEMETRY_SINK=file \
|
|
44
|
+
visor --config ./.visor.yaml
|
|
45
|
+
|
|
46
|
+
# OTLP sink with Jaeger
|
|
47
|
+
VISOR_TELEMETRY_ENABLED=true \
|
|
48
|
+
VISOR_TELEMETRY_SINK=otlp \
|
|
49
|
+
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4318/v1/traces \
|
|
50
|
+
visor --config ./.visor.yaml
|
|
51
|
+
|
|
52
|
+
# With static HTML trace report
|
|
53
|
+
VISOR_TELEMETRY_ENABLED=true \
|
|
54
|
+
VISOR_TRACE_REPORT=true \
|
|
55
|
+
visor --config ./.visor.yaml
|
|
56
|
+
```
|
|
27
57
|
|
|
28
58
|
## Config (visor.yaml)
|
|
29
59
|
|
|
60
|
+
Telemetry can also be configured via the `telemetry` section in your config file:
|
|
61
|
+
|
|
30
62
|
```yaml
|
|
31
63
|
version: "1.0"
|
|
32
64
|
telemetry:
|
|
33
65
|
enabled: true
|
|
34
|
-
sink: file # otlp|file|console
|
|
66
|
+
sink: file # otlp | file | console
|
|
35
67
|
otlp:
|
|
36
68
|
protocol: http
|
|
37
69
|
endpoint: ${OTEL_EXPORTER_OTLP_ENDPOINT}
|
|
@@ -45,18 +77,16 @@ telemetry:
|
|
|
45
77
|
enabled: true
|
|
46
78
|
```
|
|
47
79
|
|
|
48
|
-
|
|
49
|
-
- `VISOR_TELEMETRY_ENABLED`, `VISOR_TELEMETRY_SINK`, `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_EXPORTER_OTLP_HEADERS`, `VISOR_TRACE_DIR`
|
|
50
|
-
- `VISOR_TELEMETRY_AUTO_INSTRUMENTATIONS=true`
|
|
51
|
-
- `VISOR_TRACE_REPORT=true`
|
|
80
|
+
> **Note:** Environment variables take precedence over config file settings.
|
|
52
81
|
|
|
53
82
|
## Serverless Mode (NDJSON)
|
|
54
83
|
|
|
55
|
-
|
|
56
|
-
|
|
84
|
+
When using `VISOR_TELEMETRY_SINK=file` (the default), Visor writes NDJSON simplified spans to `output/traces/run-<timestamp>.ndjson`. This is ideal for serverless/CI environments where you can't run a persistent collector.
|
|
85
|
+
|
|
86
|
+
You can then ingest these files using the OTel Collector `filelog` receiver:
|
|
57
87
|
|
|
58
|
-
OTel Collector (example):
|
|
59
88
|
```yaml
|
|
89
|
+
# otel-collector-config.yaml
|
|
60
90
|
receivers:
|
|
61
91
|
filelog:
|
|
62
92
|
include: [ "/work/output/traces/*.ndjson" ]
|
|
@@ -75,45 +105,126 @@ service:
|
|
|
75
105
|
|
|
76
106
|
## Connected Mode (OTLP HTTP)
|
|
77
107
|
|
|
78
|
-
-
|
|
79
|
-
|
|
108
|
+
For real-time trace streaming to a collector:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
export VISOR_TELEMETRY_ENABLED=true
|
|
112
|
+
export VISOR_TELEMETRY_SINK=otlp
|
|
113
|
+
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://collector.example.com/v1/traces
|
|
114
|
+
# Optional: authentication headers
|
|
115
|
+
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer your-token"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
When using OTLP sink, the metrics exporter is automatically enabled if the required dependencies are installed (`@opentelemetry/exporter-metrics-otlp-http`, `@opentelemetry/sdk-metrics`). Metrics include histograms and counters for checks, providers, forEach items, and fail_if triggers.
|
|
80
119
|
|
|
81
120
|
## Auto‑Instrumentations
|
|
82
121
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
122
|
+
Enable with `VISOR_TELEMETRY_AUTO_INSTRUMENTATIONS=true` or in config:
|
|
123
|
+
|
|
124
|
+
```yaml
|
|
125
|
+
telemetry:
|
|
126
|
+
tracing:
|
|
127
|
+
auto_instrumentations: true
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
This activates `@opentelemetry/auto-instrumentations-node` (http/undici/child_process/etc.) and correlates external calls with Visor spans via context propagation.
|
|
131
|
+
|
|
132
|
+
> **Note:** Auto-instrumentations require `@opentelemetry/auto-instrumentations-node` as an optional dependency. If not installed, Visor skips auto‑instrumentation gracefully.
|
|
86
133
|
|
|
87
134
|
## Static Trace Report
|
|
88
135
|
|
|
89
|
-
|
|
90
|
-
- Outputs two files per run:
|
|
91
|
-
- `*.trace.json` — simplified span JSON
|
|
92
|
-
- `*.report.html` — self‑contained HTML timeline (open locally)
|
|
136
|
+
Enable with `VISOR_TRACE_REPORT=true` or in config:
|
|
93
137
|
|
|
94
|
-
|
|
138
|
+
```yaml
|
|
139
|
+
telemetry:
|
|
140
|
+
tracing:
|
|
141
|
+
trace_report:
|
|
142
|
+
enabled: true
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
This outputs two files per run to your trace directory:
|
|
146
|
+
- `*.trace.json` — simplified span JSON
|
|
147
|
+
- `*.report.html` — self‑contained HTML timeline (open locally in your browser)
|
|
148
|
+
|
|
149
|
+
## Span Attributes and Events
|
|
95
150
|
|
|
96
|
-
|
|
97
|
-
|
|
151
|
+
Visor emits spans with detailed attributes for debugging:
|
|
152
|
+
|
|
153
|
+
### Check Spans (`visor.check.<checkId>`)
|
|
154
|
+
- `visor.check.id` — Check identifier
|
|
155
|
+
- `visor.check.type` — Provider type (ai, command, etc.)
|
|
156
|
+
- `visor.check.input.context` — Liquid template context (sanitized)
|
|
157
|
+
- `visor.check.output` — Check result (truncated if large)
|
|
158
|
+
- `visor.foreach.index` — Index for forEach iterations
|
|
159
|
+
|
|
160
|
+
### State Spans (`engine.state.*`)
|
|
161
|
+
- `wave` — Current execution wave number
|
|
162
|
+
- `wave_kind` — Wave type
|
|
163
|
+
- `session_id` — Session identifier
|
|
164
|
+
- `level_size` — Number of checks in wave
|
|
165
|
+
- `level_checks_preview` — Preview of checks in wave
|
|
166
|
+
|
|
167
|
+
### Routing Events (`visor.routing`)
|
|
168
|
+
- `trigger` — What triggered the routing decision
|
|
169
|
+
- `action` — Routing action (retry, goto, run)
|
|
170
|
+
- `source` — Source check
|
|
171
|
+
- `target` — Target check(s)
|
|
172
|
+
- `scope` — Execution scope
|
|
173
|
+
- `goto_event` — Event override for goto
|
|
98
174
|
|
|
99
175
|
## Security & Redaction
|
|
100
176
|
|
|
101
|
-
|
|
177
|
+
By default, sensitive environment variables (containing `api_key`, `secret`, `token`, `password`, `auth`, `credential`, `private_key`) are automatically redacted in span attributes.
|
|
178
|
+
|
|
179
|
+
To capture full AI prompts and responses (for debugging), set:
|
|
180
|
+
```bash
|
|
181
|
+
export VISOR_TELEMETRY_FULL_CAPTURE=true
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
> **Warning:** Full capture may include sensitive data. Use only in secure debugging environments.
|
|
102
185
|
|
|
103
186
|
## GitHub Actions
|
|
104
187
|
|
|
105
|
-
|
|
106
|
-
|
|
188
|
+
Visor wraps each execution in a root span (`visor.run`). You can correlate traces with GitHub workflow runs by publishing the `trace_id` in logs or checks.
|
|
189
|
+
|
|
190
|
+
Example workflow step:
|
|
191
|
+
|
|
107
192
|
```yaml
|
|
108
|
-
- name: Visor
|
|
193
|
+
- name: Run Visor with tracing
|
|
109
194
|
run: |
|
|
110
195
|
export VISOR_TELEMETRY_ENABLED=true
|
|
111
196
|
export VISOR_TELEMETRY_SINK=otlp
|
|
112
|
-
export
|
|
197
|
+
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=${{ secrets.OTEL_ENDPOINT }}
|
|
113
198
|
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer ${{ secrets.OTEL_TOKEN }}"
|
|
114
199
|
npx -y @probelabs/visor@latest --config ./.visor.yaml --output json
|
|
115
200
|
```
|
|
116
201
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
202
|
+
For file-based tracing in CI (useful for artifact upload):
|
|
203
|
+
|
|
204
|
+
```yaml
|
|
205
|
+
- name: Run Visor with file traces
|
|
206
|
+
run: |
|
|
207
|
+
export VISOR_TELEMETRY_ENABLED=true
|
|
208
|
+
export VISOR_TELEMETRY_SINK=file
|
|
209
|
+
export VISOR_TRACE_DIR=./traces
|
|
210
|
+
npx -y @probelabs/visor@latest --config ./.visor.yaml
|
|
211
|
+
|
|
212
|
+
- name: Upload traces
|
|
213
|
+
uses: actions/upload-artifact@v4
|
|
214
|
+
with:
|
|
215
|
+
name: visor-traces
|
|
216
|
+
path: ./traces/*.ndjson
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Troubleshooting
|
|
220
|
+
|
|
221
|
+
- **No spans?** Verify `VISOR_TELEMETRY_ENABLED=true` and check that OpenTelemetry packages are installed.
|
|
222
|
+
- **Missing metrics?** Install `@opentelemetry/exporter-metrics-otlp-http` and `@opentelemetry/sdk-metrics`.
|
|
223
|
+
- **Auto-instrumentations not working?** Install `@opentelemetry/auto-instrumentations-node`.
|
|
224
|
+
- **Large span attributes?** Visor truncates attributes at 10,000 characters. For full capture, use `VISOR_TELEMETRY_FULL_CAPTURE=true`.
|
|
225
|
+
|
|
226
|
+
## Related Documentation
|
|
227
|
+
|
|
228
|
+
- [Debugging Guide](./debugging.md) — Comprehensive debugging techniques
|
|
229
|
+
- [Debug Visualizer](./debug-visualizer.md) — Live execution visualization with `--debug-server`
|
|
230
|
+
- [Telemetry RFC](./telemetry-tracing-rfc.md) — Design rationale and architecture
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# Visor Integration Test Framework (RFC)
|
|
2
2
|
|
|
3
|
-
Status:
|
|
3
|
+
Status: Implemented
|
|
4
4
|
Date: 2025-10-27
|
|
5
|
+
Last Updated: 2026-01-28
|
|
5
6
|
Owners: @probelabs/visor
|
|
6
7
|
|
|
7
8
|
## Summary
|
|
@@ -17,15 +18,15 @@ Key ideas:
|
|
|
17
18
|
(Docs use a “fact validation” workflow as an example pattern only; it is not a built‑in feature.)
|
|
18
19
|
|
|
19
20
|
Developer Guides
|
|
20
|
-
- Getting started:
|
|
21
|
-
- DSL reference:
|
|
22
|
-
- Flows:
|
|
23
|
-
- Fixtures & mocks:
|
|
24
|
-
- Assertions:
|
|
25
|
-
- Cookbook:
|
|
26
|
-
- CLI & reporters:
|
|
27
|
-
- CI integration:
|
|
28
|
-
- Troubleshooting:
|
|
21
|
+
- Getting started: [testing/getting-started.md](testing/getting-started.md)
|
|
22
|
+
- DSL reference: [testing/dsl-reference.md](testing/dsl-reference.md)
|
|
23
|
+
- Flows: [testing/flows.md](testing/flows.md)
|
|
24
|
+
- Fixtures & mocks: [testing/fixtures-and-mocks.md](testing/fixtures-and-mocks.md)
|
|
25
|
+
- Assertions: [testing/assertions.md](testing/assertions.md)
|
|
26
|
+
- Cookbook: [testing/cookbook.md](testing/cookbook.md)
|
|
27
|
+
- CLI & reporters: [testing/cli.md](testing/cli.md)
|
|
28
|
+
- CI integration: [testing/ci.md](testing/ci.md)
|
|
29
|
+
- Troubleshooting: [testing/troubleshooting.md](testing/troubleshooting.md)
|
|
29
30
|
|
|
30
31
|
## Progress Update (Oct 29, 2025)
|
|
31
32
|
|
|
@@ -64,7 +65,7 @@ Next steps (milestones excerpt)
|
|
|
64
65
|
## File Layout
|
|
65
66
|
|
|
66
67
|
- Base config (unchanged): `defaults/.visor.yaml` (regular steps live here).
|
|
67
|
-
- Test suite (new): `defaults
|
|
68
|
+
- Test suite (new): `defaults/visor.tests.yaml`
|
|
68
69
|
- `extends: ".visor.yaml"` to inherit the base checks.
|
|
69
70
|
- Contains `tests.defaults`, `tests.fixtures`, `tests.cases`.
|
|
70
71
|
|
|
@@ -226,16 +227,16 @@ tests:
|
|
|
226
227
|
## CLI Usage
|
|
227
228
|
|
|
228
229
|
- Discover tests:
|
|
229
|
-
- `node dist/index.js test --config defaults
|
|
230
|
+
- `node dist/index.js test --config defaults/visor.tests.yaml --list`
|
|
230
231
|
- Validate test file shape (schema):
|
|
231
|
-
- `node dist/index.js test --config defaults
|
|
232
|
+
- `node dist/index.js test --config defaults/visor.tests.yaml --validate`
|
|
232
233
|
- Run all tests with compact progress (default):
|
|
233
|
-
- `node dist/index.js test --config defaults
|
|
234
|
+
- `node dist/index.js test --config defaults/visor.tests.yaml`
|
|
234
235
|
- Run a single case:
|
|
235
|
-
- `node dist/index.js test --config defaults
|
|
236
|
+
- `node dist/index.js test --config defaults/visor.tests.yaml --only label-flow`
|
|
236
237
|
- Run a single stage in a flow (by name or 1‑based index):
|
|
237
|
-
- `node dist/index.js test --config defaults
|
|
238
|
-
- `node dist/index.js test --config defaults
|
|
238
|
+
- `node dist/index.js test --config defaults/visor.tests.yaml --only pr-review-e2e-flow#facts-invalid`
|
|
239
|
+
- `node dist/index.js test --config defaults/visor.tests.yaml --only pr-review-e2e-flow#3`
|
|
239
240
|
- Emit artifacts:
|
|
240
241
|
- JSON: `--json output/visor-tests.json`
|
|
241
242
|
- JUnit: `--report junit:output/visor-tests.xml`
|
|
@@ -433,9 +434,9 @@ expect:
|
|
|
433
434
|
## CLI
|
|
434
435
|
|
|
435
436
|
```
|
|
436
|
-
visor test --config defaults
|
|
437
|
-
visor test --config defaults
|
|
438
|
-
visor test --config defaults
|
|
437
|
+
visor test --config defaults/visor.tests.yaml # run all cases
|
|
438
|
+
visor test --config defaults/visor.tests.yaml --only pr-review-e2e-flow
|
|
439
|
+
visor test --config defaults/visor.tests.yaml --list # list case names
|
|
439
440
|
```
|
|
440
441
|
|
|
441
442
|
Exit codes:
|
|
@@ -459,7 +460,7 @@ The runner prints a concise, human‑friendly summary optimized for scanning:
|
|
|
459
460
|
- First mismatch shows an inline diff (expected vs actual substring/regex or value), with a clear hint to fix.
|
|
460
461
|
- Flow cases show each stage nested under the parent with roll‑up status.
|
|
461
462
|
- Summary footer with pass/fail counts, slowest cases, and a hint to rerun focused:
|
|
462
|
-
- e.g., visor test --config defaults
|
|
463
|
+
- e.g., visor test --config defaults/visor.tests.yaml --only security-fail-if
|
|
463
464
|
|
|
464
465
|
Color, symbols, and truncation rules mirror our main CLI:
|
|
465
466
|
- Green checks for passes, red crosses for failures, yellow for skipped.
|
|
@@ -496,7 +497,7 @@ Progress Tracker
|
|
|
496
497
|
- Milestone 7 — CLI reporters/UX polish — DONE (2025-10-27)
|
|
497
498
|
- Milestone 8 — Validation and helpful errors — DONE (2025-10-27)
|
|
498
499
|
- Milestone 9 — Coverage and perf — DONE (2025-10-27)
|
|
499
|
-
- Milestone 10 — Docs, examples, migration —
|
|
500
|
+
- Milestone 10 — Docs, examples, migration — DONE (2026-01-28)
|
|
500
501
|
|
|
501
502
|
Progress Update — 2025-10-29
|
|
502
503
|
- FlowStage refactor: each stage now recomputes prompts/output‑history deltas and execution statistics after any fallback run that executes “missing” expected steps. Coverage tables reflect the final state of the stage.
|
|
@@ -513,7 +514,7 @@ Progress Update — 2025-10-28
|
|
|
513
514
|
|
|
514
515
|
Milestone 0 — DSL freeze and scaffolding (0.5 week) — DONE 2025-10-27
|
|
515
516
|
- Finalize DSL keys: tests.defaults, fixtures, cases, flow, fixture, mocks, expect.{calls,prompts,outputs,fail,strict_violation}. ✅
|
|
516
|
-
- Rename use_fixture → fixture across examples (done in this RFC and defaults
|
|
517
|
+
- Rename use_fixture → fixture across examples (done in this RFC and defaults/visor.tests.yaml). ✅
|
|
517
518
|
- Create module skeletons: ✅
|
|
518
519
|
- src/test-runner/index.ts (entry + orchestration)
|
|
519
520
|
- src/test-runner/fixture-loader.ts (builtin + overrides)
|
|
@@ -526,7 +527,7 @@ Milestone 0 — DSL freeze and scaffolding (0.5 week) — DONE 2025-10-27
|
|
|
526
527
|
Progress Notes
|
|
527
528
|
- Discovery works against any .visor.tests.yaml (general-purpose, not tied to defaults).
|
|
528
529
|
- Recording Octokit records arbitrary rest ops without hardcoding method lists.
|
|
529
|
-
- defaults
|
|
530
|
+
- defaults/visor.tests.yaml updated to consistent count grammar and fixed indentation issues.
|
|
530
531
|
|
|
531
532
|
Milestone 1 — MVP runner and single‑event cases (1 week) — DONE 2025-10-27 (non‑flow)
|
|
532
533
|
- CLI: add visor test [--config path] [--only name] [--bail] [--list]. ✅
|
|
@@ -543,12 +544,12 @@ Notes
|
|
|
543
544
|
|
|
544
545
|
Verification
|
|
545
546
|
- Build CLI + SDK: npm run build — success.
|
|
546
|
-
- Discovery: visor test --config defaults
|
|
547
|
+
- Discovery: visor test --config defaults/visor.tests.yaml --list — lists suite and cases.
|
|
547
548
|
- Run single cases:
|
|
548
|
-
- visor test --config defaults
|
|
549
|
-
- visor test --config defaults
|
|
550
|
-
- visor test --config defaults
|
|
551
|
-
- visor test --config defaults
|
|
549
|
+
- visor test --config defaults/visor.tests.yaml --only label-flow — PASS
|
|
550
|
+
- visor test --config defaults/visor.tests.yaml --only issue-triage — PASS
|
|
551
|
+
- visor test --config defaults/visor.tests.yaml --only security-fail-if — PASS
|
|
552
|
+
- visor test --config defaults/visor.tests.yaml --only strict-mode-example — PASS
|
|
552
553
|
- Behavior observed:
|
|
553
554
|
- Strict mode enforced (steps executed but not asserted would fail).
|
|
554
555
|
- GitHub ops recorded by default with dynamic recorder, no network calls.
|
|
@@ -606,7 +607,7 @@ Milestone 8 — Validation and helpful errors (0.5 week) — DONE 2025-10-27
|
|
|
606
607
|
Usage:
|
|
607
608
|
|
|
608
609
|
```
|
|
609
|
-
visor test --validate --config defaults
|
|
610
|
+
visor test --validate --config defaults/visor.tests.yaml
|
|
610
611
|
```
|
|
611
612
|
|
|
612
613
|
Example error output:
|
|
@@ -626,12 +627,12 @@ Milestone 9 — Coverage and perf (0.5 week) — DONE 2025-10-27
|
|
|
626
627
|
Usage examples:
|
|
627
628
|
|
|
628
629
|
```
|
|
629
|
-
visor test --config defaults
|
|
630
|
-
visor test --config defaults
|
|
630
|
+
visor test --config defaults/visor.tests.yaml --max-parallel 4
|
|
631
|
+
visor test --config defaults/visor.tests.yaml --prompt-max-chars 16000
|
|
631
632
|
```
|
|
632
633
|
|
|
633
|
-
Milestone 10 — Docs, examples, and migration (0.5 week) —
|
|
634
|
-
- Update README to link the RFC and defaults
|
|
634
|
+
Milestone 10 — Docs, examples, and migration (0.5 week) — DONE 2026-01-28
|
|
635
|
+
- Update README to link the RFC and defaults/visor.tests.yaml.
|
|
635
636
|
- Document built-in fixtures catalog and examples.
|
|
636
637
|
- Migration note: how to move from embedded tests and from `returns` to new mocks.
|
|
637
638
|
- Document `depends_on` ANY‑OF (pipe) groups with examples (done).
|
|
@@ -650,7 +651,7 @@ Success Metrics
|
|
|
650
651
|
|
|
651
652
|
## Compatibility & Migration
|
|
652
653
|
|
|
653
|
-
- Tests moved from `defaults/.visor.yaml` into `defaults
|
|
654
|
+
- Tests moved from `defaults/.visor.yaml` into `defaults/visor.tests.yaml` with `extends: ".visor.yaml"`.
|
|
654
655
|
- Old `mocks.*.returns` is replaced by direct values (object/array/string).
|
|
655
656
|
- You no longer need `run: steps` in tests; cases are integration‑driven by `event + fixture`.
|
|
656
657
|
- `no_other_calls` is unnecessary with strict mode; it’s implied and enforced.
|
|
@@ -671,7 +672,7 @@ Success Metrics
|
|
|
671
672
|
|
|
672
673
|
## Appendix: Example Suite
|
|
673
674
|
|
|
674
|
-
See `defaults
|
|
675
|
+
See `defaults/visor.tests.yaml` in the repo for a complete, multi‑event example covering:
|
|
675
676
|
- PR opened → overview + labels
|
|
676
677
|
- Standard PR comment → no action
|
|
677
678
|
- `/visor` comment → reply
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
# Writing Assertions
|
|
2
2
|
|
|
3
|
-
Assertions live under `expect:` and cover
|
|
3
|
+
Assertions live under `expect:` and cover several surfaces:
|
|
4
4
|
|
|
5
|
-
- `calls`: step counts and provider effects (GitHub ops)
|
|
5
|
+
- `calls`: step counts and provider effects (GitHub/Slack ops)
|
|
6
6
|
- `prompts`: final AI prompts (post templating/context)
|
|
7
7
|
- `outputs`: step outputs with history and selectors
|
|
8
|
+
- `workflow_output`: workflow-level outputs (for workflow testing)
|
|
9
|
+
- `no_calls`: assert that specific steps or provider ops were NOT called
|
|
10
|
+
- `fail`: assert that the case failed with a specific message
|
|
11
|
+
- `strict_violation`: assert strict mode failure for a missing expect on a step
|
|
12
|
+
- `use`: reference reusable macros defined in `tests.defaults.macros`
|
|
8
13
|
|
|
9
14
|
## Calls
|
|
10
15
|
|
|
@@ -18,10 +23,22 @@ expect:
|
|
|
18
23
|
at_least: 1
|
|
19
24
|
args:
|
|
20
25
|
contains: [feature, "review/effort:2"]
|
|
26
|
+
- provider: slack
|
|
27
|
+
op: chat.postMessage
|
|
28
|
+
at_least: 1
|
|
29
|
+
args:
|
|
30
|
+
contains: ["Review complete"]
|
|
21
31
|
```
|
|
22
32
|
|
|
23
33
|
Counts are consistent everywhere: `exactly`, `at_least`, `at_most`.
|
|
24
34
|
|
|
35
|
+
Supported providers:
|
|
36
|
+
- `github`: GitHub API operations (e.g., `labels.add`, `issues.createComment`, `pulls.createReview`, `checks.create`)
|
|
37
|
+
- `slack`: Slack API operations (e.g., `chat.postMessage`)
|
|
38
|
+
|
|
39
|
+
The `args` field supports:
|
|
40
|
+
- `contains`: array of values that must be present (for labels) or substrings (for Slack text)
|
|
41
|
+
|
|
25
42
|
## Prompts
|
|
26
43
|
|
|
27
44
|
```yaml
|
|
@@ -44,7 +61,7 @@ expect:
|
|
|
44
61
|
- `index`: `first` | `last` | N (default: last)
|
|
45
62
|
- `where`: selector to choose a prompt from history using `contains`/`not_contains`/`matches` before applying the assertion
|
|
46
63
|
|
|
47
|
-
Tip:
|
|
64
|
+
Tip: Enable `--prompt-max-chars` CLI flag or `tests.defaults.prompt_max_chars` config setting to cap stored prompt size for large diffs.
|
|
48
65
|
|
|
49
66
|
## Outputs
|
|
50
67
|
|
|
@@ -72,7 +89,31 @@ Supported comparators:
|
|
|
72
89
|
- `matches` (regex)
|
|
73
90
|
- `contains_unordered` (array membership ignoring order)
|
|
74
91
|
|
|
75
|
-
##
|
|
92
|
+
## Workflow Outputs
|
|
93
|
+
|
|
94
|
+
For workflow testing, use `workflow_output` to assert on workflow-level outputs (defined in the workflow's `outputs:` section):
|
|
95
|
+
|
|
96
|
+
```yaml
|
|
97
|
+
expect:
|
|
98
|
+
workflow_output:
|
|
99
|
+
- path: summary
|
|
100
|
+
contains: "Review completed"
|
|
101
|
+
- path: issues_found
|
|
102
|
+
equals: 3
|
|
103
|
+
- path: categories
|
|
104
|
+
contains_unordered: ["security", "performance"]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Supported comparators for workflow outputs:
|
|
108
|
+
- `equals` (primitive)
|
|
109
|
+
- `equalsDeep` (structural)
|
|
110
|
+
- `matches` (regex)
|
|
111
|
+
- `contains` (substring check, can be string or array)
|
|
112
|
+
- `not_contains` (forbidden substrings)
|
|
113
|
+
- `contains_unordered` (array membership ignoring order)
|
|
114
|
+
- `where` (selector with `path` + `equals`/`matches`)
|
|
115
|
+
|
|
116
|
+
## Strict mode and "no calls"
|
|
76
117
|
|
|
77
118
|
Strict mode (default) fails any executed step without a corresponding `expect.calls` entry. You can also assert absence explicitly:
|
|
78
119
|
|
|
@@ -81,5 +122,52 @@ expect:
|
|
|
81
122
|
no_calls:
|
|
82
123
|
- provider: github
|
|
83
124
|
op: issues.createComment
|
|
125
|
+
- provider: slack
|
|
126
|
+
op: chat.postMessage
|
|
84
127
|
- step: extract-facts
|
|
85
128
|
```
|
|
129
|
+
|
|
130
|
+
## Failure Assertions
|
|
131
|
+
|
|
132
|
+
Assert that a test case fails with a specific error message:
|
|
133
|
+
|
|
134
|
+
```yaml
|
|
135
|
+
expect:
|
|
136
|
+
fail:
|
|
137
|
+
message_contains: "validation failed"
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Assert that strict mode caught an unexpected step execution:
|
|
141
|
+
|
|
142
|
+
```yaml
|
|
143
|
+
expect:
|
|
144
|
+
strict_violation:
|
|
145
|
+
for_step: unexpected-step
|
|
146
|
+
message_contains: "Step executed without expect"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Reusable Macros
|
|
150
|
+
|
|
151
|
+
Define reusable assertion blocks in `tests.defaults.macros` and reference them with `use`:
|
|
152
|
+
|
|
153
|
+
```yaml
|
|
154
|
+
tests:
|
|
155
|
+
defaults:
|
|
156
|
+
macros:
|
|
157
|
+
basic-github-check:
|
|
158
|
+
calls:
|
|
159
|
+
- provider: github
|
|
160
|
+
op: checks.create
|
|
161
|
+
at_least: 1
|
|
162
|
+
|
|
163
|
+
cases:
|
|
164
|
+
- name: my-test
|
|
165
|
+
event: pr_opened
|
|
166
|
+
expect:
|
|
167
|
+
use: [basic-github-check]
|
|
168
|
+
calls:
|
|
169
|
+
- step: overview
|
|
170
|
+
exactly: 1
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Macros are merged with inline expectations, allowing you to compose reusable assertion patterns.
|
package/dist/docs/testing/ci.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# CI Integration for Tests
|
|
2
2
|
|
|
3
|
-
Run your in
|
|
3
|
+
Run your in-YAML integration tests in CI using the Visor CLI. Below is a GitHub Actions example. Adapt for other CIs similarly.
|
|
4
|
+
|
|
5
|
+
## Basic GitHub Actions Example
|
|
4
6
|
|
|
5
7
|
```yaml
|
|
6
8
|
name: Visor Tests
|
|
@@ -14,13 +16,13 @@ jobs:
|
|
|
14
16
|
- uses: actions/setup-node@v4
|
|
15
17
|
with: { node-version: '20' }
|
|
16
18
|
- run: npm ci
|
|
17
|
-
- run: npm run build
|
|
19
|
+
- run: npm run build
|
|
18
20
|
|
|
19
|
-
- name: Run integration tests
|
|
21
|
+
- name: Run integration tests
|
|
20
22
|
run: |
|
|
21
23
|
mkdir -p output
|
|
22
|
-
|
|
23
|
-
--config defaults
|
|
24
|
+
npx visor test \
|
|
25
|
+
--config defaults/visor.tests.yaml \
|
|
24
26
|
--json output/visor-tests.json \
|
|
25
27
|
--report junit:output/visor-tests.xml \
|
|
26
28
|
--summary md:output/visor-tests.md
|
|
@@ -36,9 +38,56 @@ jobs:
|
|
|
36
38
|
output/visor-tests.md
|
|
37
39
|
```
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
## Multi-Suite Discovery
|
|
42
|
+
|
|
43
|
+
When you have multiple test files, Visor can discover and run them all:
|
|
44
|
+
|
|
45
|
+
```yaml
|
|
46
|
+
- name: Run all test suites
|
|
47
|
+
run: |
|
|
48
|
+
mkdir -p output
|
|
49
|
+
npx visor test tests/ \
|
|
50
|
+
--max-suites 4 \
|
|
51
|
+
--max-parallel 2 \
|
|
52
|
+
--json output/visor-tests.json \
|
|
53
|
+
--report junit:output/visor-tests.xml
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The test runner automatically discovers:
|
|
57
|
+
- Files ending with `.tests.yaml` or `.tests.yml`
|
|
58
|
+
- YAML files containing a top-level `tests:` key with a `cases` array
|
|
59
|
+
|
|
60
|
+
## Validation-Only Step
|
|
61
|
+
|
|
62
|
+
Add a fast validation step before running tests to catch YAML syntax errors early:
|
|
63
|
+
|
|
64
|
+
```yaml
|
|
65
|
+
- name: Validate test files
|
|
66
|
+
run: npx visor test --validate --config defaults/visor.tests.yaml
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Environment Variables
|
|
70
|
+
|
|
71
|
+
| Variable | Default | Description |
|
|
72
|
+
|----------|---------|-------------|
|
|
73
|
+
| `VISOR_DEBUG` | `false` | Enable debug logging |
|
|
74
|
+
| `VISOR_TEST_PROMPT_MAX_CHARS` | `4000` (CI) / `8000` | Truncate captured prompts |
|
|
75
|
+
| `VISOR_TEST_HISTORY_LIMIT` | `200` (CI) / `500` | Limit output history entries |
|
|
76
|
+
| `CI` | - | Automatically detected; adjusts defaults |
|
|
77
|
+
|
|
78
|
+
## Tips
|
|
79
|
+
|
|
40
80
|
- Keep `ai_provider: mock` in `tests.defaults` for fast, deterministic runs.
|
|
41
|
-
- Set `--max-parallel` to speed up
|
|
81
|
+
- Set `--max-parallel` to speed up case execution within a suite.
|
|
82
|
+
- Set `--max-suites` to run multiple test files in parallel.
|
|
42
83
|
- Use `--bail` for faster feedback on PRs; run full suite on main.
|
|
43
84
|
- Collect artifacts so you can inspect failures without re-running.
|
|
85
|
+
- Use `--validate` in a separate step for faster feedback on syntax errors.
|
|
86
|
+
|
|
87
|
+
## See Also
|
|
88
|
+
|
|
89
|
+
- [CLI Reference](cli.md) - Full list of test command flags
|
|
90
|
+
- [Getting Started](getting-started.md) - Writing your first tests
|
|
91
|
+
- [Fixtures and Mocks](fixtures-and-mocks.md) - Mock AI providers for CI
|
|
92
|
+
- [Troubleshooting](troubleshooting.md) - Common CI issues
|
|
44
93
|
|