Skip to content

Commit

Permalink
dbt test now enables passing values
Browse files Browse the repository at this point in the history
  • Loading branch information
nataliefiann committed Sep 24, 2024
1 parent 9206e64 commit ce39d1f
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion website/docs/reference/global-configs/resource-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The available resource types are:

</VersionBlock>

<VersionBlock firstVersion="1.8">
<VersionBlock lastVersion="1.8">

- [`analysis`](/docs/build/analyses)
- [`exposure`](/docs/build/exposures)
Expand All @@ -58,6 +58,47 @@ The available resource types are:

</VersionBlock>

<VersionBlock firstVersion="1.9">

- [`analysis`](/docs/build/analyses)
- [`exposure`](/docs/build/exposures)
- [`metric`](/docs/build/build-metrics-intro)
- [`model`](/docs/build/models)
- [`saved_query`](/docs/build/saved-queries)
- [`seed`](/docs/build/seeds)
- [`semantic_model`](/docs/build/semantic-models)
- [`snapshot`](/docs/build/snapshots)
- [`source`](/docs/build/sources)
- [`test`](/docs/build/data-tests)
- [`unit_test`](/docs/build/unit-tests)

dbt `test` now enables passing values such as `unit_tests`, `tests` and more so in the `--resource-type` and `--exclude-resource-type` for CLI flags (or in the environment variables `DBT_RESOURCE_TYPES` and `DBT_EXCLUDE_RESOURCE_TYPES)`.

Here are some examples of how dbt `test` enables passing values:

<Expandable alt_header="CLI flag">

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

</Expandable>

<Expandable alt_header="Environment variables">

```
`DBT_RESOURCE_TYPES`=`unit_test` dbt `test`
`DBT_EXCLUDE_RESOURCE_TYPES`=`unit_test` dbt `test`
```

</Expandable>

</VersionBlock>

## Example

Instead of targeting specific resources, use the `--resource-flag` or `--exclude-resource-type` flags to target all resources of a certain type: `dbt build --resource-type RESOURCE_TYPE` replacing `RESOURCE_TYPE` with the resource type you want to include.
Expand Down

0 comments on commit ce39d1f

Please sign in to comment.