forked from oVirt/vdsm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
276 lines (254 loc) · 7.14 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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
[tox]
envlist = flake8, imports, pylint, pylint-py3k, {tests,storage,lib,network,virt}-{py27,py36}
skipsdist = true
skip_missing_interpreters = True
[testenv]
sitepackages = True
basepython = python2.7
whitelist_externals = profile
[testenv:imports]
# This must run separately from the other tests since it checks importing
# python modules with a clean python search path. The only directory allowed in
# the search path is the lib directory.
setenv =
PYTHONPATH = {toxinidir}/lib
deps =
pytest==4.0
changedir = {toxinidir}/tests
commands =
./profile {envname} pytest check_imports.py
[base]
passenv = *
setenv =
PYTHONPATH = {toxinidir}/lib
LC_ALL = C
deps =
nose==1.3.7
pytest-cov
pytest==4.0
changedir = {toxinidir}/tests
markers = "not (slow or stress)"
# PYTHONHASHSEED: Using random hash seed expose bad tests assuming order of
# unorder things.
# TODO: remove this option after the failing tests are fixed.
[testenv:tests-py27]
passenv =
{[base]passenv}
setenv =
{[base]setenv}
PYTHONHASHSEED = 0
deps =
{[base]deps}
yappi==0.93
whitelist_externals = make
changedir = {[base]changedir}
basepython = python2.7
commands =
./profile {envname} make check-py27
[testenv:tests-py36]
passenv =
{[base]passenv}
setenv =
{[base]setenv}
PYTHONHASHSEED = 0
deps =
{[base]deps}
yappi==0.93
whitelist_externals = make
changedir = {[base]changedir}
basepython = python3.6
commands =
./profile {envname} make check-py36
[testenv:lib-py27]
passenv = {[base]passenv}
setenv =
{[base]setenv}
COVERAGE_FILE=.coverage-lib-py27
deps = {[base]deps}
changedir = {[base]changedir}
basepython = python2.7
commands =
./profile {envname} ./py-watch 600 pytest -m {[base]markers} --durations=10 {posargs} \
--cov=vdsm \
--cov-report=html:htmlcov-lib-py27 \
common/commands_test.py \
common/systemctl_test.py \
common/systemd_test.py \
hooking_test.py \
pywatch_test.py \
prlimit_test.py \
ssl_test.py
[testenv:lib-py36]
passenv = {[base]passenv}
setenv =
{[base]setenv}
COVERAGE_FILE=.coverage-lib-py36
deps = {[base]deps}
changedir = {[base]changedir}
basepython = python3.6
commands =
./profile {envname} ./py-watch 600 pytest -m {[base]markers} --durations=10 {posargs} \
--cov=vdsm \
--cov-report=html:htmlcov-lib-py36 \
common/commands_test.py \
common/systemctl_test.py \
common/systemd_test.py \
hooking_test.py \
pywatch_test.py \
prlimit_test.py \
ssl_test.py
[testenv:network-py27]
passenv = {[base]passenv}
setenv =
{[base]setenv}
COVERAGE_FILE=.coverage-network-py27
deps = {[base]deps}
changedir = {[base]changedir}
basepython = python2.7
commands =
./profile {envname} ./py-watch 600 pytest \
--durations=5 \
--cov=vdsm.network \
--cov-report=html:htmlcov-network-py27 \
--cov-fail-under={env:NETWORK_PY27_COVERAGE:42} \
{posargs} \
network/integration \
network/unit
[testenv:network-py36]
passenv = {[base]passenv}
setenv =
{[base]setenv}
COVERAGE_FILE=.coverage-network-py36
deps = {[base]deps}
changedir = {[base]changedir}
basepython = python3.6
commands =
./profile {envname} ./py-watch 600 pytest \
--durations=5 \
--cov=vdsm.network \
--cov-report=html:htmlcov-network-py36 \
--cov-fail-under={env:NETWORK_PY36_COVERAGE:42} \
{posargs} \
network/integration \
network/unit
[testenv:storage-py27]
passenv = {[base]passenv}
setenv =
{[base]setenv}
COVERAGE_FILE=.coverage-storage-py27
deps = {[base]deps}
changedir = {[base]changedir}
commands =
./profile {envname} ./py-watch 600 pytest -m {[base]markers} \
--durations=10 \
--cov=vdsm.storage \
--cov-report=html:htmlcov-storage-py27 \
{posargs:storage}
[testenv:storage-py36]
passenv = {[base]passenv}
setenv =
{[base]setenv}
COVERAGE_FILE=.coverage-storage-py36
deps = {[base]deps}
changedir = {[base]changedir}
basepython = python3.6
# Test modules that fail on python3
# TODO: run all tests on python3
commands =
./profile {envname} ./py-watch 600 pytest -m {[base]markers} \
--durations=10 \
--cov=vdsm.storage \
--cov-report=html:htmlcov-storage-py36 \
--ignore=storage/blockvolume_test.py \
--ignore=storage/filesd_test.py \
--ignore=storage/filevolume_test.py \
--ignore=storage/formatconverter_test.py \
--ignore=storage/hsm_test.py \
--ignore=storage/localfssd_test.py \
--ignore=storage/merge_test.py \
--ignore=storage/nbd_test.py \
--ignore=storage/outofprocess_test.py \
--ignore=storage/persistent_test.py \
--ignore=storage/resourcemanager_test.py \
--ignore=storage/sd_manifest_test.py \
--ignore=storage/sdm_amend_volume_test.py \
--ignore=storage/sdm_copy_data_test.py \
--ignore=storage/sdm_merge_test.py \
--ignore=storage/sdm_update_volume_test.py \
--ignore=storage/testlib_test.py \
--ignore=storage/volume_test.py \
--ignore=storage/workarounds_test.py \
{posargs:storage}
[testenv:virt-py27]
passenv = {[base]passenv}
setenv =
{[base]setenv}
COVERAGE_FILE=.coverage-virt-py27
deps = {[base]deps}
changedir = {[base]changedir}
basepython = python2.7
commands =
./profile {envname} ./py-watch 600 pytest \
--durations=5 \
--cov=vdsm.virt \
--cov-report=html:htmlcov-virt-py27 \
{posargs} \
virt
[testenv:virt-py36]
passenv = {[base]passenv}
setenv =
{[base]setenv}
COVERAGE_FILE=.coverage-virt-py36
deps = {[base]deps}
changedir = {[base]changedir}
basepython = python3.6
commands =
./profile {envname} ./py-watch 600 pytest \
--durations=5 \
--cov=vdsm.virt \
--cov-report=html:htmlcov-virt-py36 \
{posargs} \
virt
[testenv:pylint]
setenv =
PYTHONPATH = vdsm:lib
deps =
pylint==1.9.3
commands =
{toxinidir}/tests/profile {envname} pylint -j{env:PYLINT_JOBS:2} --reports=no --score=no {posargs}
[testenv:pylint-py3k]
basepython = python2.7
setenv =
PYTHONPATH = vdsm:lib
deps =
pylint==1.9.3
commands =
{toxinidir}/tests/profile {envname} pylint -j{env:PYLINT_JOBS:2} --rcfile=py3k-pylintrc {posargs}
[testenv:flake8]
deps =
flake8==3.5
commands=
{toxinidir}/tests/profile {envname} flake8 --statistics {posargs} \
. \
build-aux/vercmp \
contrib/logdb \
contrib/logstat \
contrib/lvs-stats \
contrib/profile-stats \
init/daemonAdapter \
lib/vdsm/storage/curl-img-wrap \
lib/vdsm/storage/fc-scan \
static/libexec/vdsm/get-conf-item
[pytest]
# -r chars: (s)skipped, (x)failed, (X)passed
addopts = -rxXs --basetemp=/var/tmp/vdsm
[flake8]
# Ignore errors in current code to make the build pass
# 31 E402 module level import not at top of file
# 25 E731 do not assign a lambda expression, use a def
# 43 E305 expected 2 blank lines after class or function definition, found 1
# 173 E722 do not use bare except'
# 4 E741 ambiguous variable name 'l'
# TODO: fix the code and eliminate these ignores
ignore = E402, E731, E305, E722, E741
show_source = True