-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tox-based Integration Testing Support (#111)
* Standardize integration tests. * Move profiles file. * Update config, remove extra profiles file. * Remove old sample profiles YAML. Modify conifg accordingly. * Tweak CircleCI config again. * One more try tweaking config. * Another tweak. * Add back other adapter profiles. * Apply suggestions from code review --------- Co-authored-by: Emily Rockman <[email protected]>
- Loading branch information
1 parent
c0be07f
commit 6499107
Showing
6 changed files
with
84 additions
and
21 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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# **what?** | ||
# Run tests for dbt-codegen against supported adapters | ||
|
||
# **why?** | ||
# To ensure that dbt-codegen works as expected with all supported adapters | ||
|
||
# **when?** | ||
# On every PR, and every push to main and when manually triggered | ||
|
||
name: Package Integration Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run-tests: | ||
uses: dbt-labs/dbt-package-testing/.github/workflows/run_tox.yml@v1 | ||
# this just tests with postgres so no variables need to be passed through. | ||
# When it's time to add more adapters you will need to pass through inputs for | ||
# the other adapters as shown in the below example for redshift | ||
# with: | ||
# # redshift | ||
# REDSHIFT_HOST: ${{ vars.REDSHIFT_HOST }} | ||
# REDSHIFT_USER: ${{ vars.REDSHIFT_USER }} | ||
# REDSHIFT_DATABASE: ${{ vars.REDSHIFT_DATABASE }} | ||
# REDSHIFT_SCHEMA: "integration_tests_redshift_${{ github.run_number }}" | ||
# REDSHIFT_PORT: ${{ vars.REDSHIFT_PORT }} | ||
# secrets: | ||
# DBT_ENV_SECRET_REDSHIFT_PASS: ${{ secrets.DBT_ENV_SECRET_REDSHIFT_PASS }} |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
POSTGRES_HOST=localhost | ||
POSTGRES_USER=root | ||
DBT_ENV_SECRET_POSTGRES_PASS=password | ||
POSTGRES_PORT=5432 | ||
POSTGRES_DATABASE=audit_helper_test | ||
POSTGRES_SCHEMA=audit_helper_integration_tests_postgres |
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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
SUPPORTED_ADAPTERS=postgres |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[tox] | ||
skipsdist = True | ||
envlist = lint_all, testenv | ||
|
||
[testenv] | ||
passenv = | ||
# postgres env vars | ||
POSTGRES_HOST | ||
POSTGRES_USER | ||
DBT_ENV_SECRET_POSTGRES_PASS | ||
POSTGRES_PORT | ||
POSTGRES_DATABASE | ||
POSTGRES_SCHEMA | ||
|
||
# Postgres integration tests for centralized dbt testing | ||
# run dbt commands directly, assumes dbt is already installed in environment | ||
[testenv:dbt_integration_postgres] | ||
changedir = integration_tests | ||
allowlist_externals = | ||
dbt | ||
skip_install = true | ||
commands = | ||
dbt --version | ||
dbt debug --target postgres |