Skip to content

Feature: Integration tests #38

Feature: Integration tests

Feature: Integration tests #38

name: Integration Tests, CI
on:
pull_request:
types:
- opened
- synchronize
branches:
- main
env:
DBT_DEFAULT_TARGET: databricks
DBT_PROFILES_DIR: ${{ github.workspace }}/integration_tests
DBT_PROJECT_DIR: ${{ github.workspace }}/integration_tests
DATABRICKS_TEST_HOST: ${{ secrets.DATABRICKS_TEST_HOST }}
DATABRICKS_TEST_HTTP_PATH: ${{ secrets.DATABRICKS_HTTP_PATH }}
DATABRICKS_TEST_TOKEN: ${{ secrets.DATABRICKS_TEST_TOKEN }}
DATABRICKS_TEST_CATALOG: ${{ vars.DATABRICKS_TEST_CATALOG }}
GITHUB_REF_NAME: ${{ github.ref_name }}
GITHUB_RUN_NUMBER: ${{ github.run_number }}
jobs:
integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
cd integration_tests/
python -m pip install --upgrade pip
pip install -r requirements.txt
export DATABRICKS_TEST_SCHEMA=$(echo "dbt_ci_${GITHUB_REF_NAME}_${GITHUB_RUN_NUMBER}" | sed 's;/;_;g' | sed 's/-/_/g')
export CLEANED_BRANCH=$(echo "${GITHUB_REF_NAME}" | sed 's;/;_;g' | sed 's/-/_/g')
dbt deps
- name: Integration Test - Databricks Billing
run: |
export DATABRICKS_TEST_SCHEMA=$(echo "dbt_ci_${GITHUB_REF_NAME}_${GITHUB_RUN_NUMBER}" | sed 's;/;_;g' | sed 's/-/_/g')
export CLEANED_BRANCH=$(echo "${GITHUB_REF_NAME}" | sed 's;/;_;g' | sed 's/-/_/g')
dbt seed
dbt run-operation warehouses
dbt run-operation clusters
dbt test -s source:*
dbt build --exclude-resource-type seed
dbt run-operation drop_schemas_dev --args '{pattern: dbt_ci_'"$CLEANED_BRANCH"'_*}'