Skip to content

Commit 710f3c4

Browse files
tests(gevent): Add workflow to test gevent (#1870)
* tests(gevent): Add workflow to test gevent --------- Co-authored-by: Anton Pirker <[email protected]>
1 parent 426b805 commit 710f3c4

File tree

5 files changed

+90
-20
lines changed

5 files changed

+90
-20
lines changed

.github/workflows/test-common.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,6 @@ jobs:
3030
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
3131
os: [ubuntu-20.04]
3232
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
33-
services:
34-
postgres:
35-
image: postgres
36-
env:
37-
POSTGRES_PASSWORD: sentry
38-
# Set health checks to wait until postgres has started
39-
options: >-
40-
--health-cmd pg_isready
41-
--health-interval 10s
42-
--health-timeout 5s
43-
--health-retries 5
44-
# Maps tcp port 5432 on service container to the host
45-
ports:
46-
- 5432:5432
47-
env:
48-
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
49-
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
50-
SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test
5133
steps:
5234
- uses: actions/checkout@v3
5335
- uses: actions/setup-python@v4
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Test gevent
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- release/**
8+
9+
pull_request:
10+
11+
# Cancel in progress workflows on pull_requests.
12+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
permissions:
18+
contents: read
19+
20+
env:
21+
BUILD_CACHE_KEY: ${{ github.sha }}
22+
CACHED_BUILD_PATHS: |
23+
${{ github.workspace }}/dist-serverless
24+
25+
jobs:
26+
test:
27+
name: gevent, python ${{ matrix.python-version }}, ${{ matrix.os }}
28+
runs-on: ${{ matrix.os }}
29+
timeout-minutes: 45
30+
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
python-version: ["2.7","3.6","3.7","3.8","3.9","3.10","3.11"]
35+
# python3.6 reached EOL and is no longer being supported on
36+
# new versions of hosted runners on Github Actions
37+
# ubuntu-20.04 is the last version that supported python3.6
38+
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
39+
os: [ubuntu-20.04]
40+
41+
steps:
42+
- uses: actions/checkout@v3
43+
- uses: actions/setup-python@v4
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
47+
- name: Setup Test Env
48+
run: |
49+
pip install codecov "tox>=3,<4"
50+
51+
- name: Test gevent
52+
timeout-minutes: 45
53+
shell: bash
54+
run: |
55+
set -x # print commands that are executed
56+
coverage erase
57+
58+
./scripts/runtox.sh "${{ matrix.python-version }}-gevent" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch
59+
coverage combine .coverage*
60+
coverage xml -i
61+
codecov --file coverage.xml
62+
63+
check_required_tests:
64+
name: All gevent tests passed or skipped
65+
needs: test
66+
# Always run this, even if a dependent job failed
67+
if: always()
68+
runs-on: ubuntu-20.04
69+
steps:
70+
- name: Check for failures
71+
if: contains(needs.test.result, 'failure')
72+
run: |
73+
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1

scripts/runtox.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ fi
1616
searchstring="$1"
1717

1818
export TOX_PARALLEL_NO_SPINNER=1
19-
exec $TOXPATH -p auto -e "$($TOXPATH -l | grep "$searchstring" | tr $'\n' ',')" -- "${@:2}"
19+
exec $TOXPATH -vv -p auto -e "$($TOXPATH -l | grep "$searchstring" | tr $'\n' ',')" -- "${@:2}"

scripts/split-tox-gh-actions/split-tox-gh-actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def main(fail_on_changes):
108108

109109
python_versions = defaultdict(list)
110110

111-
print("Parse tox.ini nevlist")
111+
print("Parse tox.ini envlist")
112112

113113
for line in lines:
114114
# normalize lines

tox.ini

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ envlist =
7575
{py2.7,py3.5,py3.6,py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1.1}
7676
{py3.6,py3.8,py3.9,py3.10,py3.11}-flask-v{2.0}
7777

78+
# Gevent
79+
{py2.7,py3.6,py3.7,py3.8,py3.9,py3.10,py3.11}-gevent
80+
7881
# GCP
7982
{py3.7}-gcp
8083

@@ -157,6 +160,16 @@ deps =
157160

158161
linters: -r linter-requirements.txt
159162

163+
# Gevent
164+
# See http://www.gevent.org/install.html#older-versions-of-python
165+
# for justification of the versions pinned below
166+
py3.4-gevent: gevent==1.4.0
167+
py3.5-gevent: gevent==20.9.0
168+
# See https://stackoverflow.com/questions/51496550/runtime-warning-greenlet-greenlet-size-changed
169+
# for justification why greenlet is pinned here
170+
py3.5-gevent: greenlet==0.4.17
171+
{py2.7,py3.6,py3.7,py3.8,py3.9,py3.10,py3.11}-gevent: gevent>=22.10.0, <22.11.0
172+
160173
# AIOHTTP
161174
aiohttp-v3.4: aiohttp>=3.4.0,<3.5.0
162175
aiohttp-v3.5: aiohttp>=3.5.0,<3.6.0
@@ -398,6 +411,8 @@ setenv =
398411
falcon: TESTPATH=tests/integrations/falcon
399412
fastapi: TESTPATH=tests/integrations/fastapi
400413
flask: TESTPATH=tests/integrations/flask
414+
# run all tests with gevent
415+
gevent: TESTPATH=tests
401416
gcp: TESTPATH=tests/integrations/gcp
402417
httpx: TESTPATH=tests/integrations/httpx
403418
huey: TESTPATH=tests/integrations/huey

0 commit comments

Comments
 (0)