diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml index 5ca6bf5a09..120a687b37 100644 --- a/.github/actions/run-tests/action.yml +++ b/.github/actions/run-tests/action.yml @@ -82,6 +82,8 @@ runs: invoke devenv --endpoints all fi + echo "REDIS_CLUSTER_URL=redis://localhost:16379" >> $GITHUB_ENV + sleep 10 # time to settle echo "::endgroup::" shell: bash @@ -100,6 +102,7 @@ runs: echo "::group::RESP${protocol} standalone tests" echo "REDIS_MOD_URL=${REDIS_MOD_URL}" + echo "REDIS_CLUSTER_URL=${REDIS_CLUSTER_URL}" if (( $REDIS_MAJOR_VERSION < 7 )) && [ "$protocol" == "3" ]; then echo "Skipping module tests: Modules doesn't support RESP3 for Redis versions < 7" @@ -109,11 +112,19 @@ runs: fi echo "::endgroup::" - - if [ "$protocol" == "2" ] || [ "${{inputs.parser-backend}}" != 'hiredis' ]; then - echo "::group::RESP${protocol} cluster tests" - invoke cluster-tests $eventloop --protocol=${protocol} - echo "::endgroup::" + + if (( $REDIS_MAJOR_VERSION < 8 )); then + if [ "$protocol" == "2" ] || [ "${{inputs.parser-backend}}" != 'hiredis' ]; then + echo "::group::RESP${protocol} cluster tests (no modules)" + invoke cluster-tests $eventloop --protocol=${protocol} --extra-markers="not redismod" + echo "::endgroup::" + fi + else + if [ "$protocol" == "2" ] || [ "${{inputs.parser-backend}}" != 'hiredis' ]; then + echo "::group::RESP${protocol} cluster tests (with modules)" + invoke cluster-tests --redis-mod-url=${REDIS_CLUSTER_URL} $eventloop --protocol=${protocol} + echo "::endgroup::" + fi fi } diff --git a/tasks.py b/tasks.py index f7b728aed4..15b06a4bb2 100644 --- a/tasks.py +++ b/tasks.py @@ -69,18 +69,20 @@ def standalone_tests( @task -def cluster_tests(c, uvloop=False, protocol=2, profile=False): +def cluster_tests(c, uvloop=False, protocol=2, profile=False, redis_mod_url=None, extra_markers=""): """Run tests against a redis cluster""" profile_arg = "--profile" if profile else "" + redis_mod_url = f"--redis-mod-url={redis_mod_url}" if redis_mod_url else "" cluster_url = "redis://localhost:16379/0" cluster_tls_url = "rediss://localhost:27379/0" + extra_markers = f" and {extra_markers}" if extra_markers else "" if uvloop: run( - f"pytest {profile_arg} --protocol={protocol} --cov=./ --cov-report=xml:coverage_cluster_resp{protocol}_uvloop.xml -m 'not onlynoncluster and not redismod and not graph' --redis-url={cluster_url} --redis-ssl-url={cluster_tls_url} --junit-xml=cluster-resp{protocol}-uvloop-results.xml --uvloop" + 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" ) else: run( - f"pytest {profile_arg} --protocol={protocol} --cov=./ --cov-report=xml:coverage_cluster_resp{protocol}.xml -m 'not onlynoncluster and not redismod and not graph' --redis-url={cluster_url} --redis-ssl-url={cluster_tls_url} --junit-xml=cluster-resp{protocol}-results.xml" + 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" )