Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbt test supports --resource-type / --exclude-resource-type CLI flags and related environment variables #6192

Merged
merged 16 commits into from
Oct 1, 2024
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion website/docs/reference/global-configs/resource-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ id: "resource-type"
sidebar: "resource type"
---

The `--resource-type` and `--exclude-resource-type` flags include or exclude resource types from the `dbt build`, `dbt clone`, and `dbt list` commands.
<VersionBlock lastVersion="1.8">

The `--resource-type` and `--exclude-resource-type` flags include or exclude resource types from the `dbt build`, `dbt clone`, and `dbt list` commands. In Versionless and from dbt v1.9 onwards, these flags are also supported in the `dbt test` command.

</VersionBlock>

<VersionBlock firstVersion="1.9">

The `--resource-type` and `--exclude-resource-type` flags include or exclude resource types from the `dbt build`, `dbt test`, `dbt clone`, and `dbt list` commands.

</VersionBlock>

This means the flags enable you to specify which types of resources to include or exclude when running the commands, instead of targeting specific resources.

Expand Down Expand Up @@ -109,3 +119,27 @@ Instead of targeting specific resources, use the `--resource-flag` or `--exclude
</File>

</VersionBlock>

<VersionBlock firstVersion="1.9">

- In this example, use the following command to exclude _all_ unit tests when running tests:

<File name='Usage'>

```text
dbt test --exclude-resource-type unit_test
```

</File>

- In this example, use the following command to include all data tests when running tests:

<File name='Usage'>

```text
dbt test --resource-type test
```

</File>

</VersionBlock>
Loading