What problem does it solve?
This Skill helps engineers and analysts create reproducible dbt unit test definitions that mock upstream model inputs and assert expected outputs, reducing the risk of regressions and enabling test-driven development for SQL models.
Core Features & Use Cases
- Mocked Inputs and Expected Outputs: Define given inputs for refs, sources, and seeds and declare the expected rows for the model under test.
- Multiple Fixture Formats: Support for inline dict, csv, and sql formats as well as external fixture files in test-paths.
- Special Case Handling: Guidance for incremental models, ephemeral dependencies, versioned models, and adapter-specific caveats for BigQuery, Redshift, Snowflake, Postgres, and Spark.
- Overrides and Environment Control: Ability to override macros, project vars, and environment variables for precise test scenarios.
- Use Case: Add unit tests for complex transformations (regex, window functions, multi-join logic) or validate bug fixes before materializing models.
Quick Start
Add a unit test YAML entry that names the test, points at the model, supplies given inputs for each upstream ref or source, and lists the expected rows for the model's output.