Skip to content

Commit 6f63bd6

Browse files
committed
Skip module tests when Redis < 7 and RESP3 is enabled
1 parent 1e757be commit 6f63bd6

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ runs:
7272
if (( redis_major_version < 7 )); then
7373
export REDIS_STACK_EXTRA_ARGS="--tls-auth-clients optional --save ''"
7474
export REDIS_EXTRA_ARGS="--tls-auth-clients optional --save ''"
75+
echo "REDIS_MAJOR_VERSION=${redis_major_version}" >> $GITHUB_ENV
7576
fi
7677
7778
invoke devenv --endpoints=all-stack
@@ -99,7 +100,14 @@ runs:
99100

100101
echo "::group::RESP${protocol} standalone tests"
101102
echo "REDIS_MOD_URL=${REDIS_MOD_URL}"
102-
invoke standalone-tests --redis-mod-url=${REDIS_MOD_URL} $eventloop --protocol="${protocol}"
103+
104+
if (( $REDIS_MAJOR_VERSION < 7 )) && [ "$protocol" == "3" ]; then
105+
echo "Skipping module tests: Modules doesn't support RESP3 for Redis versions < 7"
106+
invoke standalone-tests --redis-mod-url=${REDIS_MOD_URL} $eventloop --protocol="${protocol}" --extra-markers="not redismod"
107+
else
108+
invoke standalone-tests --redis-mod-url=${REDIS_MOD_URL} $eventloop --protocol="${protocol}"
109+
fi
110+
103111
echo "::endgroup::"
104112

105113
if [ "$protocol" == "2" ] || [ "${{inputs.parser-backend}}" != 'hiredis' ]; then

tasks.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,21 @@ def tests(c, uvloop=False, protocol=2, profile=False):
5050

5151

5252
@task
53-
def standalone_tests(c, uvloop=False, protocol=2, profile=False, redis_mod_url=None):
53+
def standalone_tests(
54+
c, uvloop=False, protocol=2, profile=False, redis_mod_url=None, extra_markers=""
55+
):
5456
"""Run tests against a standalone redis instance"""
5557
profile_arg = "--profile" if profile else ""
5658
redis_mod_url = f"--redis-mod-url={redis_mod_url}" if redis_mod_url else ""
59+
extra_markers = f" and {extra_markers}" if extra_markers else ""
5760

5861
if uvloop:
5962
run(
60-
f"pytest {profile_arg} --protocol={protocol} {redis_mod_url} --cov=./ --cov-report=xml:coverage_resp{protocol}_uvloop.xml -m 'not onlycluster and not graph' --uvloop --junit-xml=standalone-resp{protocol}-uvloop-results.xml"
63+
f"pytest {profile_arg} --protocol={protocol} {redis_mod_url} --cov=./ --cov-report=xml:coverage_resp{protocol}_uvloop.xml -m 'not onlycluster and not graph{extra_markers}' --uvloop --junit-xml=standalone-resp{protocol}-uvloop-results.xml"
6164
)
6265
else:
6366
run(
64-
f"pytest {profile_arg} --protocol={protocol} {redis_mod_url} --cov=./ --cov-report=xml:coverage_resp{protocol}.xml -m 'not onlycluster and not graph' --junit-xml=standalone-resp{protocol}-results.xml"
67+
f"pytest {profile_arg} --protocol={protocol} {redis_mod_url} --cov=./ --cov-report=xml:coverage_resp{protocol}.xml -m 'not onlycluster and not graph{extra_markers}' --junit-xml=standalone-resp{protocol}-results.xml"
6568
)
6669

6770

0 commit comments

Comments
 (0)