Lightlines
By dbt-labs

adding-dbt-unit-test

dbt-labs1k installs

Catch regressions in your dbt SQL models.

What it does

Creates YAML tests that check dbt model logic against mocked inputs and expected results.

When to use it

Use when adding dbt model unit tests or practicing test-driven development.

How to use it

Give it a dbt model in your project; it creates unit test YAML with mocked inputs and expected outputs.

What you provide

  • the model to test
  • An existing project

Good to know

  • cannot be undone: target data warehouse

Latest review

What you need · 2

Uses the dbt CLI to run unit tests, build the model, and run data tests.

Requires a target data warehouse; direct parent models must exist there before unit tests run.


Access · 1

This skill

target data warehouse

Write

Replaces warehouse models with empty versions (irreversible)