Skip to main content
On this page

Kater CLI Build and check test

kater test snapshot

Copies the warehouse rows that your tests read into DuckDB files on this machine.

Then kater test --local runs those tests with no warehouse credentials. The copy goes in .kater/test-snapshots/<connection>/ in your content root, and it is never committed.

Examples

Terminal window
# See which tables and dates the copy would hold, and read nothing
kater test snapshot --select semantic.ad_reporting --dry-run
# Copy the rows that the ad_reporting tests read
kater test snapshot --select semantic.ad_reporting
# Run the tests on the copy, with no warehouse credentials
kater test --select semantic.ad_reporting --local

Options

OptionDescription
-s, --select <selection>The tests whose tables to copy, as kater test selects them, such as semantic.ad_reporting. See Selecting models. You can give it more than one time.
--exclude <selection>The tests to leave out, in the same words as --select. You can give it more than one time.
--state <state>What state:modified and state:new compare with: a folder that holds an earlier manifest.json, or git:REF, such as git:main.
--dry-runSays which tables it would copy, and by which column and dates, and reads nothing.

It also takes the global options --json, --kater-root, --scope and --help.

What it copies

  • One file for each database that the tests read, named after the database.
  • Only the tests’ dates. A table whose rows reach the model’s date field keeps only the tests’ dates. That is from the earliest test’s start to the latest test’s end. Any other table, such as a currency lookup, is copied whole.
  • Up to 200,000 rows for each table. Kater leaves out a larger table, and the tests that read it run on the warehouse.

Which tests the copy answers

After it copies, Kater runs each test on the copy and compares the result with what the test expects. A test that matches is one that the copy answers. Any other test runs on the warehouse only. A local run never takes the place of a warehouse run, because DuckDB accepts SQL that Snowflake refuses.

See also