Skip to content

Commit cb7307b

Browse files
committed
update integration tests for the new psycopg2 install approach
1 parent 54895eb commit cb7307b

File tree

2 files changed

+30
-14
lines changed

2 files changed

+30
-14
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
python -m pip install .
2+
PSYCOPG2_PIP_ENTRY=$(pip list | grep "psycopg2 " || pip list | grep psycopg2-binary)
3+
4+
echo $PSYCOPG2_PIP_ENTRY
5+
PSYCOPG2_NAME="${PSYCOPG2_PIP_ENTRY%% *}"
6+
echo $PSYCOPG2_NAME
7+
8+
if [[ "${PSYCOPG2_NAME}" != "${PSYCOPG2_EXPECTED_NAME}" ]]; then
9+
exit 1
10+
fi

.github/workflows/integration-tests.yml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,24 +102,30 @@ jobs:
102102

103103
psycopg2-check:
104104
name: "Test psycopg2 build version"
105-
runs-on: ${{ matrix.scenario.platform }}
105+
runs-on: ${{ matrix.platform }}
106106
strategy:
107107
fail-fast: false
108108
matrix:
109-
scenario:
110-
- {platform: ubuntu-latest, psycopg2-name: psycopg2}
111-
- {platform: macos-12, psycopg2-name: psycopg2-binary}
109+
platform:
110+
- ubuntu-24.04
111+
- macos-12
112112
steps:
113113
- name: "Check out repository"
114114
uses: actions/checkout@v4
115115

116-
- name: "Test psycopg2 name"
117-
run: |
118-
python -m pip install .
119-
PSYCOPG2_PIP_ENTRY=$(pip list | grep "psycopg2 " || pip list | grep psycopg2-binary)
120-
echo $PSYCOPG2_PIP_ENTRY
121-
PSYCOPG2_NAME="${PSYCOPG2_PIP_ENTRY%% *}"
122-
echo $PSYCOPG2_NAME
123-
if [[ "${PSYCOPG2_NAME}" != "${{ matrix.scenario.psycopg2-name }}" ]]; then
124-
exit 1
125-
fi
116+
- name: "Test psycopg2 name - default"
117+
run: ./.github/scripts/check_psycopg2_install.sh
118+
env:
119+
PSYCOPG2_EXPECTED_NAME: psycopg2-binary
120+
121+
- name: "Test psycopg2 name - override"
122+
run: ./.github/scripts/check_psycopg2_install.sh
123+
env:
124+
DBT_PSYCOPG2_NAME: psycopg2
125+
PSYCOPG2_EXPECTED_NAME: psycopg2
126+
127+
- name: "Test psycopg2 name - invalide override"
128+
run: ./.github/scripts/check_psycopg2_install.sh
129+
env:
130+
DBT_PSYCOPG2_NAME: rubber-baby-buggy-bumpers
131+
PSYCOPG2_EXPECTED_NAME: psycopg2-binary

0 commit comments

Comments
 (0)