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 #6126

Closed
wants to merge 14 commits into from
Closed
Changes from 12 commits
Commits
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
34 changes: 34 additions & 0 deletions website/docs/reference/global-configs/resource-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,18 @@ id: "resource-type"
sidebar: "resource type"
---

<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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non blocker but thought it might be helpful for 1.8 and lower users to know that newer versions/versionless supports dbt test

Suggested change
The `--resource-type` and `--exclude-resource-type` flags include or exclude resource types from the `dbt build`, `dbt clone`, and `dbt list` commands.
The `--resource-type` and `--exclude-resource-type` flags include or exclude resource types from the `dbt build`, `dbt clone`, and `dbt list` commands. Starting in Versionless and dbt v1.9, 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this resolves the comment in #6126 (comment).

Namely, as-of v1.9, there are 4 different subcommands that support these flags, and this sentence lists all of them: build, test, clone, and list.


</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.

:::tip Note
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