sqb scenario
Run end-to-end scenario tests. Scenarios materialize fixture inputs as physical relations, build the real project graph against them, and evaluate expected outputs and assertions. See Scenarios for concepts and authoring details.sqb scenario test
Run scenario tests against the warehouse.Flags
| Flag | Description |
|---|---|
--select, -s | Select scenarios to run |
--exclude | Exclude scenarios from the selection |
--retain | Keep scenario-owned warehouse artifacts for inspection |
--local | Run locally against DuckDB using captured JSONL snapshots |
--strict | Treat missing/stale local snapshots as errors instead of skips |
--sync-snapshots | Capture missing/stale snapshots before local run (requires --local) |
--refresh | Recapture all selected snapshots before local run (requires --local) |
--force | Bypass snapshot capture safety limits |
--max-snapshot-rows | Override per-relation row limit for capture |
--max-snapshot-total-rows | Override total row limit for capture |
--max-snapshot-bytes | Override per-relation byte limit for capture |
--max-snapshot-total-bytes | Override total byte limit for capture |
--no-sql-validation | Skip compile-time SQL syntax validation |
Selectors
Scenarios are selected with--select. --exclude removes scenarios from the selection. Without any selectors, all discovered scenarios run.
| Selector | Example |
|---|---|
| Scenario name | sqb scenario test --select daily_revenue_minimal |
| Multiple names | sqb scenario test --select daily_revenue_minimal --select daily_revenue_multi_order |
.sql file path | sqb scenario test --select tests/scenarios/revenue/daily_revenue_minimal.sql |
| Folder | sqb scenario test --select tests/scenarios/revenue |
| Scenario-root-relative folder | sqb scenario test --select revenue |
| Exclude | sqb scenario test --select revenue --exclude daily_revenue_multi_order |
Remote examples
Local examples
Output
Remote scenarios report per-scenario PASS/FAIL with nested check rows:--retain for inspection. Local runs always keep the DuckDB file at target/run/scenarios/<scenario_name>/local.duckdb.
sqb scenario capture
Capture scenario input fixtures from the warehouse as JSONL snapshots for local replay.Flags
| Flag | Description |
|---|---|
--select, -s | Select scenarios to capture |
--exclude | Exclude scenarios from the selection |
--retain | Keep warehouse fixture artifacts after capture |
--force | Bypass snapshot capture safety limits |
--max-snapshot-rows | Override per-relation row limit |
--max-snapshot-total-rows | Override total row limit |
--max-snapshot-bytes | Override per-relation byte limit |
--max-snapshot-total-bytes | Override total byte limit |
--no-sql-validation | Skip compile-time SQL syntax validation |
Examples
tests/_scenario_snapshots/<scenario_name>/ with a scenario.json manifest and JSONL files for each fixture relation. These files can be committed to version control.
Runtime artifacts
Both remote and local scenario runs write runtime artifacts totarget/run/scenarios/<scenario_name>/:
local/ subdirectory and create local.duckdb.
