/starlake-skills:testfrom starlake-skills
Run integration tests with `starlake test` — verify load and transform tasks against expected data files and declared expectations in an isolated DuckDB, for regression testing, CI test reports (junit.xml), and coverage sites
Ships in starlake-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Runs integration tests for your Starlake project. Tests verify that load and transform tasks produce the expected output by comparing actual results against expected data files stored in metadata/tests/, and by evaluating the table's or task's declared expectations.
starlake test [options]
--load: Test load tasks only--transform: Test transform tasks only--domain <value>: Test only this domain--table <value>: Test only this table/task within the selected domain — broken up to 1.6.0, see warning below--test <value>: Run only the test cases with this name--site: Generate test results as a website--outputDir <value>: Output directory for test results--accessToken <value>: Access token for authentication (e.g. GCP)--reportFormat <value>: Report output format: console, json, or htmlWarning (up to Starlake 1.6.0):
--tableis wired to the test-name filter (starlake#1676), so any table-scoped run —--domain X --table Yor--table domain.table— silently executes 0 tests and exits 0, which reads as green in CI. Until the fix ships, scope with--domain(which works) and check the report's test count.--test <name>works, but filters by test-case name across all tables of the selected domain(s).
--accessToken) are needed._expected* files (data comparison)
and the table's/task's declared expectations (see the
expectations skill). A test succeeds only if both
pass.EXCEPT): row order is ignored,
and the column names must match (case-insensitive) — keep the column
order aligned with the target too, since the row comparison itself is
positional. Null values are spelled null in the CSV. On mismatch the
differences are dumped next to the report; beware, the two filenames are
inverted up to 1.6.0
(starlake#1677):
missing<Name>.csv holds the rows produced but not expected, and
not_expected<Name>.csv the rows expected but not produced.SL_ENV is honored. If your connection sets a jinja-driven
_transpileDialect (e.g. transpiling BigQuery SQL for local DuckDB runs),
use a dedicated test env (e.g. env.TEST.sl.yml forcing the DuckDB dialect):
the harness substitutes table refs double-quoted, which the source dialect's
parser may reject — the harness then logs the error and falls back to the
raw, untranspiled SQL instead of failing
(starlake#1669).SL_ENV=TEST starlake test
Tests are organized in metadata/tests/:
metadata/tests/
├── load/
│ └── {domain}/
│ └── {table}/
│ └── {test_name}/
│ ├── _incoming.{file} # Input file to load (optional)
│ └── _expected.csv # Expected output data (optional; .json also supported)
└── transform/
└── {domain}/
└── {task}/
└── {test_name}/
├── _expected.csv # Expected output
└── {domain}.{table}.csv # Mock for each referenced table
metadata/tests/load/starbake/orders/test1/
├── _incoming.orders_20240301.json # Input file to load
└── _expected.csv # Expected loaded data
The _incoming. suffix must match the table's file pattern (it drives pattern
matching and pattern-derived variables such as the file date). _expected.csv
is optional for load tests: the table's declared expectations also run and
can serve as the sole oracle. The _incoming. file itself is optional too:
without it nothing is ingested and the target table is taken as preloaded from
the mock data — useful for expectation-only tests.
Note for rejection tests: type-pattern row rejection only happens with the Spark loader — the native loader does not validate type patterns, so a rejection test passes or fails depending on the configured loader.
metadata/tests/transform/kpi/revenue_summary/test1/
├── _expected.csv # Expected transform output
├── starbake.orders.csv # Mock source: orders table
└── starbake.order_lines.csv # Mock source: order_lines table
Mock every table the test touches, including the ones referenced by the
task's declared expectations: for a MERGE-style task whose expectations check
key integrity against the target table, add a {domain}.{target_table}.csv
mock too, otherwise the expectation query fails on a missing table.
When the output contains non-deterministic columns (e.g. a CURRENT_TIMESTAMP
ingestion column), a full-schema _expected.csv can never match. Use a named
expectation instead: _expected<Name>.csv paired with _expected<Name>.sql
holding the projected column list (or a full SELECT over the output) — only
those columns are compared. The .sql
file is mandatory: a named .csv without its .sql companion is silently
ignored. Expected files can be .csv or .json.
metadata/tests/transform/kpi/revenue_summary/test1/
├── _expectedDeterministic.sql # e.g.: order_id, total_amount, currency
├── _expectedDeterministic.csv # Expected values for those columns only
└── starbake.orders.csv
starlake test
starlake test --load
starlake test --transform
starlake test --domain starbake
starlake test --domain starbake --test test1
(Scoping to a single table with --table silently runs nothing up to 1.6.0 —
see the warning in Options.)
starlake test --site --outputDir /tmp/test-results
junit.xml is written on every run (default report folder
test-reports/); --site additionally produces the browsable index.html.
Caveats: starlake test always exits 0 — even with failing tests — so CI must
gate on junit.xml's tests and failures counts, never on the exit code;
and the site's task-coverage figure under-reports when several tasks target
the same table
(starlake#1670).
What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (starlake-ai/starlake-skills) — no native marketplace selected
npx claudepluginhub p/starlake-ai-starlake-skills75 skills in this plugin
/acl-dependenciesVisualize access control with `starlake acl-dependencies` — graph which users and groups can access which tables, from the ACL and RLS (row-level security) definitions in your YAML, output as SVG, PNG, or JSON/autoloadInfer schemas from files in the incoming directory and load them into the warehouse in one step with `starlake autoload`. Use for quick starts or new data files with no YAML table definitions yet; generates the table configs automatically./bootstrapCreate a new Starlake project with `starlake bootstrap` — scaffold the standard metadata/load/transform directory structure and starter config from a template (quickstart, simple). Use when initializing or setting up a new project.