@@ -56,19 +56,18 @@ jobs:
5656 pip install -r dev_requirements.txt
5757 invoke linters
5858
59- resp2-tests :
59+ standalone :
6060 runs-on : ubuntu-latest
6161 timeout-minutes : 60
6262 strategy :
6363 max-parallel : 15
6464 fail-fast : false
6565 matrix :
66- python-version : ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8', 'pypy-3.9']
67- test-type : ['standalone', 'cluster']
66+ python-version : [ '3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8', 'pypy-3.9' ]
6867 connection-type : ['hiredis', 'plain']
6968 env :
7069 ACTIONS_ALLOW_UNSECURE_COMMANDS : true
71- name : RESP2 ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}}
70+ name : Standalone- ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}}
7271 steps :
7372 - uses : actions/checkout@v4
7473
@@ -77,25 +76,39 @@ jobs:
7776 python-version : ${{ matrix.python-version }}
7877 cache : ' pip'
7978
80- - name : Run tests
79+ - name : Build infrastructure
8180 run : |
81+ pip install coverage
8282 pip install -U setuptools wheel
8383 pip install -r requirements.txt
8484 pip install -r dev_requirements.txt
8585 if [ "${{matrix.connection-type}}" == "hiredis" ]; then
8686 pip install hiredis
8787 fi
88+ mkdir coverage
8889 invoke devenv
8990 sleep 10 # time to settle
90- invoke ${{matrix.test-type}}-tests
91+
92+ - name : Run RESP2 tests
93+ run : |
94+ invoke standalone-tests
9195 ls -1
9296
97+ - name : Run RESP3 tests
98+ if : ${{matrix.python-version == '3.8' || matrix.python-version == '3.12'}}
99+ run : |
100+ invoke standalone-tests --uvloop --protocol=3
101+ invoke standalone-tests --protocol=3
102+
103+ - name : Combine test coverage
104+ run : coverage combine combined-coverage.xml coverage/
105+
93106 - name : Upload test results and profiling data
94107 uses : actions/upload-artifact@v4
95108 with :
96- name : pytest-results-${{matrix.test-type}} -${{matrix.connection-type}}-${{matrix.python-version}}
109+ name : pytest-results-standalone -${{matrix.connection-type}}-${{matrix.python-version}}
97110 path : |
98- ${{matrix.test-type}}*-results .xml
111+ combined-coverage .xml
99112 prof/**
100113 profile_output*
101114 if-no-files-found : error
@@ -106,21 +119,18 @@ jobs:
106119 with :
107120 fail_ci_if_error : false
108121
109- resp3-tests :
122+ cluster :
110123 runs-on : ubuntu-latest
124+ timeout-minutes : 60
111125 strategy :
126+ max-parallel : 15
112127 fail-fast : false
113128 matrix :
114- python-version : ['3.8', '3.12']
115- test-type : ['standalone', 'cluster']
129+ python-version : [ '3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8', 'pypy-3.9' ]
116130 connection-type : ['hiredis', 'plain']
117- event-loop : ['asyncio', 'uvloop']
118- exclude :
119- - test-type : ' cluster'
120- connection-type : ' hiredis'
121131 env :
122132 ACTIONS_ALLOW_UNSECURE_COMMANDS : true
123- name : RESP3 ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.event-loop }}
133+ name : Cluster- ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}}
124134 steps :
125135 - uses : actions/checkout@v4
126136
@@ -129,28 +139,39 @@ jobs:
129139 python-version : ${{ matrix.python-version }}
130140 cache : ' pip'
131141
132- - name : Run tests
142+ - name : Build infrastructure
133143 run : |
144+ pip install coverage
134145 pip install -U setuptools wheel
135146 pip install -r requirements.txt
136147 pip install -r dev_requirements.txt
137148 if [ "${{matrix.connection-type}}" == "hiredis" ]; then
138- pip install hiredis
149+ pip install hiredis
139150 fi
140- invoke devenv
151+ mkdir coverage
152+ invoke devenv-cluster
141153 sleep 10 # time to settle
142- if [ "${{matrix.event-loop}}" == "uvloop" ]; then
143- invoke ${{matrix.test-type}}-tests --uvloop --protocol=3
144- else
145- invoke ${{matrix.test-type}}-tests --protocol=3
146- fi
154+
155+ - name : Run RESP2 tests
156+ run : |
157+ invoke cluster-tests
158+ ls -1
159+
160+ - name : Run RESP3 tests
161+ if : ${{matrix.python-version == '3.8' || matrix.python-version == '3.12'}}
162+ run : |
163+ invoke cluster-tests --uvloop --protocol=3
164+ invoke cluster-tests --protocol=3
165+
166+ - name : Combine test coverage
167+ run : coverage combine combined-coverage.xml coverage/
147168
148169 - name : Upload test results and profiling data
149170 uses : actions/upload-artifact@v4
150171 with :
151- name : pytest-results-${{matrix.test-type}}- ${{matrix.connection-type}}-${{matrix.python-version}}-${{matrix.event-loop}}-resp3
172+ name : pytest-results-cluster- ${{matrix.connection-type}}-${{matrix.python-version}}
152173 path : |
153- ${{matrix.test-type}}*-results .xml
174+ combined-coverage .xml
154175 prof/**
155176 profile_output*
156177 if-no-files-found : error
0 commit comments