diff --git a/.github/workflows/pr_tests.yml b/.github/workflows/pr_tests.yml index cc992a5f..b77b5639 100644 --- a/.github/workflows/pr_tests.yml +++ b/.github/workflows/pr_tests.yml @@ -86,11 +86,11 @@ jobs: - name: Get branch name id: vars # This needs surfaced for below 'run unit tests' step which may run on specific branch only - run: + run: | if [ "${{ github.base_ref }}" = "main" ]; then - echo "BRANCH=release" >> $GITHUB_ENV + echo "BRANCH='release'" >> $GITHUB_ENV else - echo "BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV + echo "BRANCH='${{ github.head_ref }}'" >> $GITHUB_ENV fi - name: Configure Docker credentials uses: docker/login-action@v2 @@ -166,12 +166,15 @@ jobs: run: | dbt run-operation post_ci_cleanup --target ${{matrix.warehouse}} + - name: Make unit_tests.sh executable + run: chmod +x ./.scripts/unit_tests.sh + - name: Run Unit tests run: ./.scripts/unit_tests.sh -d ${{matrix.warehouse}} -b ${{ env.BRANCH }} - name: Run integration tests run: ./.scripts/integration_tests.sh -d ${{matrix.warehouse}} - + - name: "Post-test: Drop ci schemas" run: | dbt run-operation post_ci_cleanup --target ${{matrix.warehouse}} diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 00f69786..3072bcd0 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -113,6 +113,8 @@ models: +enabled: "{{ target.type == 'snowflake' | as_bool() }}" spark: +enabled: "{{ target.type == 'spark' | as_bool() }}" + unit_tests: + +materialized: "{{ 'table' if target.type in ['spark'] else 'view' }}" tests: snowplow_utils_integration_tests: diff --git a/integration_tests/models/utils/cross_db/expected_indexed_unnest.sql b/integration_tests/models/utils/cross_db/expected_indexed_unnest.sql index 82d5baa0..fe53e565 100644 --- a/integration_tests/models/utils/cross_db/expected_indexed_unnest.sql +++ b/integration_tests/models/utils/cross_db/expected_indexed_unnest.sql @@ -112,3 +112,4 @@ with prep as ( ) select test_type, element +from prep diff --git a/integration_tests/models/utils/cross_db/test_indexed_unnest.sql b/integration_tests/models/utils/cross_db/test_indexed_unnest.sql index 8f0d525c..e93a73d5 100644 --- a/integration_tests/models/utils/cross_db/test_indexed_unnest.sql +++ b/integration_tests/models/utils/cross_db/test_indexed_unnest.sql @@ -16,4 +16,4 @@ with data as ( ) -select test_type, element from expected +select test_type, element from expected