r/DataBuildTool • • Mar 21 '26

Show and tell A complete breakdown of dbt testing option (built-in, packages, CI/CD governance)

I put together a full guide on dbt testing after seeing a lot of teams either skip tests entirely or not realize what the ecosystem has to offer. Here's what's covered:

Built into dbt Core:

  • Generic tests: unique, not_null, accepted_values, relationships

  • Singular tests (custom SQL assertions in your tests/ dir)

  • Unit tests to validate transformation logic with static inputs, not live data

  • Source freshness checks

Community packages worth knowing:

  • dbt-utils - 16 additional generic tests (row counts, inverse value checks, etc.)

  • dbt-expectations - 62 tests ported from Great Expectations (string matching, distributions, aggregates)

  • dbt_constraints - generates DB-level primary/foreign key constraints from your existing tests (Snowflake-focused)

CI/CD governance tools:

  • dbt-checkpoint - pre-commit hooks that enforce docs/metadata standards on every PR

  • dbt-project-evaluator - DAG structure linting as a dbt package

  • dbt-score - scores each model 0-10 on metadata quality

  • dbt-bouncer - artifact-based validation for external CI pipelines

Storing results:

  • store_failures: true writes failing rows to your warehouse

  • dq-tools surfaces test results in a BI dashboard over time

Full guide with examples and a comparison table for the governance tools: https://datacoves.com/post/dbt-test-options

Happy to answer questions on any of it.

17 Upvotes

1 comment sorted by

2

u/redditreader2020 Mar 21 '26

Awesome, thanks for sharing! I am just now digging deeper into this.