Skip to main content
A model’s SQL states what it computes. The test suite is what lets you trust it. Every transform model ships with its proof: a schema.yml-declared column contract, a hand-written assertion in transform/tests/, or both and dbt runs all of them on every build. A test passes when it returns zero rows; dbt test fails the moment a single row violates a contract, so an empty result is the success case, not an absence of output. The suite splits sharply in shape, and that split drives how this group is organised: Generic tests are mechanical: one dbt or dbt_expectations pattern, declared once per column, repeated across hundreds of columns. They’re clubbed into two pages, one explanation each, with a gated table carrying the per-model breakdown. Singular tests are hand-written SQL, each encoding one specific idea a closure, a monotonicity argument, a probability bound so each gets its own explained block rather than being clubbed.
Zero rows means pass. Every test in this suite, generic or singular, is a SELECT that returns the rows which violate a contract. CI doesn’t read a boolean; it reads a row count. A model that can’t produce a single offending row, across every lap of every race in the warehouse, is the thing being proven.

73 models

Staging (16) + Reference (5) + 42 intermediate models across 5 families + Marts (10).

650 tests

590 generic column contracts + 60 hand-written mathematical assertions, every build.

478 structural

not_null, unique, and unique-combination tests guard every model’s grain.

112 range & domain

Bounded shares, honest envelopes, enum integrity, and cross-column monotonicity.

14 identity-closure

Additive identities and shrinkage bounds that close to tolerance on every lap.

44 domain + 2 regression

Physical/statistical invariants, plus baseline-comparison gates on headline statistics. 3 singular tests are placeholders (SELECT 1 WHERE FALSE), wired up once their upstream model lands.

16 Staging

5 Reference

11 Physics

8 Pace Baselines

7 Skill

10 Residual

6 Strategy

10 Marts

The three test states

Not every test enforces something on every build. Each one carries a state, read directly off the dbt tree rather than asserted:
Runs real logic that can fail the build today. The overwhelming majority of both generic and singular tests are in this state.
Real logic is present, but it’s conditioned on an external baseline snapshot that isn’t committed to the repository in a fresh checkout the test detects the snapshot is absent and passes vacuously rather than hard-erroring the build. Both Regression Gate tests are in this state today.
Literally SELECT 1 WHERE FALSE wired up once an upstream model (or its confidence intervals) lands, tagged placeholder so it can’t be mistaken for active coverage. dbt test --exclude tag:placeholder runs only the tests that can currently fail, which is the honest measure of how much of the suite is load-bearing right now.

The five pages

Structural

Grain and completeness: every model’s declared key is present and non-duplicated.

Range & Domain

Physical plausibility, enum integrity, and cross-column monotonicity.

Identity-Closure

The additive identities themselves, closing to tolerance the most important guarantee in the project.

Domain Constraints

Stint resets, leakage guards, shrinkage bounds, and probability sanity on the singular tests that aren’t pure closures.

Regression Gates

Baseline-comparison gates, the sqlfluff lint contract, and the byte-stability oracle.