summaryrefslogtreecommitdiff
path: root/tox.ini
diff options
context:
space:
mode:
authorBar Shaul <88437685+barshaul@users.noreply.github.com>2021-11-25 14:15:24 +0200
committerGitHub <noreply@github.com>2021-11-25 14:15:24 +0200
commit9db1eec71b443b8e7e74ff503bae651dc6edf411 (patch)
treece23ac6f923df54676349603f4e5551dfc801057 /tox.ini
parent021d4ac0edaecedb9b83235700cc4699cb119ef1 (diff)
downloadredis-py-9db1eec71b443b8e7e74ff503bae651dc6edf411.tar.gz
Adding RedisCluster client to support Redis Cluster Mode (#1660)
Co-authored-by: Chayim <chayim@users.noreply.github.com> Co-authored-by: Anas <anas.el.amraoui@live.com>
Diffstat (limited to 'tox.ini')
-rw-r--r--tox.ini26
1 files changed, 24 insertions, 2 deletions
diff --git a/tox.ini b/tox.ini
index 6d4c658..c68dab1 100644
--- a/tox.ini
+++ b/tox.ini
@@ -2,11 +2,13 @@
addopts = -s
markers =
redismod: run only the redis module tests
+ onlycluster: marks tests to be run only with cluster mode redis
+ onlynoncluster: marks tests to be run only with non-cluster redis
[tox]
minversion = 3.2.0
requires = tox-docker
-envlist = {py35,py36,py37,py38,py39,pypy3}-{plain,hiredis},linters
+envlist = {redis,cluster}-{plain,hiredis}-{py35,py36,py37,py38,py39,pypy3},linters
[docker:master]
name = master
@@ -74,6 +76,21 @@ image = redisfab/lots-of-pythons
volumes =
bind:rw:{toxinidir}:/data
+[docker:redis_cluster]
+name = redis_cluster
+image = barshaul/redis-py:6.2.6-cluster
+ports =
+ 16379:16379/tcp
+ 16380:16380/tcp
+ 16381:16381/tcp
+ 16382:16382/tcp
+ 16383:16383/tcp
+ 16384:16384/tcp
+healtcheck_cmd = python -c "import socket;print(True) if all([0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',port)) for port in range(16379,16384)]) else False"
+volumes =
+ bind:rw:{toxinidir}/docker/cluster/redis.conf:/redis.conf
+
+
[testenv]
deps =
-r {toxinidir}/requirements.txt
@@ -84,11 +101,15 @@ docker =
sentinel_1
sentinel_2
sentinel_3
+ redis_cluster
redismod
extras =
hiredis: hiredis
+setenv =
+ CLUSTER_URL = "redis://localhost:16379/0"
commands =
- pytest --cov=./ --cov-report=xml -W always {posargs}
+ redis: pytest --cov=./ --cov-report=xml:coverage_redis.xml -W always -m 'not onlycluster' {posargs}
+ cluster: pytest --cov=./ --cov-report=xml:coverage_cluster.xml -W always -m 'not onlynoncluster and not redismod' --redis-url={env:CLUSTER_URL:} {posargs}
[testenv:devenv]
skipsdist = true
@@ -100,6 +121,7 @@ docker =
sentinel_1
sentinel_2
sentinel_3
+ redis_cluster
redismod
lots-of-pythons
commands = /usr/bin/echo