| name | dbt-test |
| description | Add schema tests, unit tests, and data quality checks to dbt models. Use when validating data integrity, adding test definitions to schema.yml, writing unit tests, or practicing test-driven development in dbt. Powered by altimate-dbt. |
dbt Testing
Requirements
Agent: builder or migrator (requires file write access)
Tools used: bash (runs altimate-dbt commands), read, glob, write, edit, altimate_core_testgen, altimate_core_validate
When to Use This Skill
Use when the user wants to:
- Add tests to a model's schema.yml (unique, not_null, relationships, accepted_values)
- Write dbt unit tests (mock inputs → expected outputs)
- Create custom generic or singular tests
- Debug why a test is failing
- Practice test-driven development in dbt
Do NOT use for:
- Creating or modifying model SQL → use
dbt-develop
- Writing model descriptions → use
dbt-docs
- Debugging build/compilation errors → use
dbt-troubleshoot
The Iron Rule
Never modify a test to make it pass without understanding why it's failing.
A failing test is information. It means either:
- The data has a real quality issue (fix the data or the model)
- The test expectation is wrong (update the test with justification)
- The model logic is wrong (fix the model)
Option 2 requires explicit user confirmation. Do not silently weaken tests.
Schema Test Workflow
1. Discover Columns
altimate-dbt columns --model <name>
altimate-dbt column-values --model <name> --column <col>
2. Read Existing Tests