Skip to content

Commit d91c386

Browse files
committed
Use workflows, more threads, fail fast, pg first
1 parent ac78d49 commit d91c386

File tree

3 files changed

+52
-24
lines changed

3 files changed

+52
-24
lines changed

.circleci/config.yml

+46-18
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11

2-
version: 2
2+
version: 2.1
33

44
jobs:
5-
build:
5+
6+
integration-postgres:
67
docker:
78
- image: circleci/python:3.6.3-stretch
89
- image: circleci/postgres:9.6.5-alpine-ram
910

1011
steps:
1112
- checkout
12-
13-
- run:
14-
run: setup_creds
15-
command: |
16-
echo $BIGQUERY_SERVICE_ACCOUNT_JSON > ${HOME}/bigquery-service-key.json
17-
18-
- restore_cache:
19-
key: deps2-{{ .Branch }}
20-
2113
- run:
2214
name: "Run Tests - Postgres"
2315
environment:
@@ -27,22 +19,58 @@ jobs:
2719
POSTGRES_TEST_PORT: 5432
2820
POSTGRES_TEST_DBNAME: circle_test
2921
command: ./run_test.sh postgres
22+
- store_artifacts:
23+
path: ./logs
3024

25+
integration-redshift:
26+
docker:
27+
- image: circleci/python:3.6.3-stretch
28+
steps:
29+
- checkout
3130
- run:
3231
name: "Run Tests - Redshift"
3332
command: ./run_test.sh redshift
33+
- store_artifacts:
34+
path: ./logs
3435

36+
integration-snowflake:
37+
docker:
38+
- image: circleci/python:3.6.3-stretch
39+
steps:
40+
- checkout
3541
- run:
3642
name: "Run Tests - Snowflake"
3743
command: ./run_test.sh snowflake
38-
44+
- store_artifacts:
45+
path: ./logs
46+
47+
integration-bigquery:
48+
environment:
49+
BIGQUERY_SERVICE_KEY_PATH: "/home/circleci/bigquery-service-key.json"
50+
docker:
51+
- image: circleci/python:3.6.3-stretch
52+
steps:
53+
- checkout
54+
- run:
55+
name: "Set up credentials"
56+
command: echo $BIGQUERY_SERVICE_ACCOUNT_JSON > ${HOME}/bigquery-service-key.json
3957
- run:
4058
name: "Run Tests - BigQuery"
41-
environment:
42-
BIGQUERY_SERVICE_KEY_PATH: "/home/circleci/bigquery-service-key.json"
4359
command: ./run_test.sh bigquery
60+
- store_artifacts:
61+
path: ./logs
4462

45-
- save_cache:
46-
key: deps1-{{ .Branch }}
47-
paths:
48-
- "venv"
63+
workflows:
64+
version: 2
65+
test-all:
66+
jobs:
67+
- integration-postgres
68+
- integration-redshift:
69+
requires:
70+
- integration-postgres
71+
- integration-snowflake:
72+
requires:
73+
- integration-postgres
74+
- integration-bigquery:
75+
requires:
76+
- integration-postgres

integration_tests/ci/sample.profiles.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ integration_tests:
1717
port: "{{ env_var('POSTGRES_TEST_PORT') | as_number }}"
1818
dbname: "{{ env_var('POSTGRES_TEST_DBNAME') }}"
1919
schema: dbt_utils_integration_tests_postgres
20-
threads: 1
20+
threads: 5
2121

2222
redshift:
2323
type: redshift
@@ -27,15 +27,15 @@ integration_tests:
2727
dbname: "{{ env_var('REDSHIFT_TEST_DBNAME') }}"
2828
port: "{{ env_var('REDSHIFT_TEST_PORT') | as_number }}"
2929
schema: dbt_utils_integration_tests_redshift
30-
threads: 1
30+
threads: 5
3131

3232
bigquery:
3333
type: bigquery
3434
method: service-account
3535
keyfile: "{{ env_var('BIGQUERY_SERVICE_KEY_PATH') }}"
3636
project: "{{ env_var('BIGQUERY_TEST_DATABASE') }}"
3737
schema: dbt_utils_integration_tests_bigquery
38-
threads: 1
38+
threads: 10
3939

4040
snowflake:
4141
type: snowflake
@@ -46,4 +46,4 @@ integration_tests:
4646
database: "{{ env_var('SNOWFLAKE_TEST_DATABASE') }}"
4747
warehouse: "{{ env_var('SNOWFLAKE_TEST_WAREHOUSE') }}"
4848
schema: dbt_utils_integration_tests_snowflake
49-
threads: 1
49+
threads: 10

run_test.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ if [[ ! -z $3 ]]; then _seeds="--select $3 --full-refresh"; fi
2424

2525
dbt deps --target $1
2626
dbt seed --target $1 $_seeds
27-
dbt run --target $1 $_models
28-
dbt test --target $1 $_models
27+
dbt run -x --target $1 $_models
28+
dbt test -x --target $1 $_models

0 commit comments

Comments
 (0)