Skip to content

Commit ab7b76b

Browse files
committed
Fix db test suite
1 parent ae2b524 commit ab7b76b

File tree

1 file changed

+169
-1
lines changed

1 file changed

+169
-1
lines changed

.github/workflows/test-integrations-dbs.yml

Lines changed: 169 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,175 @@ jobs:
3131
matrix:
3232
python-version: ["3.7","3.8","3.11","3.12","3.13"]
3333
os: [ubuntu-22.04]
34-
container: ${{ (matrix.python-version == '3.6' || matrix.python-version == '3.7') && 'python:${{ matrix.python-version }}' || null }}
34+
services:
35+
postgres:
36+
image: postgres
37+
env:
38+
POSTGRES_PASSWORD: sentry
39+
# Set health checks to wait until postgres has started
40+
options: >-
41+
--health-cmd pg_isready
42+
--health-interval 10s
43+
--health-timeout 5s
44+
--health-retries 5
45+
# Maps tcp port 5432 on service container to the host
46+
ports:
47+
- 5432:5432
48+
env:
49+
SENTRY_PYTHON_TEST_POSTGRES_HOST: localhost
50+
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
51+
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
52+
steps:
53+
- uses: actions/[email protected]
54+
- uses: actions/setup-python@v5
55+
with:
56+
python-version: ${{ matrix.python-version }}
57+
allow-prereleases: true
58+
- name: "Setup ClickHouse Server"
59+
uses: getsentry/[email protected]
60+
- name: Setup Test Env
61+
run: |
62+
pip install "coverage[toml]" tox
63+
- name: Erase coverage
64+
run: |
65+
coverage erase
66+
- name: Test asyncpg latest
67+
run: |
68+
set -x # print commands that are executed
69+
./scripts/runtox.sh "py${{ matrix.python-version }}-asyncpg-latest"
70+
- name: Test clickhouse_driver latest
71+
run: |
72+
set -x # print commands that are executed
73+
./scripts/runtox.sh "py${{ matrix.python-version }}-clickhouse_driver-latest"
74+
- name: Test pymongo latest
75+
run: |
76+
set -x # print commands that are executed
77+
./scripts/runtox.sh "py${{ matrix.python-version }}-pymongo-latest"
78+
- name: Test redis latest
79+
run: |
80+
set -x # print commands that are executed
81+
./scripts/runtox.sh "py${{ matrix.python-version }}-redis-latest"
82+
- name: Test redis_py_cluster_legacy latest
83+
run: |
84+
set -x # print commands that are executed
85+
./scripts/runtox.sh "py${{ matrix.python-version }}-redis_py_cluster_legacy-latest"
86+
- name: Test sqlalchemy latest
87+
run: |
88+
set -x # print commands that are executed
89+
./scripts/runtox.sh "py${{ matrix.python-version }}-sqlalchemy-latest"
90+
- name: Generate coverage XML
91+
if: ${{ !cancelled() }}
92+
run: |
93+
coverage combine .coverage-sentry-*
94+
coverage xml
95+
- name: Upload coverage to Codecov
96+
if: ${{ !cancelled() }}
97+
uses: codecov/[email protected]
98+
with:
99+
token: ${{ secrets.CODECOV_TOKEN }}
100+
files: coverage.xml
101+
# make sure no plugins alter our coverage reports
102+
plugin: noop
103+
verbose: true
104+
- name: Upload test results to Codecov
105+
if: ${{ !cancelled() }}
106+
uses: codecov/test-results-action@v1
107+
with:
108+
token: ${{ secrets.CODECOV_TOKEN }}
109+
files: .junitxml
110+
verbose: true
111+
test-dbs-pinned:
112+
name: DBs (pinned)
113+
timeout-minutes: 30
114+
runs-on: ${{ matrix.os }}
115+
strategy:
116+
fail-fast: false
117+
matrix:
118+
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12","3.13"]
119+
os: [ubuntu-22.04]
120+
services:
121+
postgres:
122+
image: postgres
123+
env:
124+
POSTGRES_PASSWORD: sentry
125+
# Set health checks to wait until postgres has started
126+
options: >-
127+
--health-cmd pg_isready
128+
--health-interval 10s
129+
--health-timeout 5s
130+
--health-retries 5
131+
# Maps tcp port 5432 on service container to the host
132+
ports:
133+
- 5432:5432
134+
env:
135+
SENTRY_PYTHON_TEST_POSTGRES_HOST: localhost
136+
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
137+
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
138+
steps:
139+
- uses: actions/[email protected]
140+
- uses: actions/setup-python@v5
141+
with:
142+
python-version: ${{ matrix.python-version }}
143+
allow-prereleases: true
144+
- name: "Setup ClickHouse Server"
145+
uses: getsentry/[email protected]
146+
- name: Setup Test Env
147+
run: |
148+
pip install "coverage[toml]" tox
149+
- name: Erase coverage
150+
run: |
151+
coverage erase
152+
- name: Test asyncpg pinned
153+
run: |
154+
set -x # print commands that are executed
155+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-asyncpg"
156+
- name: Test clickhouse_driver pinned
157+
run: |
158+
set -x # print commands that are executed
159+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-clickhouse_driver"
160+
- name: Test pymongo pinned
161+
run: |
162+
set -x # print commands that are executed
163+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-pymongo"
164+
- name: Test redis pinned
165+
run: |
166+
set -x # print commands that are executed
167+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-redis"
168+
- name: Test redis_py_cluster_legacy pinned
169+
run: |
170+
set -x # print commands that are executed
171+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-redis_py_cluster_legacy"
172+
- name: Test sqlalchemy pinned
173+
run: |
174+
set -x # print commands that are executed
175+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-sqlalchemy"
176+
- name: Generate coverage XML
177+
if: ${{ !cancelled() }}
178+
run: |
179+
coverage combine .coverage-sentry-*
180+
coverage xml
181+
- name: Upload coverage to Codecov
182+
if: ${{ !cancelled() }}
183+
uses: codecov/[email protected]
184+
with:
185+
token: ${{ secrets.CODECOV_TOKEN }}
186+
files: coverage.xml
187+
# make sure no plugins alter our coverage reports
188+
plugin: noop
189+
verbose: true
190+
- name: Upload test results to Codecov
191+
if: ${{ !cancelled() }}
192+
uses: codecov/test-results-action@v1
193+
with:
194+
token: ${{ secrets.CODECOV_TOKEN }}
195+
files: .junitxml
196+
verbose: true
197+
check_required_tests:
198+
name: All pinned DBs tests passed
199+
needs: test-dbs-pinned
200+
# Always run this, even if a dependent job failed
201+
if: always()
202+
runs-on: ubuntu-22.04
35203
steps:
36204
- name: Check for failures
37205
if: contains(needs.test-dbs-pinned.result, 'failure') || contains(needs.test-dbs-pinned.result, 'skipped')

0 commit comments

Comments
 (0)