Skip to content

Commit 116eb6e

Browse files
committed
Added redis_mod_url arg
1 parent e3246b5 commit 116eb6e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ runs:
8282
invoke devenv --endpoints all
8383
fi
8484
85+
echo "REDIS_CLUSTER_URL="redis://localhost:16379" >> $GITHUB_ENV
86+
8587
sleep 10 # time to settle
8688
echo "::endgroup::"
8789
shell: bash
@@ -100,6 +102,7 @@ runs:
100102

101103
echo "::group::RESP${protocol} standalone tests"
102104
echo "REDIS_MOD_URL=${REDIS_MOD_URL}"
105+
echo "REDIS_CLUSTER_URL=${REDIS_CLUSTER_URL}"
103106

104107
if (( $REDIS_MAJOR_VERSION < 7 )) && [ "$protocol" == "3" ]; then
105108
echo "Skipping module tests: Modules doesn't support RESP3 for Redis versions < 7"
@@ -119,7 +122,7 @@ runs:
119122
else
120123
if [ "$protocol" == "2" ] || [ "${{inputs.parser-backend}}" != 'hiredis' ]; then
121124
echo "::group::RESP${protocol} cluster tests"
122-
invoke cluster-tests $eventloop --protocol=${protocol}
125+
invoke cluster-tests --redis-mod-url=${REDIS_CLUSTER_URL} $eventloop --protocol=${protocol}
123126
echo "::endgroup::"
124127
fi
125128
fi

tasks.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,20 @@ def standalone_tests(
6969

7070

7171
@task
72-
def cluster_tests(c, uvloop=False, protocol=2, profile=False, extra_markers=""):
72+
def cluster_tests(c, uvloop=False, protocol=2, profile=False, redis_mod_url=None, extra_markers=""):
7373
"""Run tests against a redis cluster"""
7474
profile_arg = "--profile" if profile else ""
75+
redis_mod_url = f"--redis-mod-url={redis_mod_url}" if redis_mod_url else ""
7576
cluster_url = "redis://localhost:16379/0"
7677
cluster_tls_url = "rediss://localhost:27379/0"
7778
extra_markers = f" and {extra_markers}" if extra_markers else ""
7879
if uvloop:
7980
run(
80-
f"pytest {profile_arg} --protocol={protocol} --cov=./ --cov-report=xml:coverage_cluster_resp{protocol}_uvloop.xml -m 'not onlynoncluster and not graph{extra_markers}' --redis-url={cluster_url} --redis-ssl-url={cluster_tls_url} --junit-xml=cluster-resp{protocol}-uvloop-results.xml --uvloop"
81+
f"pytest {profile_arg} --protocol={protocol} {redis_mod_url} --cov=./ --cov-report=xml:coverage_cluster_resp{protocol}_uvloop.xml -m 'not onlynoncluster and not graph{extra_markers}' --redis-url={cluster_url} --redis-ssl-url={cluster_tls_url} --junit-xml=cluster-resp{protocol}-uvloop-results.xml --uvloop"
8182
)
8283
else:
8384
run(
84-
f"pytest {profile_arg} --protocol={protocol} --cov=./ --cov-report=xml:coverage_cluster_resp{protocol}.xml -m 'not onlynoncluster and not graph{extra_markers}' --redis-url={cluster_url} --redis-ssl-url={cluster_tls_url} --junit-xml=cluster-resp{protocol}-results.xml"
85+
f"pytest {profile_arg} --protocol={protocol} {redis_mod_url} --cov=./ --cov-report=xml:coverage_cluster_resp{protocol}.xml -m 'not onlynoncluster and not graph{extra_markers}' --redis-url={cluster_url} --redis-ssl-url={cluster_tls_url} --junit-xml=cluster-resp{protocol}-results.xml"
8586
)
8687

8788

0 commit comments

Comments
 (0)