From cb7307bc31ca06001603b19e4af77b5363623991 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 5 Jun 2024 20:18:30 -0400 Subject: [PATCH] update integration tests for the new psycopg2 install approach --- .github/scripts/check_psycopg2_install.sh | 10 +++++++ .github/workflows/integration-tests.yml | 34 +++++++++++++---------- 2 files changed, 30 insertions(+), 14 deletions(-) create mode 100644 .github/scripts/check_psycopg2_install.sh diff --git a/.github/scripts/check_psycopg2_install.sh b/.github/scripts/check_psycopg2_install.sh new file mode 100644 index 00000000..5d96a16e --- /dev/null +++ b/.github/scripts/check_psycopg2_install.sh @@ -0,0 +1,10 @@ +python -m pip install . +PSYCOPG2_PIP_ENTRY=$(pip list | grep "psycopg2 " || pip list | grep psycopg2-binary) + +echo $PSYCOPG2_PIP_ENTRY +PSYCOPG2_NAME="${PSYCOPG2_PIP_ENTRY%% *}" +echo $PSYCOPG2_NAME + +if [[ "${PSYCOPG2_NAME}" != "${PSYCOPG2_EXPECTED_NAME}" ]]; then + exit 1 +fi diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 1aefb7f5..54574a80 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -102,24 +102,30 @@ jobs: psycopg2-check: name: "Test psycopg2 build version" - runs-on: ${{ matrix.scenario.platform }} + runs-on: ${{ matrix.platform }} strategy: fail-fast: false matrix: - scenario: - - {platform: ubuntu-latest, psycopg2-name: psycopg2} - - {platform: macos-12, psycopg2-name: psycopg2-binary} + platform: + - ubuntu-24.04 + - macos-12 steps: - name: "Check out repository" uses: actions/checkout@v4 - - name: "Test psycopg2 name" - run: | - python -m pip install . - PSYCOPG2_PIP_ENTRY=$(pip list | grep "psycopg2 " || pip list | grep psycopg2-binary) - echo $PSYCOPG2_PIP_ENTRY - PSYCOPG2_NAME="${PSYCOPG2_PIP_ENTRY%% *}" - echo $PSYCOPG2_NAME - if [[ "${PSYCOPG2_NAME}" != "${{ matrix.scenario.psycopg2-name }}" ]]; then - exit 1 - fi + - name: "Test psycopg2 name - default" + run: ./.github/scripts/check_psycopg2_install.sh + env: + PSYCOPG2_EXPECTED_NAME: psycopg2-binary + + - name: "Test psycopg2 name - override" + run: ./.github/scripts/check_psycopg2_install.sh + env: + DBT_PSYCOPG2_NAME: psycopg2 + PSYCOPG2_EXPECTED_NAME: psycopg2 + + - name: "Test psycopg2 name - invalide override" + run: ./.github/scripts/check_psycopg2_install.sh + env: + DBT_PSYCOPG2_NAME: rubber-baby-buggy-bumpers + PSYCOPG2_EXPECTED_NAME: psycopg2-binary