Skip to content

Commit

Permalink
convert supported adapters to a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
emmyoop committed Jun 24, 2024
1 parent 0e9f97e commit 1829266
Showing 1 changed file with 7 additions and 32 deletions.
39 changes: 7 additions & 32 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[tox]
skipsdist = True
envlist = lint_all, testenv
# this needs to be defined on a single line. tox has problems with multiline lists
# This list determined which adapters will be run by dbt centralized testing
supported_adapters = postgres, snowflake, redshift, bigquery


[testenv]
setenv =
SUPPORTED_ADAPTERS = postgres,snowflake,redshift,bigquery
passenv =
# postgres env vars
POSTGRES_HOST
Expand Down Expand Up @@ -34,46 +34,23 @@ passenv =
DBT_ENV_SECRET_BIGQUERY_KEYFILE_JSON
BIGQUERY_SCHEMA

# This is required to ensure that the correct adapters are tested
[testenv:list_supported_adapters]
allowlist_externals = echo
commands = echo {[tox]supported_adapters}

# Uses pytest to run tests, very basic and doesn't require dbt
[testenv:dbt_integration_pytest]
changedir = {toxinidir}
allowlist_externals = pytest
deps = pytest
skip_install = true
commands =
pytest {posargs} tests/functional

# Snowflake integration tests for centralized dbt testing
# run dbt commands directly, assumes dbt is already installed in environment
# Also adds in pytest testing. These are very basic and don't require dbt.
# pytest runs at the root of the repo, so we need to cd out of the integration_tests directory
[testenv:dbt_integration_snowflake]
changedir = integration_tests
allowlist_externals =
dbt
bash
{[testenv:dbt_integration_pytest]allowlist_externals}
allowlist_externals = dbt
skip_install = true
deps = {[testenv:dbt_integration_pytest]deps}
commands =
dbt --version
dbt debug --target snowflake
dbt deps --target snowflake
dbt build --target snowflake --full-refresh
bash -c "cd {toxinidir} && {[testenv:dbt_integration_pytest]commands}"


# 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
allowlist_externals = dbt
skip_install = true
commands =
dbt --version
Expand All @@ -84,8 +61,7 @@ commands =
# BigQuery integration tests for centralized dbt testing
[testenv:dbt_integration_bigquery]
changedir = integration_tests
allowlist_externals =
dbt
allowlist_externals = dbt
skip_install = true
commands =
dbt --version
Expand All @@ -96,8 +72,7 @@ commands =
# redshift integration tests for centralized dbt testing
[testenv:dbt_integration_redshift]
changedir = integration_tests
allowlist_externals =
dbt
allowlist_externals = dbt
skip_install = true
commands =
dbt --version
Expand Down

0 comments on commit 1829266

Please sign in to comment.