-
Notifications
You must be signed in to change notification settings - Fork 977
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
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ce39d1f
dbt test now enables passing values
nataliefiann 12e1587
Update website/docs/reference/global-configs/resource-type.md
nataliefiann cc335cc
Update website/docs/reference/global-configs/resource-type.md
nataliefiann 7f9bebf
Update website/docs/reference/global-configs/resource-type.md
nataliefiann bbc091e
Merge branch 'current' into nfiann-resourcetype-dbttest
nataliefiann 5b1a6b6
Added to the `dbt test` subcommand starting in v1.9
dbeatty10 2d29514
Examples of `--resource-type` / `--exclude-resource-type` with `dbt t…
dbeatty10 c3591be
Remove in favor of the new examples added below
dbeatty10 42efcf8
List of applicable resources remains the same between v1.8 and v1.9
dbeatty10 18d67ca
Remove the version-specific call-out (which had the wrong version any…
dbeatty10 8935561
Merge branch 'current' into nfiann-resourcetype-dbttest
dbeatty10 a578f4e
Merge branch 'current' into nfiann-resourcetype-dbttest
mirnawong1 76b0405
Merge branch 'current' into nfiann-resourcetype-dbttest
mirnawong1 2fa9413
Merge branch 'current' into nfiann-resourcetype-dbttest
mirnawong1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
|
||
</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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: |
||
|
||
</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 | ||
|
@@ -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> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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