Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run stack tests against 8.0 #3482

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
@@ -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
}

8 changes: 5 additions & 3 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -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"
)