-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start running integration tests in CircleCI.
- Loading branch information
1 parent
212d27d
commit 1395a34
Showing
3 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
version: 2.1 | ||
|
||
commands: | ||
setup_job: | ||
steps: | ||
- checkout | ||
- run: | ||
name: "Generate cache key" | ||
command: ./integration_tests/ci/checksum.sh | ||
|
||
- restore_cache: | ||
key: &deps1-cache deps1-{{ .Branch }}-{{ checksum "/tmp/checksum.txt" }} | ||
- run: | ||
name: "Setup profile" | ||
command: | | ||
mkdir -p ~/.dbt | ||
cp integration_tests/ci/profiles.yml ~/.dbt/profiles.yml | ||
- run: | ||
name: "Setup BigQuery Credentials" | ||
command: | | ||
echo $BIGQUERY_SERVICE_ACCOUNT_JSON > ${HOME}/bigquery-service-key.json | ||
jobs: | ||
setup_commit: | ||
docker: | ||
- image: cimg/python:3.11.4 | ||
steps: | ||
- setup_job | ||
|
||
- run: | ||
name: "Setup dbt" | ||
command: | | ||
python3 -m venv venv | ||
. venv/bin/activate | ||
pip install --upgrade pip | ||
pip install -r requirements.txt | ||
cd integration_tests | ||
dbt deps | ||
- save_cache: | ||
key: *deps1-cache | ||
paths: | ||
- "venv" | ||
- "integration_tests/dbt_packages" | ||
|
||
compile: | ||
docker: | ||
- image: cimg/python:3.11.4 | ||
|
||
steps: | ||
- setup_job | ||
- run: | ||
name: "Compile - BigQuery" | ||
environment: | ||
BIGQUERY_SERVICE_KEY_PATH: "/home/circleci/bigquery-service-key.json" | ||
command: | | ||
. venv/bin/activate | ||
echo `pwd` | ||
cd integration_tests | ||
dbt compile --target bigquery | ||
- run: | ||
name: "Compile - Snowflake" | ||
command: | | ||
. venv/bin/activate | ||
echo `pwd` | ||
cd integration_tests | ||
dbt compile --target snowflake | ||
bigquery_test: | ||
docker: | ||
- image: cimg/python:3.11.4 | ||
steps: | ||
- setup_job | ||
|
||
- run: | ||
name: "Test - BigQuery" | ||
environment: | ||
BIGQUERY_SERVICE_KEY_PATH: "/home/circleci/bigquery-service-key.json" | ||
command: | | ||
. venv/bin/activate | ||
echo `pwd` | ||
cd integration_tests | ||
dbt seed --target bigquery | ||
dbt compile --target bigquery | ||
dbt run --target bigquery | ||
dbt test --target bigquery | ||
snowflake_test: | ||
docker: | ||
- image: cimg/python:3.11.4 | ||
steps: | ||
- setup_job | ||
|
||
- run: | ||
name: "Test - Snowflake" | ||
command: | | ||
. venv/bin/activate | ||
echo `pwd` | ||
cd integration_tests | ||
dbt seed --target snowflake | ||
dbt compile --target snowflake | ||
dbt run --target snowflake | ||
dbt test --target snowflake | ||
workflows: | ||
commit: | ||
jobs: | ||
- setup_commit | ||
- compile: | ||
requires: | ||
- setup_commit | ||
- wait_for_approval: | ||
type: approval | ||
requires: | ||
- compile | ||
- bigquery_test: | ||
requires: | ||
- wait_for_approval | ||
- snowflake_test: | ||
requires: | ||
- wait_for_approval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
find . '(' -name "packages.yml" -o -name "requirements.txt" ')' -not -path "./dbt_packages/*" -exec md5sum {} \; >/tmp/checksum.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
config: | ||
send_anonymous_usage_stats: False | ||
use_colors: True | ||
|
||
dbt_fullstory_integration_tests: | ||
target: bigquery | ||
outputs: | ||
bigquery: | ||
type: bigquery | ||
method: service-account | ||
keyfile: "{{ env_var('BIGQUERY_SERVICE_KEY_PATH') }}" | ||
project: "{{ env_var('BIGQUERY_GCP_PROJECT') }}" | ||
dataset: "dbt_fullstory_testing" | ||
threads: 4 | ||
priority: interactive | ||
|
||
snowflake: | ||
type: snowflake | ||
account: "{{ env_var('SNOWFLAKE_ACCOUNT') }}" | ||
user: "{{ env_var('SNOWFLAKE_TEST_USER') }}" | ||
password: "{{ env_var('SNOWFLAKE_TEST_PASSWORD') }}" | ||
role: "{{ env_var('SNOWFLAKE_TEST_ROLE') }}" | ||
database: "{{ env_var('SNOWFLAKE_TEST_DATABASE') }}" | ||
warehouse: "{{ env_var('SNOWFLAKE_TEST_WAREHOUSE') }}" | ||
schema: dbt_fullstory_testing | ||
threads: 4 |