Skip to content

Commit 3b3b47f

Browse files
committed
Reorganizing the pipeline actions + some multiprocessing cleaup logic
1 parent 82a6f27 commit 3b3b47f

File tree

2 files changed

+78
-6
lines changed

2 files changed

+78
-6
lines changed

.github/workflows/integration.yaml

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,31 @@ env:
3333
CURRENT_REDIS_VERSION: '8.2'
3434

3535
jobs:
36+
dependency-audit:
37+
name: Dependency audit
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v5
41+
- uses: pypa/[email protected]
42+
with:
43+
inputs: dev_requirements.txt
44+
ignore-vulns: |
45+
GHSA-w596-4wvx-j9j6 # subversion related git pull, dependency for pytest. There is no impact here.
46+
47+
lint:
48+
name: Code linters
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v5
52+
- uses: actions/setup-python@v6
53+
with:
54+
python-version: 3.9
55+
cache: 'pip'
56+
- name: run code linters
57+
run: |
58+
pip install -r dev_requirements.txt
59+
pip uninstall -y redis # uninstall Redis package installed via redis-entraid
60+
invoke linters
3661
3762
redis_version:
3863
runs-on: ubuntu-latest
@@ -51,8 +76,8 @@ jobs:
5176
max-parallel: 15
5277
fail-fast: false
5378
matrix:
54-
redis-version: ['${{ needs.redis_version.outputs.CURRENT }}']
55-
python-version: ['3.9']
79+
redis-version: ['8.4-M01-pre', '${{ needs.redis_version.outputs.CURRENT }}', '8.0.2' ,'7.4.4', '7.2.9']
80+
python-version: ['3.9', '3.13']
5681
parser-backend: ['plain']
5782
event-loop: ['asyncio']
5883
env:
@@ -76,7 +101,7 @@ jobs:
76101
fail-fast: false
77102
matrix:
78103
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}' ]
79-
python-version: ['pypy-3.9', 'pypy-3.10']
104+
python-version: ['3.10', '3.11', '3.12', 'pypy-3.9', 'pypy-3.10']
80105
parser-backend: [ 'plain' ]
81106
event-loop: [ 'asyncio' ]
82107
env:
@@ -91,6 +116,32 @@ jobs:
91116
parser-backend: ${{ matrix.parser-backend }}
92117
redis-version: ${{ matrix.redis-version }}
93118

119+
hiredis-tests:
120+
runs-on: ubuntu-latest
121+
needs: [redis_version]
122+
timeout-minutes: 60
123+
strategy:
124+
max-parallel: 15
125+
fail-fast: false
126+
matrix:
127+
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}' ]
128+
python-version: [ '3.9', '3.13']
129+
parser-backend: [ 'hiredis' ]
130+
hiredis-version: [ '>=3.2.0', '<3.0.0' ]
131+
event-loop: [ 'asyncio' ]
132+
env:
133+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
134+
name: Redis ${{ matrix.redis-version }}; Python ${{ matrix.python-version }}; RESP Parser:${{matrix.parser-backend}} (${{ matrix.hiredis-version }}); EL:${{matrix.event-loop}}
135+
steps:
136+
- uses: actions/checkout@v5
137+
- name: Run tests
138+
uses: ./.github/actions/run-tests
139+
with:
140+
python-version: ${{ matrix.python-version }}
141+
parser-backend: ${{ matrix.parser-backend }}
142+
redis-version: ${{ matrix.redis-version }}
143+
hiredis-version: ${{ matrix.hiredis-version }}
144+
94145
uvloop-tests:
95146
runs-on: ubuntu-latest
96147
needs: [redis_version]
@@ -100,7 +151,7 @@ jobs:
100151
fail-fast: false
101152
matrix:
102153
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}' ]
103-
python-version: [ '3.9']
154+
python-version: [ '3.9', '3.13' ]
104155
parser-backend: [ 'plain' ]
105156
event-loop: [ 'uvloop' ]
106157
env:
@@ -116,14 +167,33 @@ jobs:
116167
redis-version: ${{ matrix.redis-version }}
117168
event-loop: ${{ matrix.event-loop }}
118169

170+
build-and-test-package:
171+
name: Validate building and installing the package
172+
runs-on: ubuntu-latest
173+
needs: [tests]
174+
strategy:
175+
fail-fast: false
176+
matrix:
177+
extension: ['tar.gz', 'whl']
178+
steps:
179+
- uses: actions/checkout@v5
180+
- uses: actions/setup-python@v6
181+
with:
182+
python-version: 3.9
183+
- name: Run installed unit tests
184+
env:
185+
CLIENT_LIBS_TEST_IMAGE_TAG: ${{ env.CURRENT_REDIS_VERSION }}
186+
CLIENT_LIBS_TEST_STACK_IMAGE_TAG: ${{ env.CURRENT_CLIENT_LIBS_TEST_STACK_IMAGE_TAG }}
187+
run: |
188+
bash .github/workflows/install_and_test.sh ${{ matrix.extension }}
119189
120190
install-package-from-commit:
121191
name: Install package from commit hash
122192
runs-on: ubuntu-latest
123193
strategy:
124194
fail-fast: false
125195
matrix:
126-
python-version: ['3.9', 'pypy-3.9', 'pypy-3.10']
196+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10']
127197
steps:
128198
- uses: actions/checkout@v5
129199
- uses: actions/setup-python@v6

tests/test_multidb/test_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def test_execute_command_against_correct_db_on_successful_initialization(
5454
assert mock_db1.circuit.state == CBState.CLOSED
5555
assert mock_db2.circuit.state == CBState.CLOSED
5656

57+
# @pytest.mark.repeat(600)
5758
@pytest.mark.parametrize(
5859
"mock_multi_db_config,mock_db, mock_db1, mock_db2",
5960
[
@@ -91,7 +92,8 @@ def test_execute_command_against_correct_db_and_closed_circuit(
9192

9293
client = MultiDBClient(mock_multi_db_config)
9394
assert mock_multi_db_config.failover_strategy.set_databases.call_count == 1
94-
assert client.set("key", "value") == "OK1"
95+
result = client.set("key", "value")
96+
assert result == "OK1"
9597
assert mock_hc.check_health.call_count == 7
9698

9799
assert mock_db.circuit.state == CBState.CLOSED

0 commit comments

Comments
 (0)