Commit 6499107 1 parent c0be07f commit 6499107 Copy full SHA for 6499107
File tree 6 files changed +84
-21
lines changed
6 files changed +84
-21
lines changed Original file line number Diff line number Diff line change 10
10
username : dbt-labs
11
11
password : ' '
12
12
environment :
13
+ POSTGRES_HOST : localhost
13
14
POSTGRES_USER : root
14
- POSTGRES_DB : circle_test
15
+ POSTGRES_PORT : 5432
16
+ POSTGRES_DATABASE : circle_test
17
+ POSTGRES_SCHEMA : dbt_utils_integration_tests_postgres
18
+ DBT_ENV_SECRET_POSTGRES_PASS : ' '
15
19
16
20
steps :
17
21
- checkout
@@ -35,17 +39,15 @@ jobs:
35
39
python -m pip install --upgrade pip setuptools
36
40
python -m pip install --pre dbt-core dbt-postgres dbt-redshift dbt-snowflake dbt-bigquery dbt-databricks
37
41
38
- mkdir -p ~/.dbt
39
- cp integration_tests/ci/sample.profiles.yml ~/.dbt/profiles.yml
40
-
41
42
- run :
42
43
name : " Run Tests - Postgres"
43
44
environment :
44
- POSTGRES_TEST_HOST : localhost
45
- POSTGRES_TEST_USER : root
46
- POSTGRES_TEST_PASS : ' '
47
- POSTGRES_TEST_PORT : 5432
48
- POSTGRES_TEST_DBNAME : circle_test
45
+ POSTGRES_HOST : localhost
46
+ POSTGRES_USER : root
47
+ POSTGRES_PORT : 5432
48
+ POSTGRES_DATABASE : circle_test
49
+ POSTGRES_SCHEMA : dbt_utils_integration_tests_postgres
50
+ DBT_ENV_SECRET_POSTGRES_PASS : ' '
49
51
command : |
50
52
. dbt_venv/bin/activate
51
53
cd integration_tests
Original file line number Diff line number Diff line change
1
+ # **what?**
2
+ # Run tests for dbt-codegen against supported adapters
3
+
4
+ # **why?**
5
+ # To ensure that dbt-codegen works as expected with all supported adapters
6
+
7
+ # **when?**
8
+ # On every PR, and every push to main and when manually triggered
9
+
10
+ name : Package Integration Tests
11
+
12
+ on :
13
+ push :
14
+ branches :
15
+ - main
16
+ pull_request :
17
+ workflow_dispatch :
18
+
19
+ jobs :
20
+ run-tests :
21
+ uses : dbt-labs/dbt-package-testing/.github/workflows/run_tox.yml@v1
22
+ # this just tests with postgres so no variables need to be passed through.
23
+ # When it's time to add more adapters you will need to pass through inputs for
24
+ # the other adapters as shown in the below example for redshift
25
+ # with:
26
+ # # redshift
27
+ # REDSHIFT_HOST: ${{ vars.REDSHIFT_HOST }}
28
+ # REDSHIFT_USER: ${{ vars.REDSHIFT_USER }}
29
+ # REDSHIFT_DATABASE: ${{ vars.REDSHIFT_DATABASE }}
30
+ # REDSHIFT_SCHEMA: "integration_tests_redshift_${{ github.run_number }}"
31
+ # REDSHIFT_PORT: ${{ vars.REDSHIFT_PORT }}
32
+ # secrets:
33
+ # DBT_ENV_SECRET_REDSHIFT_PASS: ${{ secrets.DBT_ENV_SECRET_REDSHIFT_PASS }}
Original file line number Diff line number Diff line change
1
+ POSTGRES_HOST = localhost
2
+ POSTGRES_USER = root
3
+ DBT_ENV_SECRET_POSTGRES_PASS = password
4
+ POSTGRES_PORT = 5432
5
+ POSTGRES_DATABASE = audit_helper_test
6
+ POSTGRES_SCHEMA = audit_helper_integration_tests_postgres
Original file line number Diff line number Diff line change 1
-
2
- # HEY! This file is used in the dbt-audit-helper integrations tests with CircleCI.
3
- # You should __NEVER__ check credentials into version control. Thanks for reading :)
4
-
5
1
integration_tests :
6
2
target : postgres
7
3
outputs :
8
4
postgres :
9
- type : postgres
10
- host : " {{ env_var('POSTGRES_TEST_HOST ') }}"
11
- user : " {{ env_var('POSTGRES_TEST_USER ') }}"
12
- pass : " {{ env_var('POSTGRES_TEST_PASS ') }}"
13
- port : " {{ env_var('POSTGRES_TEST_PORT ') | as_number }}"
14
- dbname : " {{ env_var('POSTGRES_TEST_DBNAME ') }}"
15
- schema : audit_helper_integration_tests_postgres
16
- threads : 1
5
+ type : " postgres"
6
+ host : " {{ env_var('POSTGRES_HOST ') }}"
7
+ user : " {{ env_var('POSTGRES_USER ') }}"
8
+ pass : " {{ env_var('DBT_ENV_SECRET_POSTGRES_PASS ') }}"
9
+ port : " {{ env_var('POSTGRES_PORT ') | as_number }}"
10
+ dbname : " {{ env_var('POSTGRES_DATABASE ') }}"
11
+ schema : " {{ env_var('POSTGRES_SCHEMA') }} "
12
+ threads : 5
17
13
18
14
redshift :
19
15
type : redshift
@@ -51,3 +47,4 @@ integration_tests:
51
47
http_path : " {{ env_var('DATABRICKS_TEST_HTTP_PATH') }}"
52
48
token : " {{ env_var('DATABRICKS_TEST_ACCESS_TOKEN') }}"
53
49
threads : 10
50
+
Original file line number Diff line number Diff line change
1
+ SUPPORTED_ADAPTERS = postgres
Original file line number Diff line number Diff line change
1
+ [tox]
2
+ skipsdist = True
3
+ envlist = lint_all, testenv
4
+
5
+ [testenv]
6
+ passenv =
7
+ # postgres env vars
8
+ POSTGRES_HOST
9
+ POSTGRES_USER
10
+ DBT_ENV_SECRET_POSTGRES_PASS
11
+ POSTGRES_PORT
12
+ POSTGRES_DATABASE
13
+ POSTGRES_SCHEMA
14
+
15
+ # Postgres integration tests for centralized dbt testing
16
+ # run dbt commands directly, assumes dbt is already installed in environment
17
+ [testenv:dbt_integration_postgres]
18
+ changedir = integration_tests
19
+ allowlist_externals =
20
+ dbt
21
+ skip_install = true
22
+ commands =
23
+ dbt --version
24
+ dbt debug --target postgres
You can’t perform that action at this time.
0 commit comments