forked from dbt-labs/dbt-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
8 deletions.
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 |
---|---|---|
@@ -1,10 +1,20 @@ | ||
### dbt integration test suite for dbt-utils | ||
|
||
database support: | ||
- [x] postgres | ||
- [x] redshift | ||
- [ ] bigquery (partial) | ||
- [ ] snowflake (partial) | ||
|
||
todo: | ||
- [ ] run in CI for at least postgres | ||
This directory contains an example dbt project which tests the macros in the `dbt-utils` package. An integration test typically involves making 1) a new seed file 2) a new model file 3) a schema test. | ||
|
||
For an example integration tests, check out the tests for the `get_url_parameter` macro: | ||
|
||
1. [Macro definition](https://github.com/fishtown-analytics/dbt-utils/blob/master/macros/web/get_url_parameter.sql) | ||
2. [Seed file with fake data](https://github.com/fishtown-analytics/dbt-utils/blob/master/integration_tests/data/web/data_urls.csv) | ||
3. [Model to test the macro](https://github.com/fishtown-analytics/dbt-utils/blob/master/integration_tests/models/web/test_urls.sql) | ||
4. [A schema test to assert the macro works as expected](https://github.com/fishtown-analytics/dbt-utils/blob/master/integration_tests/models/web/schema.yml#L2) | ||
|
||
|
||
Once you've added all of these files, you should be able to run: | ||
``` | ||
$ dbt seed | ||
$ dbt run --model {your_model_name} | ||
$ dbt test --model {your_model_name} | ||
``` | ||
|
||
If the tests all pass, then you're good to go! All tests will be run automatically when you create a PR against this repo. |