Skip to content

Commit

Permalink
Address comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
plypaul committed Jun 6, 2024
1 parent fa30148 commit 8e5d5ec
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/cd-sql-engine-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,23 @@ name: MetricFlow SQL Engine Tests
# slower. As the test will be I/O bound, the tests can be run with higher parallelism to get faster runtimes.

on:
# Run if manually triggered. Example case: run against `main` to check if something is broken.
workflow_dispatch:
# Run if a PR is given a specific label.
pull_request:
types: [labeled]

env:
PYTHON_VERSION: "3.8"
EXTERNAL_ENGINE_TEST_PARALLELISM: 8
ADDITIONAL_PYTEST_OPTIONS: "--use-persistent-source-schema"
# If it's not `labeled`, it must be triggered via workflow dispatch.
RUN_TESTS: ${{ github.event.action != 'labeled' || github.event.label.name == 'Run Tests With Other SQL Engines' }}

jobs:
snowflake-tests:
environment: DW_INTEGRATION_TESTS
if: ${{ github.event.label.name == 'Run Tests With Other SQL Engines' }}
if: ${{ env.RUN_TESTS }}
name: Snowflake Tests
runs-on: ubuntu-latest
steps:
Expand All @@ -35,7 +39,7 @@ jobs:
redshift-tests:
environment: DW_INTEGRATION_TESTS
name: Redshift Tests
if: ${{ github.event.label.name == 'Run Tests With Other SQL Engines' }}
if: ${{ env.RUN_TESTS }}
runs-on: ubuntu-latest
steps:
- name: Check-out the repo
Expand All @@ -53,7 +57,7 @@ jobs:
bigquery-tests:
environment: DW_INTEGRATION_TESTS
name: BigQuery Tests
if: ${{ github.event.label.name == 'Run Tests With Other SQL Engines' }}
if: ${{ env.RUN_TESTS }}
runs-on: ubuntu-latest
steps:
- name: Check-out the repo
Expand All @@ -72,7 +76,7 @@ jobs:
databricks-tests:
environment: DW_INTEGRATION_TESTS
name: Databricks Tests
if: ${{ github.event.label.name == 'Run Tests With Other SQL Engines' }}
if: ${{ env.RUN_TESTS }}
runs-on: ubuntu-latest
steps:
- name: Check-out the repo
Expand All @@ -94,7 +98,7 @@ jobs:
# we may choose to execute them against a hosted instance, at which point this config will look like the other
# engine configs in this file.
name: Trino Tests
if: ${{ github.event.label.name == 'Run Tests With Other SQL Engines' }}
if: ${{ env.RUN_TESTS }}
runs-on: ubuntu-latest
services:
trino:
Expand All @@ -116,7 +120,7 @@ jobs:
runs-on: ubuntu-latest
needs: [ snowflake-tests, redshift-tests, bigquery-tests, databricks-tests ]
# Default behavior for `needs` is that it requires success. `always()` runs this action even if tests fail.
if: ${{ always() }}
if: ${{ env.RUN_TESTS && github.event.action == 'labeled' }}
steps:
- name: Remove Label
uses: actions-ecosystem/action-remove-labels@v1
Expand Down

0 comments on commit 8e5d5ec

Please sign in to comment.