Skip to content

Commit

Permalink
update integration tests for the new psycopg2 install approach
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Jun 6, 2024
1 parent 54895eb commit cb7307b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
10 changes: 10 additions & 0 deletions .github/scripts/check_psycopg2_install.sh
Original file line number Diff line number Diff line change
@@ -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
34 changes: 20 additions & 14 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit cb7307b

Please sign in to comment.