Skip to content

Commit

Permalink
Merge pull request #1979 from fishtown-analytics/feature/configurable…
Browse files Browse the repository at this point in the history
…-test-warehouses

make tests honor environment variables (#1939)
  • Loading branch information
beckjake committed Dec 5, 2019
2 parents ace777e + 5797be9 commit 549168b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions test.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ SNOWFLAKE_TEST_DATABASE=
SNOWFLAKE_TEST_ALT_DATABASE=
SNOWFLAKE_TEST_QUOTED_DATABASE=
SNOWFLAKE_TEST_WAREHOUSE=
SNOWFLAKE_TEST_ALT_WAREHOUSE=

BIGQUERY_TYPE=
BIGQUERY_PROJECT_ID=
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{{ config(materialized='table') }}
select 'DBT_TEST_ALT' as warehouse
select '{{ env_var("SNOWFLAKE_TEST_ALT_WAREHOUSE", "DBT_TEST_ALT") }}' as warehouse
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{{ config(snowflake_warehouse='DBT_TEST_ALT', materialized='table') }}
{{ config(snowflake_warehouse=env_var('SNOWFLAKE_TEST_ALT_WAREHOUSE', 'DBT_TEST_ALT'), materialized='table') }}
select current_warehouse() as warehouse
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{{ config(materialized='table') }}
select 'DBT_TEST_ALT' as warehouse
select '{{ env_var("SNOWFLAKE_TEST_ALT_WAREHOUSE", "DBT_TEST_ALT") }}' as warehouse
2 changes: 1 addition & 1 deletion test/integration/050_warehouse_test/test_warehouses.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def project_config(self):
'source-paths': ['project-config-models'],
'models': {
'test': {
'snowflake_warehouse': 'DBT_TEST_ALT',
'snowflake_warehouse': os.getenv('SNOWFLAKE_TEST_ALT_WAREHOUSE', 'DBT_TEST_ALT'),
},
},
}
Expand Down

0 comments on commit 549168b

Please sign in to comment.