Skip to content

Commit

Permalink
Configuring database for data tests (#6313)
Browse files Browse the repository at this point in the history
## What are you changing in this pull request and why?

Align the docs for `database` for data tests so they match those for
`schema`.

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

<!-- vercel-deployment-preview -->
---
🚀 Deployment available! Here are the direct links to the updated files:


-
https://docs-getdbt-com-git-dbeatty10-patch-1-dbt-labs.vercel.app/reference/resource-configs/database

<!-- end-vercel-deployment-preview -->
  • Loading branch information
dbeatty10 authored Nov 29, 2024
1 parent a1f6c92 commit 2502d75
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions website/docs/reference/resource-configs/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,19 @@ This results in the generated relation being located in the `snapshots` database

<TabItem value="test" label="Tests">

Configure a database in your `dbt_project.yml` file.
Customize the database for storing test results in your `dbt_project.yml` file.

For example, to load a test into a database called `reporting` instead of the target database, you can configure it like this:
For example, to save test results in a specific database, you can configure it like this:

<File name='dbt_project.yml'>

```yml
tests:
- my_not_null_test:
column_name: order_id
type: not_null
+database: reporting
+store_failures: true
+database: test_results
```

This would result in the generated relation being located in the `reporting` database, so the full relation name would be `reporting.finance.my_not_null_test`.

This would result in the test results being stored in the `test_results` database.
</File>
</TabItem>
</Tabs>
Expand Down

0 comments on commit 2502d75

Please sign in to comment.