---
title: "Adding a dbt unit test: review, setup & limitations · Undominated.ai"
canonical: https://undominated.ai/skills/dbt-labs-adding-dbt-unit-test/
description: "Builds dbt SQL-model unit tests from explicit input fixtures and expected output rows."
---

# Adding a dbt unit test: review, setup & limitations · Undominated.ai

> Builds dbt SQL-model unit tests from explicit input fixtures and expected output rows.

[← Explore all skills](/skills/)

DATA AND ANALYTICS / dbt Labs

# Adding a dbt unit test

Builds dbt SQL-model unit tests from explicit input fixtures and expected output rows.

 [See setup guidance ↓](#setup)[Original source ↗](https://github.com/dbt-labs/dbt-agent-skills/tree/168a2b0b92da59be88866257140907c206ff0e44/skills/dbt/skills/adding-dbt-unit-test)

SOURCE REVIEW

 Reviewed 2026-10-07
 Evidence 3 linked sources
 Publisher dbt Labs
 Licence [Apache-2.0 ↗](https://github.com/dbt-labs/dbt-agent-skills/blob/168a2b0b92da59be88866257140907c206ff0e44/LICENSE)
 Revision 168a2b0b92da
 [Read what was—and wasn’t—checked ↓](#review)

“Creates unit test YAML definitions that mock upstream model inputs and validate expected outputs. Use when adding unit tests for a dbt model or practicing test-driven development (TDD) in dbt.”

 [dbt Labs · upstream description ↗](https://github.com/dbt-labs/dbt-agent-skills/blob/168a2b0b92da59be88866257140907c206ff0e44/skills/dbt/skills/adding-dbt-unit-test/SKILL.md) Our analysis follows below.

01 / THE REASONING

## Why this made the selection.

 - Documents dict/CSV/SQL fixture tradeoffs and the special SQL-fixture requirement for ephemeral dependencies.
- Separates unit checks from production data tests and explicitly warns that --empty can overwrite existing model contents.

### A good fit for

 - Adding a unit test to a dbt model
- Refusing a test that hits a live warehouse by accident

### Weigh up before choosing

 - Mocked inputs do not make dbt tests offline. SQL models only; not a validator of production data, Python models or final incremental-table state. Never run --empty against data that must be retained.
- Reviewed definition and licence are pinned; installation and real-task outcomes for this resource were not tested.

02 / THE REVIEW RECORD

## What we actually inspected.

Source review has boundaries. A clear record is more useful than a “safe” badge.

### Material inspected

 - skills/dbt/skills/adding-dbt-unit-test/SKILL.md (complete frontmatter and body)
- https://github.com/dbt-labs/dbt-agent-skills/blob/168a2b0b92da59be88866257140907c206ff0e44/LICENSE (applicable licence text)

### Our findings

 - Documents dict/CSV/SQL fixture tradeoffs and the special SQL-fixture requirement for ephemeral dependencies.
- Separates unit checks from production data tests and explicitly warns that --empty can overwrite existing model contents.
- Writes YAML/SQL/CSV fixtures and runs warehouse-connected dbt commands; --empty and build/run can replace relations.

### Not established by this review

 - Host discovery, task execution and model quality were not tested.
- Referenced helpers, sibling plugins and external service operations were not exhaustively audited or executed.

The review applies to the material and revision named here. A newer upstream release can change its behavior.

03 / PUT IT TO WORK

## Add a skill to your workflow.

[Upstream setup instructions ↗](https://github.com/dbt-labs/dbt-agent-skills/blob/168a2b0b92da59be88866257140907c206ff0e44/README.md)

DOCUMENTED COMMAND

 npx skills@1.7.1 add https://github.com/dbt-labs/dbt-agent-skills/tree/168a2b0b92da59be88866257140907c206ff0e44/skills/dbt/skills/adding-dbt-unit-test --skill adding-dbt-unit-test Copy command ↗

Copying does not execute this command. It may retrieve a newer version than the reviewed source.

 - Use the exact reviewed directory/revision and select the intended host/project scope in Skills CLI.
- Retain all supporting files; separately configure companion skills, runtimes and service credentials named in the definition.
- Review the resulting diff and use an isolated target before any migration, deployment, load test or warehouse operation.

### Before you start

 - A supported dbt/adapter version, the full reference directory and an isolated development warehouse schema with parent relations prepared.

### Compatibility

Agent Skills-compatible hosts · dbt

### Host-mediated code, files and tools

 - Writes YAML/SQL/CSV fixtures and runs warehouse-connected dbt commands; --empty and build/run can replace relations.
- The host enforces permissions; installing instructions does not itself create a sandbox.

### Cost model

Source is available under the stated licence. Model usage, compute and connected services can incur charges.

04 / FOLLOW THE EVIDENCE

## The source trail.

Our notes are separate from the original resource. Check upstream before adopting a new version.

 - [Skill definition ↗](https://github.com/dbt-labs/dbt-agent-skills/blob/168a2b0b92da59be88866257140907c206ff0e44/skills/dbt/skills/adding-dbt-unit-test/SKILL.md) Checked 2026-10-07 https://github.com/dbt-labs/dbt-agent-skills/blob/168a2b0b92da59be88866257140907c206ff0e44/skills/dbt/skills/adding-dbt-unit-test/SKILL.md Supports: summary, whySelected, limitations, access, review
- [Repository licence ↗](https://github.com/dbt-labs/dbt-agent-skills/blob/168a2b0b92da59be88866257140907c206ff0e44/LICENSE) Checked 2026-10-07 https://github.com/dbt-labs/dbt-agent-skills/blob/168a2b0b92da59be88866257140907c206ff0e44/LICENSE Supports: Redistribution terms
- [Install instructions ↗](https://github.com/dbt-labs/dbt-agent-skills/blob/168a2b0b92da59be88866257140907c206ff0e44/README.md) Checked 2026-10-07 https://github.com/dbt-labs/dbt-agent-skills/blob/168a2b0b92da59be88866257140907c206ff0e44/README.md Supports: Documented install path

KEEP COMPARING

## Other approaches to consider.

Related by category or shared topics. These are alternatives to inspect, not a measured quality order.

 [### Upgrading dbt ↗ Plans a dbt v1 migration to 1.12 using adapter-specific issue bundles and a recorded verification gate.](/skills/dbt-labs-upgrading-dbt/)[### dbt Documentation Maintenance ↗ Audits descriptions in a dbt manifest and drafts missing model or column documentation in the project’s existing style.](/skills/dbt-labs-maintaining-dbt-documentation/)

 [AI Tools ↗](/tools/)[Skills ↗](/skills/)[Agents ↗](/agents/)[MCP Servers ↗](/mcp-servers/)[Workflows ↗](/workflows/)

## Continue your investigation

 - [Choose a toolkit](/tools/)
- [Inspect execution hosts](/agents/)
- [Check tool access](/mcp-servers/)
- [Check project dependencies](/check-repo/)
