1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
[pytest]
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 standalone redis
[tox]
minversion = 3.2.0
requires = tox-docker
envlist = {standalone,cluster}-{plain,hiredis}-{py35,py36,py37,py38,py39,pypy3},linters,docs
[docker:master]
name = master
image = redisfab/redis-py:6.2.6-buster
ports =
6379:6379/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6379)) else False"
volumes =
bind:rw:{toxinidir}/docker/master/redis.conf:/redis.conf
[docker:replica]
name = replica
image = redisfab/redis-py:6.2.6-buster
links =
master:master
ports =
6380:6380/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',6380)) else False"
volumes =
bind:rw:{toxinidir}/docker/replica/redis.conf:/redis.conf
[docker:sentinel_1]
name = sentinel_1
image = redisfab/redis-py-sentinel:6.2.6-buster
links =
master:master
ports =
26379:26379/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26379)) else False"
volumes =
bind:rw:{toxinidir}/docker/sentinel_1/sentinel.conf:/sentinel.conf
[docker:sentinel_2]
name = sentinel_2
image = redisfab/redis-py-sentinel:6.2.6-buster
links =
master:master
ports =
26380:26380/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26380)) else False"
volumes =
bind:rw:{toxinidir}/docker/sentinel_2/sentinel.conf:/sentinel.conf
[docker:sentinel_3]
name = sentinel_3
image = redisfab/redis-py-sentinel:6.2.6-buster
links =
master:master
ports =
26381:26381/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',26381)) else False"
volumes =
bind:rw:{toxinidir}/docker/sentinel_3/sentinel.conf:/sentinel.conf
[docker:redismod]
name = redismod
image = redislabs/redismod:edge
ports =
36379:6379/tcp
healtcheck_cmd = python -c "import socket;print(True) if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('127.0.0.1',36379)) else False"
[docker:lots-of-pythons]
name = lots-of-pythons
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
-r {toxinidir}/dev_requirements.txt
docker =
master
replica
sentinel_1
sentinel_2
sentinel_3
redis_cluster
redismod
extras =
hiredis: hiredis
setenv =
CLUSTER_URL = "redis://localhost:16379/0"
commands =
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
skip_install = true
deps = -r {toxinidir}/dev_requirements.txt
docker =
master
replica
sentinel_1
sentinel_2
sentinel_3
redis_cluster
redismod
lots-of-pythons
commands = /usr/bin/echo
[testenv:linters]
deps_files = dev_requirements.txt
docker =
commands =
flake8
vulture redis whitelist.py --min-confidence 80
skipsdist = true
skip_install = true
[testenv:pypy3-plain]
basepython = pypy3
[testenv:pypy3-hiredis]
basepython = pypy3
[testenv:docs]
deps_files = docs/requirements.txt
docker =
changedir = {toxinidir}/docs
allowlist_externals = make
commands = make html
[flake8]
exclude =
*.egg-info,
*.pyc,
.git,
.tox,
.venv*,
build,
docs/*,
dist,
docker,
venv*,
whitelist.py
|