Skip to content

Commit

Permalink
Replace deprecated tests config with new data_tests config
Browse files Browse the repository at this point in the history
  • Loading branch information
morsapaes committed May 20, 2024
1 parent aee014f commit 7a91aab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions doc/user/content/manage/dbt/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,11 +555,11 @@ non-stop, and monitor failures as soon as they happen. This is useful for unit
testing during the development of your dbt models, and later in production to
trigger **real-time alerts** downstream.

1. To configure your project for continuous testing, add a `tests` property to
1. To configure your project for continuous testing, add a `data_tests` property to
`dbt_project.yml` with the `store_failures` configuration:

```yaml
tests:
data_tests:
dbt_project.name:
models:
+store_failures: true
Expand All @@ -574,7 +574,7 @@ trigger **real-time alerts** downstream.
**Note:** As an alternative, you can specify the `--store-failures` flag
when running `dbt test`.

1. Add tests to your models using the `tests` property in the model
1. Add tests to your models using the `data_tests` property in the model
configuration `.yml` files:

```yaml
Expand All @@ -584,7 +584,7 @@ trigger **real-time alerts** downstream.
columns:
- name: col_a
description: 'column a description'
tests:
data_tests:
- not_null
- unique
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ clean-targets:
- "target"
- "dbt_packages"

tests:
data_tests:
{project_name}:
+store_failures: true
+schema: 'etl_failure'
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ models:
columns:
- name: seller
description: "The seller for an auction"
tests:
data_tests:
- unique
- not_null
- name: seller_item
Expand All @@ -40,7 +40,7 @@ models:
columns:
- name: id
description: "The id of the buyer or seller"
tests:
data_tests:
- not_null
- name: credits
description: "Credit from an auction"
Expand All @@ -52,7 +52,7 @@ models:
columns:
- name: id
description: "The primary key of the auction"
tests:
data_tests:
- unique
- not_null
- name: buyer
Expand All @@ -73,7 +73,7 @@ models:
columns:
- name: id
description: "The primary key for this table"
tests:
data_tests:
- unique
- not_null

Expand All @@ -82,6 +82,6 @@ models:
columns:
- name: id
description: "The primary key for this table"
tests:
data_tests:
- unique
- not_null

0 comments on commit 7a91aab

Please sign in to comment.