Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbanin authored May 14, 2018
1 parent af7a5e6 commit df867a7
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions integration_tests/README.md
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.

0 comments on commit df867a7

Please sign in to comment.