Skip to content

Commit ecd8e25

Browse files
committed
tests: Move redis under toxgen (#4824)
Moved redis under toxgen, effectively moving the whole DBs group away from the old system. Ref #4506 - Please add tests to validate your changes, and lint your code using `tox -e linters`. - Add GH Issue ID _&_ Linear ID (if applicable) - PR title should use [conventional commit](https://develop.sentry.dev/engineering-practices/commit-messages/#type) style (`feat:`, `fix:`, `ref:`, `meta:`) - For external contributors: [CONTRIBUTING.md](https://github.com/getsentry/sentry-python/blob/master/CONTRIBUTING.md), [Sentry SDK development docs](https://develop.sentry.dev/sdk/), [Discord community](https://discord.gg/Ww9hbqr)
1 parent 6182935 commit ecd8e25

File tree

5 files changed

+29
-135
lines changed

5 files changed

+29
-135
lines changed

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

Lines changed: 0 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -22,105 +22,6 @@ env:
2222
CACHED_BUILD_PATHS: |
2323
${{ github.workspace }}/dist-serverless
2424
jobs:
25-
test-dbs-latest:
26-
name: DBs (latest)
27-
timeout-minutes: 30
28-
runs-on: ${{ matrix.os }}
29-
strategy:
30-
fail-fast: false
31-
matrix:
32-
python-version: ["3.7","3.12","3.13"]
33-
# python3.6 reached EOL and is no longer being supported on
34-
# new versions of hosted runners on Github Actions
35-
# ubuntu-20.04 is the last version that supported python3.6
36-
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
37-
os: [ubuntu-22.04]
38-
services:
39-
postgres:
40-
image: postgres
41-
env:
42-
POSTGRES_PASSWORD: sentry
43-
# Set health checks to wait until postgres has started
44-
options: >-
45-
--health-cmd pg_isready
46-
--health-interval 10s
47-
--health-timeout 5s
48-
--health-retries 5
49-
# Maps tcp port 5432 on service container to the host
50-
ports:
51-
- 5432:5432
52-
env:
53-
SENTRY_PYTHON_TEST_POSTGRES_HOST: ${{ matrix.python-version == '3.6' && 'postgres' || 'localhost' }}
54-
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
55-
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
56-
# Use Docker container only for Python 3.6
57-
container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }}
58-
steps:
59-
- uses: actions/[email protected]
60-
- uses: actions/setup-python@v6
61-
if: ${{ matrix.python-version != '3.6' }}
62-
with:
63-
python-version: ${{ matrix.python-version }}
64-
allow-prereleases: true
65-
- name: "Setup ClickHouse Server"
66-
uses: getsentry/[email protected]
67-
- name: Setup Test Env
68-
run: |
69-
pip install "coverage[toml]" tox
70-
- name: Erase coverage
71-
run: |
72-
coverage erase
73-
- name: Test asyncpg latest
74-
run: |
75-
set -x # print commands that are executed
76-
./scripts/runtox.sh "py${{ matrix.python-version }}-asyncpg-latest"
77-
- name: Test clickhouse_driver latest
78-
run: |
79-
set -x # print commands that are executed
80-
./scripts/runtox.sh "py${{ matrix.python-version }}-clickhouse_driver-latest"
81-
- name: Test pymongo latest
82-
run: |
83-
set -x # print commands that are executed
84-
./scripts/runtox.sh "py${{ matrix.python-version }}-pymongo-latest"
85-
- name: Test redis latest
86-
run: |
87-
set -x # print commands that are executed
88-
./scripts/runtox.sh "py${{ matrix.python-version }}-redis-latest"
89-
- name: Test redis_py_cluster_legacy latest
90-
run: |
91-
set -x # print commands that are executed
92-
./scripts/runtox.sh "py${{ matrix.python-version }}-redis_py_cluster_legacy-latest"
93-
- name: Test sqlalchemy latest
94-
run: |
95-
set -x # print commands that are executed
96-
./scripts/runtox.sh "py${{ matrix.python-version }}-sqlalchemy-latest"
97-
- name: Generate coverage XML (Python 3.6)
98-
if: ${{ !cancelled() && matrix.python-version == '3.6' }}
99-
run: |
100-
export COVERAGE_RCFILE=.coveragerc36
101-
coverage combine .coverage-sentry-*
102-
coverage xml --ignore-errors
103-
- name: Generate coverage XML
104-
if: ${{ !cancelled() && matrix.python-version != '3.6' }}
105-
run: |
106-
coverage combine .coverage-sentry-*
107-
coverage xml
108-
- name: Upload coverage to Codecov
109-
if: ${{ !cancelled() }}
110-
uses: codecov/[email protected]
111-
with:
112-
token: ${{ secrets.CODECOV_TOKEN }}
113-
files: coverage.xml
114-
# make sure no plugins alter our coverage reports
115-
plugins: noop
116-
verbose: true
117-
- name: Upload test results to Codecov
118-
if: ${{ !cancelled() }}
119-
uses: codecov/test-results-action@v1
120-
with:
121-
token: ${{ secrets.CODECOV_TOKEN }}
122-
files: .junitxml
123-
verbose: true
12425
test-dbs-pinned:
12526
name: DBs (pinned)
12627
timeout-minutes: 30

scripts/populate_tox/config.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,15 @@
277277
"python": ">=3.9",
278278
"num_versions": 2,
279279
},
280+
"redis": {
281+
"package": "redis",
282+
"deps": {
283+
"*": ["fakeredis!=1.7.4", "pytest<8.0.0"],
284+
">=4.0,<5.0": ["fakeredis<2.31.0"],
285+
"py3.6,py3.7,py3.8": ["fakeredis<2.26.0"],
286+
"py3.7,py3.8,py3.9,py3.10,py3.11,py3.12,py3.13": ["pytest-asyncio"],
287+
},
288+
},
280289
"redis_py_cluster_legacy": {
281290
"package": "redis-py-cluster",
282291
},

scripts/populate_tox/populate_tox.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
"potel",
7070
# Integrations that can be migrated -- we should eventually remove all
7171
# of these from the IGNORE list
72-
"redis",
7372
"requests",
7473
}
7574

scripts/populate_tox/tox.jinja

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ envlist =
5454
# OpenTelemetry Experimental (POTel)
5555
{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13}-potel
5656

57-
# Redis
58-
{py3.6,py3.8}-redis-v{3}
59-
{py3.7,py3.8,py3.11}-redis-v{4}
60-
{py3.7,py3.11,py3.12}-redis-v{5}
61-
{py3.7,py3.12,py3.13}-redis-latest
62-
6357
# Requests
6458
{py3.6,py3.8,py3.12,py3.13}-requests
6559

@@ -129,17 +123,6 @@ deps =
129123
# OpenTelemetry Experimental (POTel)
130124
potel: -e .[opentelemetry-experimental]
131125
132-
# Redis
133-
redis: fakeredis!=1.7.4
134-
redis: pytest<8.0.0
135-
{py3.6,py3.7,py3.8}-redis: fakeredis<2.26.0
136-
{py3.7,py3.8,py3.9,py3.10,py3.11,py3.12,py3.13}-redis: pytest-asyncio
137-
redis-v3: redis~=3.0
138-
redis-v4: redis~=4.0
139-
redis-v4: fakeredis<2.31.0
140-
redis-v5: redis~=5.0
141-
redis-latest: redis
142-
143126
# Requests
144127
requests: requests>=2.0
145128

tox.ini

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# The file (and all resulting CI YAMLs) then need to be regenerated via
1111
# "scripts/generate-test-files.sh".
1212
#
13-
# Last generated: 2025-09-19T10:37:11.055880+00:00
13+
# Last generated: 2025-09-19T11:34:58.332922+00:00
1414

1515
[tox]
1616
requires =
@@ -54,12 +54,6 @@ envlist =
5454
# OpenTelemetry Experimental (POTel)
5555
{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13}-potel
5656

57-
# Redis
58-
{py3.6,py3.8}-redis-v{3}
59-
{py3.7,py3.8,py3.11}-redis-v{4}
60-
{py3.7,py3.11,py3.12}-redis-v{5}
61-
{py3.7,py3.12,py3.13}-redis-latest
62-
6357
# Requests
6458
{py3.6,py3.8,py3.12,py3.13}-requests
6559

@@ -134,6 +128,13 @@ envlist =
134128
{py3.6,py3.10,py3.11}-pymongo-v3.13.0
135129
{py3.9,py3.12,py3.13}-pymongo-v4.15.1
136130

131+
{py3.6}-redis-v2.10.6
132+
{py3.6,py3.7,py3.8}-redis-v3.5.3
133+
{py3.7,py3.10,py3.11}-redis-v4.6.0
134+
{py3.8,py3.11,py3.12}-redis-v5.3.1
135+
{py3.9,py3.12,py3.13}-redis-v6.4.0
136+
{py3.9,py3.12,py3.13}-redis-v7.0.0b1
137+
137138
{py3.6}-redis_py_cluster_legacy-v1.3.6
138139
{py3.6,py3.7,py3.8}-redis_py_cluster_legacy-v2.1.3
139140

@@ -370,17 +371,6 @@ deps =
370371
# OpenTelemetry Experimental (POTel)
371372
potel: -e .[opentelemetry-experimental]
372373

373-
# Redis
374-
redis: fakeredis!=1.7.4
375-
redis: pytest<8.0.0
376-
{py3.6,py3.7,py3.8}-redis: fakeredis<2.26.0
377-
{py3.7,py3.8,py3.9,py3.10,py3.11,py3.12,py3.13}-redis: pytest-asyncio
378-
redis-v3: redis~=3.0
379-
redis-v4: redis~=4.0
380-
redis-v4: fakeredis<2.31.0
381-
redis-v5: redis~=5.0
382-
redis-latest: redis
383-
384374
# Requests
385375
requests: requests>=2.0
386376

@@ -478,6 +468,18 @@ deps =
478468
pymongo-v4.15.1: pymongo==4.15.1
479469
pymongo: mockupdb
480470

471+
redis-v2.10.6: redis==2.10.6
472+
redis-v3.5.3: redis==3.5.3
473+
redis-v4.6.0: redis==4.6.0
474+
redis-v5.3.1: redis==5.3.1
475+
redis-v6.4.0: redis==6.4.0
476+
redis-v7.0.0b1: redis==7.0.0b1
477+
redis: fakeredis!=1.7.4
478+
redis: pytest<8.0.0
479+
redis-v4.6.0: fakeredis<2.31.0
480+
{py3.6,py3.7,py3.8}-redis: fakeredis<2.26.0
481+
{py3.7,py3.8,py3.9,py3.10,py3.11,py3.12,py3.13}-redis: pytest-asyncio
482+
481483
redis_py_cluster_legacy-v1.3.6: redis-py-cluster==1.3.6
482484
redis_py_cluster_legacy-v2.1.3: redis-py-cluster==2.1.3
483485

0 commit comments

Comments
 (0)