Create and test new integration tests
mainWhen adding new functionality, you should follow a Test-Driven Development (TDD) workflow: create a failing test first, then implement the logic to make it pass.
Components of a new test
- A new seed file containing fixture data.
- A new model file to test against.
- A new test to assert the expected behavior.
Running specific tests
If you are working within a sub-project in the integration_tests folder, you can run only the relevant tests using dbt commands. Use the + operator in the --select flag to include all dependencies:
# Install dependencies for the sub-project
dbt deps --target {your_target}
# Run seeds, models, and tests for the selection
dbt build --target {your_target} --select +{your_selection_criteria}Alternatively, you can use the project's make commands if you prefer running the full suite:
make dev target={your_target}
make test target={your_target}dbt deps --target {your_target}
dbt build --target {your_target} --select +{your_selection_criteria}