Skip to content

Commit c53ef82

Browse files
committed
Reorg test matrix
1 parent f6db042 commit c53ef82

File tree

2 files changed

+69
-24
lines changed

2 files changed

+69
-24
lines changed

.github/actions/run-tests/action.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ inputs:
1010
parser-backend:
1111
description: 'Parser backend to use: plain or hiredis'
1212
required: true
13-
resp-protocol:
14-
description: 'RESP protocol version to use: 2 or 3'
15-
required: true
1613
redis-version:
1714
description: 'Redis version to test against'
1815
required: true
@@ -34,7 +31,7 @@ runs:
3431
python-version: ${{ inputs.python-version }}
3532
cache: 'pip'
3633

37-
- name: Run tests
34+
- name: Setup Test environment
3835
run: |
3936
pip install -U setuptools wheel
4037
pip install -r requirements.txt
@@ -43,21 +40,32 @@ runs:
4340
pip install hiredis${{inputs.hiredis-version}}
4441
fi
4542
invoke devenv
46-
sleep 10 # time to settle
47-
43+
sleep 10 # time to settle
44+
shell: bash
45+
46+
- name: Run RESP2 tests
47+
run: |
4848
if [ "${{inputs.event-loop}}" == "uvloop" ]; then
49-
invoke ${{inputs.test-type}}-tests --uvloop --protocol=${{inputs.resp-protocol}}
49+
invoke ${{inputs.test-type}}-tests --uvloop --protocol=2
5050
else
51-
invoke ${{inputs.test-type}}-tests --protocol=${{inputs.resp-protocol}}
51+
invoke ${{inputs.test-type}}-tests --protocol=2
5252
fi
53+
shell: bash
5354

54-
ls -1
55+
- name: Run RESP3 tests
56+
if: ${{ inputs.test-type != 'cluster' && inputs.parser-backend != 'hiredis' }}
57+
run: |
58+
if [ "${{inputs.event-loop}}" == "uvloop" ]; then
59+
invoke ${{inputs.test-type}}-tests --uvloop --protocol=3
60+
else
61+
invoke ${{inputs.test-type}}-tests --protocol=3
62+
fi
5563
shell: bash
5664

5765
- name: Upload test results and profiling data
5866
uses: actions/upload-artifact@v4
5967
with:
60-
name: pytest-results-${{inputs.test-type}}-${{inputs.parser-backend}}-${{inputs.python-version}}-${{inputs.event-loop}}-${{inputs.resp-protocol}}
68+
name: pytest-results-${{inputs.redis-version}}-${{inputs.test-type}}-${{inputs.parser-backend}}-${{inputs.python-version}}-${{inputs.event-loop}}
6169
path: |
6270
${{inputs.test-type}}*-results.xml
6371
prof/**

.github/workflows/integration.yaml

Lines changed: 51 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,10 @@ jobs:
6464
fail-fast: false
6565
matrix:
6666
redis-version: ['8.0.0-M01']
67-
resp-protocol: ['2', '3']
6867
test-type: ['standalone', 'cluster']
6968
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.9', 'pypy-3.10']
70-
parser-backend: ['hiredis', 'plain']
69+
parser-backend: ['plain']
7170
event-loop: ['asyncio']
72-
include:
73-
# Run uvloop tests only for resp3
74-
- resp-protocol: '3'
75-
parser-backend: 'plain'
76-
redis-version: '8.0.0-M01'
77-
event-loop: 'uvloop'
78-
exclude:
79-
- test-type: 'cluster'
80-
parser-backend: 'hiredis'
81-
resp-protocol: '3'
8271
env:
8372
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
8473
name: Redis ${{ matrix.redis-version }} - RESP${{ matrix.resp-protocol }} ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.parser-backend}}-${{matrix.event-loop}}
@@ -90,20 +79,68 @@ jobs:
9079
python-version: ${{ matrix.python-version }}
9180
test-type: ${{ matrix.test-type }}
9281
parser-backend: ${{ matrix.parser-backend }}
93-
resp-protocol: ${{ matrix.resp-protocol }}
9482
redis-version: ${{ matrix.redis-version }}
9583

84+
hiredis-tests:
85+
runs-on: ubuntu-latest
86+
timeout-minutes: 60
87+
strategy:
88+
max-parallel: 15
89+
fail-fast: false
90+
matrix:
91+
redis-version: [ '8.0.0-M01' ]
92+
test-type: [ 'standalone', 'cluster' ]
93+
python-version: [ '3.8', '3.12']
94+
parser-backend: [ 'hiredis' ]
95+
event-loop: [ 'asyncio' ]
96+
env:
97+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
98+
name: Redis ${{ matrix.redis-version }} - RESP${{ matrix.resp-protocol }} ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.parser-backend}}-${{matrix.event-loop}}
99+
steps:
100+
- uses: actions/checkout@v4
101+
- name: Run tests
102+
uses: ./.github/actions/run-tests
103+
with:
104+
python-version: ${{ matrix.python-version }}
105+
test-type: ${{ matrix.test-type }}
106+
parser-backend: ${{ matrix.parser-backend }}
107+
redis-version: ${{ matrix.redis-version }}
108+
96109
- name: Run tests against hiredis < 3.0.0
97110
uses: ./.github/actions/run-tests
98111
if: ${{ matrix.parser-backend == 'hiredis' && matrix.python-version == '3.12'}}
99112
with:
100113
python-version: ${{ matrix.python-version }}
101114
test-type: ${{ matrix.test-type }}
102115
parser-backend: ${{ matrix.parser-backend }}
103-
resp-protocol: ${{ matrix.resp-protocol }}
104116
redis-version: ${{ matrix.redis-version }}
105117
hiredis-version: '<3.0.0'
106118

119+
uvloop-tests:
120+
runs-on: ubuntu-latest
121+
timeout-minutes: 60
122+
strategy:
123+
max-parallel: 15
124+
fail-fast: false
125+
matrix:
126+
redis-version: [ '8.0.0-M01' ]
127+
test-type: [ 'standalone', 'cluster' ]
128+
python-version: [ '3.8', '3.12' ]
129+
parser-backend: [ 'plain' ]
130+
event-loop: [ 'uvloop' ]
131+
env:
132+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
133+
name: Redis ${{ matrix.redis-version }} - RESP${{ matrix.resp-protocol }} ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.parser-backend}}-${{matrix.event-loop}}
134+
steps:
135+
- uses: actions/checkout@v4
136+
- name: Run tests
137+
uses: ./.github/actions/run-tests
138+
with:
139+
python-version: ${{ matrix.python-version }}
140+
test-type: ${{ matrix.test-type }}
141+
parser-backend: ${{ matrix.parser-backend }}
142+
redis-version: ${{ matrix.redis-version }}
143+
107144
build-and-test-package:
108145
name: Validate building and installing the package
109146
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)