Skip to content

Commit a51132e

Browse files
authored
Bring tests up to date (#2512)
- always test the lowest supported version of a framework - always test the latest version of a framework to catch incompatibilities earlier - if it makes sense for the integration, pinpoint a couple of versions in between to test against (especially if we do something differently in the integration based on the version)
1 parent 4e9d661 commit a51132e

File tree

59 files changed

+2141
-429
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2141
-429
lines changed

.github/workflows/test-common.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
coverage erase
6161
6262
# Run tests
63-
./scripts/runtox.sh "py${{ matrix.python-version }}-common" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
63+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-common" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
6464
coverage combine .coverage* &&
6565
coverage xml -i
6666
@@ -94,10 +94,11 @@ jobs:
9494
coverage erase
9595
9696
# Run tests
97-
./scripts/runtox.sh "py2.7-common" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
97+
./scripts/runtox.sh --exclude-latest "py2.7-common" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
9898
coverage combine .coverage* &&
9999
coverage xml -i
100100
101+
101102
check_required_tests:
102103
name: All common tests passed or skipped
103104
needs: [test, test-py27]

.github/workflows/test-integration-aiohttp.yml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
coverage erase
6161
6262
# Run tests
63-
./scripts/runtox.sh "py${{ matrix.python-version }}-aiohttp" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
63+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-aiohttp" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
6464
coverage combine .coverage* &&
6565
coverage xml -i
6666
@@ -70,6 +70,52 @@ jobs:
7070
files: coverage.xml
7171

7272

73+
test-latest:
74+
name: aiohttp latest, python ${{ matrix.python-version }}, ${{ matrix.os }}
75+
runs-on: ${{ matrix.os }}
76+
timeout-minutes: 30
77+
78+
strategy:
79+
fail-fast: false
80+
matrix:
81+
python-version: ["3.8","3.9","3.10","3.11"]
82+
# python3.6 reached EOL and is no longer being supported on
83+
# new versions of hosted runners on Github Actions
84+
# ubuntu-20.04 is the last version that supported python3.6
85+
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
86+
os: [ubuntu-20.04]
87+
88+
steps:
89+
- uses: actions/checkout@v4
90+
- uses: actions/setup-python@v4
91+
with:
92+
python-version: ${{ matrix.python-version }}
93+
94+
- name: Setup Test Env
95+
run: |
96+
pip install coverage "tox>=3,<4"
97+
98+
- name: Test aiohttp
99+
uses: nick-fields/retry@v2
100+
with:
101+
timeout_minutes: 15
102+
max_attempts: 2
103+
retry_wait_seconds: 5
104+
shell: bash
105+
command: |
106+
set -x # print commands that are executed
107+
coverage erase
108+
109+
# Run tests
110+
./scripts/runtox.sh "py${{ matrix.python-version }}-aiohttp-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
111+
coverage combine .coverage* &&
112+
coverage xml -i
113+
114+
- uses: codecov/codecov-action@v3
115+
with:
116+
token: ${{ secrets.CODECOV_TOKEN }}
117+
files: coverage.xml
118+
73119
check_required_tests:
74120
name: All aiohttp tests passed or skipped
75121
needs: test

.github/workflows/test-integration-ariadne.yml

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.8","3.9","3.10","3.11","3.12"]
34+
python-version: ["3.8","3.9","3.10","3.11"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6
@@ -60,7 +60,7 @@ jobs:
6060
coverage erase
6161
6262
# Run tests
63-
./scripts/runtox.sh "py${{ matrix.python-version }}-ariadne" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
63+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-ariadne" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
6464
coverage combine .coverage* &&
6565
coverage xml -i
6666
@@ -70,6 +70,52 @@ jobs:
7070
files: coverage.xml
7171

7272

73+
test-latest:
74+
name: ariadne latest, python ${{ matrix.python-version }}, ${{ matrix.os }}
75+
runs-on: ${{ matrix.os }}
76+
timeout-minutes: 30
77+
78+
strategy:
79+
fail-fast: false
80+
matrix:
81+
python-version: ["3.8","3.9","3.10","3.11","3.12"]
82+
# python3.6 reached EOL and is no longer being supported on
83+
# new versions of hosted runners on Github Actions
84+
# ubuntu-20.04 is the last version that supported python3.6
85+
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
86+
os: [ubuntu-20.04]
87+
88+
steps:
89+
- uses: actions/checkout@v4
90+
- uses: actions/setup-python@v4
91+
with:
92+
python-version: ${{ matrix.python-version }}
93+
94+
- name: Setup Test Env
95+
run: |
96+
pip install coverage "tox>=3,<4"
97+
98+
- name: Test ariadne
99+
uses: nick-fields/retry@v2
100+
with:
101+
timeout_minutes: 15
102+
max_attempts: 2
103+
retry_wait_seconds: 5
104+
shell: bash
105+
command: |
106+
set -x # print commands that are executed
107+
coverage erase
108+
109+
# Run tests
110+
./scripts/runtox.sh "py${{ matrix.python-version }}-ariadne-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
111+
coverage combine .coverage* &&
112+
coverage xml -i
113+
114+
- uses: codecov/codecov-action@v3
115+
with:
116+
token: ${{ secrets.CODECOV_TOKEN }}
117+
files: coverage.xml
118+
73119
check_required_tests:
74120
name: All ariadne tests passed or skipped
75121
needs: test

.github/workflows/test-integration-arq.yml

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
34+
python-version: ["3.7","3.8","3.9","3.10","3.11"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6
@@ -60,7 +60,7 @@ jobs:
6060
coverage erase
6161
6262
# Run tests
63-
./scripts/runtox.sh "py${{ matrix.python-version }}-arq" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
63+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-arq" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
6464
coverage combine .coverage* &&
6565
coverage xml -i
6666
@@ -70,6 +70,52 @@ jobs:
7070
files: coverage.xml
7171

7272

73+
test-latest:
74+
name: arq latest, python ${{ matrix.python-version }}, ${{ matrix.os }}
75+
runs-on: ${{ matrix.os }}
76+
timeout-minutes: 30
77+
78+
strategy:
79+
fail-fast: false
80+
matrix:
81+
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
82+
# python3.6 reached EOL and is no longer being supported on
83+
# new versions of hosted runners on Github Actions
84+
# ubuntu-20.04 is the last version that supported python3.6
85+
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
86+
os: [ubuntu-20.04]
87+
88+
steps:
89+
- uses: actions/checkout@v4
90+
- uses: actions/setup-python@v4
91+
with:
92+
python-version: ${{ matrix.python-version }}
93+
94+
- name: Setup Test Env
95+
run: |
96+
pip install coverage "tox>=3,<4"
97+
98+
- name: Test arq
99+
uses: nick-fields/retry@v2
100+
with:
101+
timeout_minutes: 15
102+
max_attempts: 2
103+
retry_wait_seconds: 5
104+
shell: bash
105+
command: |
106+
set -x # print commands that are executed
107+
coverage erase
108+
109+
# Run tests
110+
./scripts/runtox.sh "py${{ matrix.python-version }}-arq-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
111+
coverage combine .coverage* &&
112+
coverage xml -i
113+
114+
- uses: codecov/codecov-action@v3
115+
with:
116+
token: ${{ secrets.CODECOV_TOKEN }}
117+
files: coverage.xml
118+
73119
check_required_tests:
74120
name: All arq tests passed or skipped
75121
needs: test

.github/workflows/test-integration-asgi.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
coverage erase
6161
6262
# Run tests
63-
./scripts/runtox.sh "py${{ matrix.python-version }}-asgi" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
63+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-asgi" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
6464
coverage combine .coverage* &&
6565
coverage xml -i
6666
@@ -70,6 +70,7 @@ jobs:
7070
files: coverage.xml
7171

7272

73+
7374
check_required_tests:
7475
name: All asgi tests passed or skipped
7576
needs: test

.github/workflows/test-integration-asyncpg.yml

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python-version: ["3.7","3.8","3.9","3.10","3.11","3.12"]
34+
python-version: ["3.7","3.8","3.9","3.10"]
3535
# python3.6 reached EOL and is no longer being supported on
3636
# new versions of hosted runners on Github Actions
3737
# ubuntu-20.04 is the last version that supported python3.6
@@ -81,7 +81,7 @@ jobs:
8181
coverage erase
8282
8383
# Run tests
84-
./scripts/runtox.sh "py${{ matrix.python-version }}-asyncpg" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
84+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-asyncpg" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
8585
coverage combine .coverage* &&
8686
coverage xml -i
8787
@@ -91,6 +91,73 @@ jobs:
9191
files: coverage.xml
9292

9393

94+
test-latest:
95+
name: asyncpg latest, python ${{ matrix.python-version }}, ${{ matrix.os }}
96+
runs-on: ${{ matrix.os }}
97+
timeout-minutes: 30
98+
99+
strategy:
100+
fail-fast: false
101+
matrix:
102+
python-version: ["3.8","3.9","3.10","3.11","3.12"]
103+
# python3.6 reached EOL and is no longer being supported on
104+
# new versions of hosted runners on Github Actions
105+
# ubuntu-20.04 is the last version that supported python3.6
106+
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
107+
os: [ubuntu-20.04]
108+
services:
109+
postgres:
110+
image: postgres
111+
env:
112+
POSTGRES_PASSWORD: sentry
113+
# Set health checks to wait until postgres has started
114+
options: >-
115+
--health-cmd pg_isready
116+
--health-interval 10s
117+
--health-timeout 5s
118+
--health-retries 5
119+
# Maps tcp port 5432 on service container to the host
120+
ports:
121+
- 5432:5432
122+
env:
123+
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
124+
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
125+
SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test
126+
SENTRY_PYTHON_TEST_POSTGRES_HOST: localhost
127+
128+
steps:
129+
- uses: actions/checkout@v4
130+
- uses: actions/setup-python@v4
131+
with:
132+
python-version: ${{ matrix.python-version }}
133+
134+
- name: Setup Test Env
135+
run: |
136+
pip install coverage "tox>=3,<4"
137+
psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true
138+
psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true
139+
140+
- name: Test asyncpg
141+
uses: nick-fields/retry@v2
142+
with:
143+
timeout_minutes: 15
144+
max_attempts: 2
145+
retry_wait_seconds: 5
146+
shell: bash
147+
command: |
148+
set -x # print commands that are executed
149+
coverage erase
150+
151+
# Run tests
152+
./scripts/runtox.sh "py${{ matrix.python-version }}-asyncpg-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
153+
coverage combine .coverage* &&
154+
coverage xml -i
155+
156+
- uses: codecov/codecov-action@v3
157+
with:
158+
token: ${{ secrets.CODECOV_TOKEN }}
159+
files: coverage.xml
160+
94161
check_required_tests:
95162
name: All asyncpg tests passed or skipped
96163
needs: test

.github/workflows/test-integration-aws_lambda.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
coverage erase
6363
6464
# Run tests
65-
./scripts/runtox.sh "py${{ matrix.python-version }}-aws_lambda" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
65+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-aws_lambda" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
6666
coverage combine .coverage* &&
6767
coverage xml -i
6868
@@ -72,6 +72,7 @@ jobs:
7272
files: coverage.xml
7373

7474

75+
7576
check_required_tests:
7677
name: All aws_lambda tests passed or skipped
7778
needs: test

0 commit comments

Comments
 (0)