Skip to content

Commit

Permalink
add support for redshift testing (#204)
Browse files Browse the repository at this point in the history
Co-authored-by: Doug Beatty <[email protected]>
  • Loading branch information
emmyoop and dbeatty10 authored Nov 22, 2024
1 parent b28ab7d commit 972aa3f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ jobs:
SNOWFLAKE_DATABASE: ${{ vars.SNOWFLAKE_DATABASE }}
SNOWFLAKE_WAREHOUSE: ${{ vars.SNOWFLAKE_WAREHOUSE }}
SNOWFLAKE_SCHEMA: "integration_tests_snowflake_${{ github.run_number }}"
# 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:
SNOWFLAKE_ACCOUNT: ${{ secrets.SNOWFLAKE_ACCOUNT }}
DBT_ENV_SECRET_SNOWFLAKE_PASS: ${{ secrets.SNOWFLAKE_PASS }}
DBT_ENV_SECRET_REDSHIFT_PASS: ${{ secrets.REDSHIFT_PASS }}
14 changes: 7 additions & 7 deletions integration_tests/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ integration_tests:
threads: 5

redshift:
type: redshift
host: "{{ env_var('REDSHIFT_TEST_HOST') }}"
user: "{{ env_var('REDSHIFT_TEST_USER') }}"
pass: "{{ env_var('REDSHIFT_TEST_PASS') }}"
dbname: "{{ env_var('REDSHIFT_TEST_DBNAME') }}"
port: "{{ env_var('REDSHIFT_TEST_PORT') | as_number }}"
schema: codegen_integration_tests_redshift
type: "redshift"
host: "{{ env_var('REDSHIFT_HOST') }}"
user: "{{ env_var('REDSHIFT_USER') }}"
pass: "{{ env_var('DBT_ENV_SECRET_REDSHIFT_PASS') }}"
dbname: "{{ env_var('REDSHIFT_DATABASE') }}"
port: "{{ env_var('REDSHIFT_PORT') | as_number }}"
schema: "{{ env_var('REDSHIFT_SCHEMA') }}"
threads: 1

bigquery:
Expand Down
2 changes: 1 addition & 1 deletion supported_adapters.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SUPPORTED_ADAPTERS=postgres,snowflake
SUPPORTED_ADAPTERS=postgres,snowflake,redshift
22 changes: 22 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ passenv =
SNOWFLAKE_DATABASE
SNOWFLAKE_WAREHOUSE
SNOWFLAKE_SCHEMA
# redshift env vars
REDSHIFT_HOST
REDSHIFT_USER
DBT_ENV_SECRET_REDSHIFT_PASS
REDSHIFT_DATABASE
REDSHIFT_SCHEMA
REDSHIFT_PORT

# Postgres integration tests for centralized dbt testing
# run dbt commands directly, assumes dbt is already installed in environment
Expand Down Expand Up @@ -49,3 +56,18 @@ commands =
dbt --warn-error seed --target snowflake --full-refresh
dbt --warn-error run --target snowflake
dbt --warn-error test --target snowflake

# redshift integration tests for centralized dbt testing
# run dbt commands directly, assumes dbt is already installed in environment
[testenv:dbt_integration_redshift]
changedir = integration_tests
allowlist_externals =
dbt
skip_install = true
commands =
dbt --version
dbt --warn-error deps --target redshift
dbt --warn-error run-operation create_source_table --target redshift
dbt --warn-error seed --target redshift --full-refresh
dbt --warn-error run --target redshift
dbt --warn-error test --target redshift

0 comments on commit 972aa3f

Please sign in to comment.