forked from Nitrate/Nitrate
/
tox.ini
206 lines (189 loc) · 4.11 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
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
[tox]
envlist =
{py39,py310,py311}-django{420}-sqlite
py311-django{420}-{mysql,mariadb,postgres}
flake8
docs
; This is not that jslint :)
jslint
templatelint
black
doc8
isort
bandit
mypy-django{420}
[testenv]
passenv = *
deps =
django420: Django>=4.2,<4.3
usedevelop = True
extras =
async
bugzilla
krbauth
tests
commands = py.test {posargs:tests/}
[docker:testdb_mysql]
image = mysql:8.0.22
ports =
33061:3306/tcp
environment =
MYSQL_ROOT_PASSWORD=pass
MYSQL_DATABASE=nitrate
[docker:testdb_mariadb]
image = mariadb:10.4.14
ports =
33061:3306/tcp
environment =
MYSQL_ROOT_PASSWORD=pass
MYSQL_DATABASE=nitrate
[testenv:{py39,py310}-django{420}-mysql]
docker =
testdb_mysql
allowlist_externals =
bash
sleep
extras =
{[testenv]extras}
mysql
setenv =
NITRATE_DB_ENGINE = mysql
NITRATE_DB_NAME = nitrate
NITRATE_DB_PORT = 33061
NITRATE_DB_USER = root
NITRATE_DB_PASSWORD = pass
commands_pre =
sleep 25
bash {toxinidir}/contrib/scripts/adjust_mysql_auth_plugin.sh root pass
[testenv:{py39,py310}-django{420}-mariadb]
docker =
testdb_mariadb
allowlist_externals =
bash
sleep
extras =
{[testenv]extras}
mysql
setenv =
NITRATE_DB_ENGINE = mysql
NITRATE_DB_NAME = nitrate
NITRATE_DB_PORT = 33061
NITRATE_DB_USER = root
NITRATE_DB_PASSWORD = pass
commands_pre =
sleep 5
[docker:testdb_postgres]
image = postgres:12.4-alpine
ports =
54321:5432/tcp
environment =
POSTGRES_USER=postgres
POSTGRES_PASSWORD=nitrate
POSTGRES_DB=testdb
[testenv:{py39,py310}-django{420}-postgres]
docker =
testdb_postgres
allowlist_externals =
sleep
extras =
{[testenv]extras}
pgsql
setenv =
NITRATE_DB_ENGINE = pgsql
NITRATE_DB_PORT = 54321
NITRATE_DB_USER = postgres
NITRATE_DB_PASSWORD = nitrate
NITRATE_DB_NAME = nitrate
commands_pre =
; Sleeping 2 is enough to for the container is started completely
sleep 5
[testenv:flake8]
basepython = python3
skip_install = True
deps = flake8<6.0.0
commands = flake8 src/
[testenv:black]
basepython = python3
skip_install = True
deps = black==22.10.0
commands = black {posargs:src/tcms tests}
[testenv:docs]
setenv =
NITRATE_SECRET_KEY = key-for-testing-doc-build
basepython = python3
whitelist_externals = make
usedevelop = True
extras =
docs
async
bugzilla
changedir = {toxinidir}/docs
commands = make html
[testenv:jslint]
basepython = python3
skip_install = true
whitelist_externals = eslint
commands =
eslint \
src/static/js/nitrate.advanced-search.js \
src/static/js/nitrate.attachments.js \
src/static/js/nitrate.core.js \
src/static/js/nitrate.footer.js \
src/static/js/nitrate.index.js \
src/static/js/nitrate.management.js \
src/static/js/nitrate.profiles.js \
src/static/js/nitrate.report.js \
src/static/js/nitrate.testcases.js \
src/static/js/nitrate.testplans.js \
src/static/js/nitrate.testruns.js \
tests/js/test-tcms-actions.js \
tests/js/test-testplan-actions.js
[testenv:templatelint]
basepython = python3
skip_install = true
whitelist_externals = bash
commands = bash ./contrib/scripts/templatelint.sh src/templates/
[testenv:doc8]
basepython = python3
skip_install = true
deps = doc8==0.10.1
commands = doc8 docs/source README.rst
[testenv:isort]
basepython = python3
skip_install = true
deps = isort==5.10.1
commands = isort --check --diff {posargs:src/tcms tests}
[testenv:bandit]
basepython = python3
skip_install = true
deps = bandit==1.7.4
commands = bandit -r {posargs:src/tcms}
[testenv:mypy-django{420}]
deps =
{[testenv]deps}
django420: django-stubs==4.2.7
django420: mypy>=1.7,<1.8
usedevelop = True
extras =
{[testenv]extras}
mysql
pgsql
devtools
commands = mypy {posargs:src/tcms/ tests/}
[flake8]
exclude =
.tox,
.git,
.env,
dist,
build,
src/tcms/settings/,
*sqls.py,
urls.py,
wsgi.py,
*settings.py,
*raw_sql.py,
*xml2dict*,
./docs/source/conf.py
ignore = E203,E501,W503,W504
max_line_length = 100