Skip to content

Commit 0ea5dfc

Browse files
committed
Add compatibility for Redis < 7
1 parent 75cf787 commit 0ea5dfc

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ runs:
4242
pip install -r dev_requirements.txt
4343
if [ "${{inputs.parser-backend}}" == "hiredis" ]; then
4444
pip install hiredis${{inputs.hiredis-version}}
45-
echo "PARSER_BACKEND=${{inputs.parser-backend}}_${"${{inputs.hiredis-version}}"//[^a-zA-Z0-9]/_}" >> $GITHUB_ENV
45+
echo "PARSER_BACKEND=$(echo "${{inputs.parser-backend}}_${{inputs.hiredis-version}}" | sed 's/[^a-zA-Z0-9]/_/g') >> $GITHUB_ENV
4646
else
4747
echo "PARSER_BACKEND=${{inputs.parser-backend}}" >> $GITHUB_ENV
4848
fi
@@ -68,6 +68,12 @@ runs:
6868
echo "Version not found in the mapping."
6969
exit 1
7070
fi
71+
72+
if (( redis_major_version < 6 )); then
73+
export REDIS_STACK_EXTRA_ARGS="--save ''"
74+
export REDIS_EXTRA_ARGS="--save ''"
75+
fi
76+
7177
invoke devenv --endpoints=all-stack
7278
else
7379
echo "Using redis CE for module tests"

.github/workflows/integration.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
max-parallel: 15
7575
fail-fast: false
7676
matrix:
77-
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}' ] #, '8.0-M01', '7.2.6', '6.2.16']
77+
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}', '7.2.6', '6.2.16']
7878
python-version: ['3.8', '3.12']
7979
parser-backend: ['plain']
8080
event-loop: ['asyncio']
@@ -99,7 +99,7 @@ jobs:
9999
fail-fast: false
100100
matrix:
101101
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}' ]
102-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.9', 'pypy-3.10']
102+
python-version: ['3.9', '3.10', '3.11', 'pypy-3.9', 'pypy-3.10']
103103
parser-backend: [ 'plain' ]
104104
event-loop: [ 'asyncio' ]
105105
env:

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
- REDIS_CLUSTER=no
1111
- PORT=6379
1212
- TLS_PORT=6666
13-
command: --enable-debug-command yes --tls-auth-clients optional --save ""
13+
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --save ""}
1414
ports:
1515
- 6379:6379
1616
- 6666:6666 # TLS port
@@ -46,7 +46,7 @@ services:
4646
- TLS_ENABLED=yes
4747
- PORT=16379
4848
- TLS_PORT=27379
49-
command: --enable-debug-command yes --tls-auth-clients optional --save ""
49+
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --save ""}
5050
ports:
5151
- "16379-16384:16379-16384"
5252
- "27379-27384:27379-27384"
@@ -108,7 +108,7 @@ services:
108108
ports:
109109
- 6479:6379
110110
environment:
111-
- "REDIS_ARGS=--enable-debug-command yes --enable-module-command yes --save ''"
111+
- "REDIS_ARGS=${REDIS_STACK_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --save ''}"
112112
profiles:
113113
- standalone
114114
- all-stack

0 commit comments

Comments
 (0)