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

[Core] Enable --resource-type and --exclude-resource-type CLI flags and environment variables for dbt test #6101

Closed
FishtownBuildBot opened this issue Sep 19, 2024 · 2 comments · Fixed by #6192
Assignees
Labels
content Improvements or additions to content dbt Core The changes proposed in this issue relate to dbt Core dbt-core v1.9 improvement Use this when an area of the docs needs improvement as it's currently unclear

Comments

@FishtownBuildBot
Copy link

FishtownBuildBot commented Sep 19, 2024

At a minimum, update body to include a link to the page on docs.getdbt.com requiring updates and what part(s) of the page you would like to see updated.
Originating from this issue: dbt-labs/dbt-core#10656
Pull request: dbt-labs/dbt-core#10706

Documentation to update

At minimum (there may be other relevant pages):

Purpose

Be able to choose which test resources are included when executing the dbt test subcommand.

For example, be able to exclude unit tests. Or only run unit tests.

Code examples

dbt test now enables passing values like unit_tests, tests, etc. in the --resource-type / --exclude-resource-type CLI flags (or in the environment variables DBT_RESOURCE_TYPES / DBT_EXCLUDE_RESOURCE_TYPES).

Example 1 - CLI flags

dbt test --resource-type unit_test
dbt test --exclude-resource-type unit_test

Example 2 - environment variables

DBT_RESOURCE_TYPES=unit_test dbt test
DBT_EXCLUDE_RESOURCE_TYPES=unit_test dbt test
@runleonarun runleonarun added content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear dbt Core The changes proposed in this issue relate to dbt Core labels Sep 19, 2024
@dbeatty10 dbeatty10 changed the title [Core] Docs Changes Needed from dbt-core Issue #10656 [Core] Enable --resource-type and --exclude-resource-type CLI flags and environment variables for dbt test Sep 20, 2024
@graciegoheen
Copy link
Collaborator

Hi @nataliefiann I see this is in review, but don't see where the link to the PR is - could you share that with me?

@dbeatty10 dbeatty10 assigned dbeatty10 and unassigned graciegoheen Sep 30, 2024
dbeatty10 added a commit that referenced this issue Oct 1, 2024
… flags and related environment variables (#6192)

[Preview](https://docs-getdbt-com-git-dbeatty-6101-docs-dbt-labs.vercel.app/reference/global-configs/resource-type)

Resolves #6101
Originally #6126

## What are you changing in this pull request and why?

Beginning in dbt-core v1.9, it is possible to use the `--resource-type`
and `--exclude-resource-type` CLI flags (and related env vars) with the
`dbt test` command.

## Checklist
- [x] I have reviewed the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
- [x] The topic I'm writing about is for specific dbt version(s) and I
have versioned it according to the [version a whole
page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
and/or [version a block of
content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content)
guidelines.
- [x] Add a note to the prerelease version [Migration
Guide](https://github.com/dbt-labs/docs.getdbt.com/tree/current/website/docs/docs/dbt-versions/core-upgrade)

---------

Co-authored-by: Natalie Fiann <[email protected]>
Co-authored-by: nataliefiann <[email protected]>
Co-authored-by: Matt Shaver <[email protected]>
Co-authored-by: Mirna Wong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content dbt Core The changes proposed in this issue relate to dbt Core dbt-core v1.9 improvement Use this when an area of the docs needs improvement as it's currently unclear
Projects
None yet
5 participants