forked from RedisGears/rgsync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
96 lines (85 loc) · 1.7 KB
/
tox.ini
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
[tox]
minversion=3.2.4
envlist=mysql, postgres, mongo
# for variable reuse
[main]
dbuser = admin
dbpasswd = adminpass
db = rgsync
[docker:mysql]
image = mysql:8
healthcheck_cmd = sleep 10
ports =
3306:3306/tcp
environment =
MYSQL_ROOT_PASSWORD=adminadmin
MYSQL_USER={[main]dbuser}
MYSQL_PASSWORD={[main]dbpasswd}
MYSQL_DATABASE={[main]db}
# tests, setup, and an init script for mongo use these variables
# if you edit this, edit tests/init-mongo.js as well
[docker:mongo]
name = mongo
image = mongo:4
ports =
27017:27017/tcp
environment =
MONGO_INITDB_ROOT_USERNAME={[main]dbuser}
MONGO_INITDB_ROOT_PASSWORD={[main]dbpasswd}
MONGO_INITDB_DATABASE=admin
MONGO_DB={[main]db}
volumes =
bind:ro:{toxinidir}/tests/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js
[docker:redisgears]
name = redisgears
image = redislabs/redismod:edge
volumes =
bind:rw:{toxinidir}:/build
ports =
6379:6379/tcp
[docker:postgres]
image = postgres:13
healthcheck_cmd = sleep 15
ports =
5432:5432/tcp
environment =
POSTGRES_USER={[main]dbuser}
POSTGRES_PASSWORD={[main]dbpasswd}
POSTGRES_DB={[main]db}
[flake8]
max-complexity = 10
filename = ./rgsync/**
ignore = W292, E501
exclude = src/conftest.py
show-source = true
[testenv]
allowlist_externals =
rm
poetry
docker =
{envname}
redisgears
setenv =
IN_DOCKER = 1
commands_pre =
rm -rf dist
poetry build
commands =
pytest -m {envname} -s
[testenv:postgres]
[testenv:mysql]
[testenv:mongo]
[testenv:sqlite]
allowlist_externals =
rm
poetry
docker =
redisgears
setenv =
IN_DOCKER = 1
commands_pre =
rm -rf dist
poetry build
commands =
apt update -y
apt install -y sqlite3