-
Notifications
You must be signed in to change notification settings - Fork 23
/
tox.ini
136 lines (121 loc) · 2.64 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
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
[pytest]
addopts = -s
markers =
mysql: mysql backend tests
postgres: postgres backend tests
sqlite: sqlite backend tests
mongo: mongo backend tests
db2: db2 backend tests
[tox]
minversion=3.2.4
envlist=mysql, postgres, mongo, db2, linters
# for variable reuse
[main]
dbuser = admin
dbpasswd = adminpass
db = rgsync
[docker:db2]
image = ibmcom/db2
container_name = db2
privileged = true
ports =
50000:50000/tcp
55000:55000/tcp
environment =
LICENSE=accept
DB2INSTANCE={[main]dbuser}
DB2INST1_PASSWORD={[main]dbpasswd}
DBNAME={[main]db}
[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:db2]
commands =
docker exec redisgears apt-get update --fix-missing
docker exec redisgears apt-get install -y gcc vim procps libxml2
sh {toxinidir}/sbin/db2wait.sh
pytest -m {envname} -s
[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
[testenv:linters]
deps_files = dev_requirements.txt
docker =
commands =
black --target-version py36 --check --diff rgsync tests
isort --check-only --diff rgsync tests
vulture rgsync --min-confidence 80
flynt --fail-on-change --dry-run rgsync tests
skipsdist = true
skip_install = true