dbt test --select ... runs only the tests that match the selection graph, instead of every test in the project.
Common patterns
# tests on one model dbt test --select fct_orders # tests on a model and its parents dbt test --select +fct_orders # tests tagged "smoke" dbt test --select tag:smoke # tests for everything under a path dbt test --select path:models/marts # one named singular test dbt test --select assert_positive_order_amounts
Mental model
selection graph (models/sources/tags/paths)
|
v
only tests attached to / matching those nodes runWith dbt build --select fct_orders, you get the model and its tests in one DAG-aware invocation.
Why it matters
- Fast local feedback while developing one mart
- CI that tests only models changed in a PR (state selectors)
- Avoid burning warehouse credits on unrelated suites
Interview tip: Mention graph operators (+, + suffix for children) and tags: "I select +model+ when I need upstream rebuilds and downstream validation together."