From 6a4c544fa02f8bdcc9c54a688a422cd6676e9b2a Mon Sep 17 00:00:00 2001 From: vladvildanov Date: Tue, 21 Jan 2025 11:40:30 +0200 Subject: [PATCH 1/5] Run stack tests against 8.0 --- .github/actions/run-tests/action.yml | 19 +++++++++++++------ tasks.py | 7 ++++--- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml index 5ca6bf5a09..3547583bff 100644 --- a/.github/actions/run-tests/action.yml +++ b/.github/actions/run-tests/action.yml @@ -109,12 +109,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::" - fi + + if (( $REDIS_MAJOR_VERSION < 8 )); then + if [ "$protocol" == "2" ] || [ "${{inputs.parser-backend}}" != 'hiredis' ]; then + echo "::group::RESP${protocol} cluster tests" + 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" + invoke cluster-tests $eventloop --protocol=${protocol} + echo "::endgroup::" + fi } run_tests 2 "${{inputs.event-loop}}" diff --git a/tasks.py b/tasks.py index f7b728aed4..80486764d3 100644 --- a/tasks.py +++ b/tasks.py @@ -69,18 +69,19 @@ def standalone_tests( @task -def cluster_tests(c, uvloop=False, protocol=2, profile=False): +def cluster_tests(c, uvloop=False, protocol=2, profile=False, extra_markers=""): """Run tests against a redis cluster""" profile_arg = "--profile" if profile 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} --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} --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" ) From e3246b53b7d8a3ebff2e8f70d0f7016830c42abb Mon Sep 17 00:00:00 2001 From: vladvildanov Date: Tue, 21 Jan 2025 11:43:57 +0200 Subject: [PATCH 2/5] Added missing trailed fi --- .github/actions/run-tests/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml index 3547583bff..4bf64ecf6d 100644 --- a/.github/actions/run-tests/action.yml +++ b/.github/actions/run-tests/action.yml @@ -122,6 +122,7 @@ runs: invoke cluster-tests $eventloop --protocol=${protocol} echo "::endgroup::" fi + fi } run_tests 2 "${{inputs.event-loop}}" From 116eb6eb77dedfd87931fb6b84c5ccb65bcb99e4 Mon Sep 17 00:00:00 2001 From: vladvildanov Date: Tue, 21 Jan 2025 13:34:04 +0200 Subject: [PATCH 3/5] Added redis_mod_url arg --- .github/actions/run-tests/action.yml | 5 ++++- tasks.py | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml index 4bf64ecf6d..a76a15987a 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" @@ -119,7 +122,7 @@ runs: else if [ "$protocol" == "2" ] || [ "${{inputs.parser-backend}}" != 'hiredis' ]; then echo "::group::RESP${protocol} cluster tests" - invoke cluster-tests $eventloop --protocol=${protocol} + 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 80486764d3..15b06a4bb2 100644 --- a/tasks.py +++ b/tasks.py @@ -69,19 +69,20 @@ def standalone_tests( @task -def cluster_tests(c, uvloop=False, protocol=2, profile=False, extra_markers=""): +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 graph{extra_markers}' --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 graph{extra_markers}' --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" ) From fa804160f1e2461821bac57199d87afa3ae759c3 Mon Sep 17 00:00:00 2001 From: vladvildanov Date: Tue, 21 Jan 2025 13:36:37 +0200 Subject: [PATCH 4/5] Removed quotes --- .github/actions/run-tests/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml index a76a15987a..6b88aff317 100644 --- a/.github/actions/run-tests/action.yml +++ b/.github/actions/run-tests/action.yml @@ -82,7 +82,7 @@ runs: invoke devenv --endpoints all fi - echo "REDIS_CLUSTER_URL="redis://localhost:16379" >> $GITHUB_ENV + echo "REDIS_CLUSTER_URL=redis://localhost:16379" >> $GITHUB_ENV sleep 10 # time to settle echo "::endgroup::" From dbc1b74c82356bbc8710a61b03539eeb9744dc70 Mon Sep 17 00:00:00 2001 From: vladvildanov Date: Tue, 21 Jan 2025 14:03:32 +0200 Subject: [PATCH 5/5] Added markers to clsuter tests --- .github/actions/run-tests/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml index 6b88aff317..120a687b37 100644 --- a/.github/actions/run-tests/action.yml +++ b/.github/actions/run-tests/action.yml @@ -115,13 +115,13 @@ runs: if (( $REDIS_MAJOR_VERSION < 8 )); then if [ "$protocol" == "2" ] || [ "${{inputs.parser-backend}}" != 'hiredis' ]; then - echo "::group::RESP${protocol} cluster tests" + 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" + echo "::group::RESP${protocol} cluster tests (with modules)" invoke cluster-tests --redis-mod-url=${REDIS_CLUSTER_URL} $eventloop --protocol=${protocol} echo "::endgroup::" fi