From 52358d16d67275ff225cac3d73dbf5009aa10010 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Mon, 20 May 2024 14:47:59 -0400 Subject: [PATCH] add breakout between flaky and non-flaky tests --- .github/workflows/release-internal.yml | 57 ++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-internal.yml b/.github/workflows/release-internal.yml index 1c58bc9fe..3bba79a26 100644 --- a/.github/workflows/release-internal.yml +++ b/.github/workflows/release-internal.yml @@ -94,21 +94,16 @@ jobs: name: 'Integration Tests' runs-on: ubuntu-latest needs: unit-tests - env: TOXENV: integration-redshift - PYTEST_ADDOPTS: "-v --color=yes -n4 --csv integration_results.csv" + PYTEST_ADDOPTS: "-v --color=yes -n4" DBT_INVOCATION_ENV: github-actions - steps: - name: "Checkout provided ref, default to branch main" uses: actions/checkout@v4 with: ref: "${{ inputs.ref }}" - - name: "Setup Environment Variables - ./scripts/env-setup.sh" - run: source ./scripts/env-setup.sh - - name: "Set up Python - ${{ env.PYTHON_TARGET_VERSION }}" uses: actions/setup-python@v5 with: @@ -164,12 +159,58 @@ jobs: DBT_TEST_USER_1: dbt_test_user_1 DBT_TEST_USER_2: dbt_test_user_2 DBT_TEST_USER_3: dbt_test_user_3 - run: tox -- -m "not flaky" --ddtrace + run: tox -- -m "not flaky" + + integration-tests-flaky: + name: 'Integration Tests (flaky)' + runs-on: ubuntu-latest + needs: integration-tests + + env: + TOXENV: integration-redshift + PYTEST_ADDOPTS: "-v --color=yes -n1" + DBT_INVOCATION_ENV: github-actions + + steps: + - name: "Checkout provided ref, default to branch main" + uses: actions/checkout@v4 + with: + ref: "${{ inputs.ref }}" + + - name: "Set up Python - ${{ env.PYTHON_TARGET_VERSION }}" + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_TARGET_VERSION }} + + - name: "Install Python Dependencies" + run: | + python -m pip install --user --upgrade pip + python -m pip --version + python -m pip install tox + tox --version + + - name: "Run tox" + env: + REDSHIFT_TEST_DBNAME: ${{ secrets.REDSHIFT_TEST_DBNAME }} + REDSHIFT_TEST_PASS: ${{ secrets.REDSHIFT_TEST_PASS }} + REDSHIFT_TEST_USER: ${{ secrets.REDSHIFT_TEST_USER }} + REDSHIFT_TEST_PORT: ${{ secrets.REDSHIFT_TEST_PORT }} + REDSHIFT_TEST_HOST: ${{ secrets.REDSHIFT_TEST_HOST }} + REDSHIFT_TEST_REGION: ${{ vars.REDSHIFT_TEST_REGION }} + REDSHIFT_TEST_CLUSTER_ID: ${{ vars.REDSHIFT_TEST_CLUSTER_ID }} + REDSHIFT_TEST_IAM_USER_PROFILE: ${{ vars.REDSHIFT_TEST_IAM_USER_PROFILE }} + REDSHIFT_TEST_IAM_USER_ACCESS_KEY_ID: ${{ vars.REDSHIFT_TEST_IAM_USER_ACCESS_KEY_ID }} + REDSHIFT_TEST_IAM_USER_SECRET_ACCESS_KEY: ${{ secrets.REDSHIFT_TEST_IAM_USER_SECRET_ACCESS_KEY }} + REDSHIFT_TEST_IAM_ROLE_PROFILE: ${{ vars.REDSHIFT_TEST_IAM_ROLE_PROFILE }} + DBT_TEST_USER_1: dbt_test_user_1 + DBT_TEST_USER_2: dbt_test_user_2 + DBT_TEST_USER_3: dbt_test_user_3 + run: tox -- -m flaky create-internal-release: name: Create release for internal archive runs-on: ubuntu-latest - needs: integration-tests + needs: integration-tests-flaky steps: - name: "Checkout provided ref, default to branch main"