-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
92 lines (84 loc) · 2.6 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
# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
envlist = flake8, intflake, py27, py3
[flake8]
ignore = E731,W503
max-line-length = 100
exclude = .tox,.git,module_build_service/migrations,build,.env
[testenv]
usedevelop = true
sitepackages = true
# Allow to switch database backend for running tests.
passenv = DATABASE_URI
whitelist_externals =
flake8
py.test
deps = -r{toxinidir}/test-requirements.txt
commands =
py.test -v -s \
--ignore tests/integration \
--cov module_build_service \
--cov-report html \
--cov-report term \
-W "ignore:Use .persist_selectable:DeprecationWarning" \
-W "ignore:The ConnectionEvents.dbapi_error() event is deprecated and will be removed in a future release. Please refer to the ConnectionEvents.handle_error() event.:DeprecationWarning" \
{posargs}
[testenv:coverage]
basepython = python2
deps =
{[testenv]deps}
coverage
commands =
coverage run --parallel-mode -m pytest
coverage combine
coverage report --omit=tests/*,.tox/*,/usr/* -m --skip-covered
[testenv:flake8]
basepython = python2
skip_install = true
deps = flake8
# doing this until --extend-exclude support becomes available
# https://flake8.readthedocs.io/en/latest/user/options.html#cmdoption-flake8-extend-exclude
commands = flake8 --exclude={[flake8]exclude},tests/integration
[testenv:intflake]
basepython = python3
skip_install = true
sitepackages = false
deps = flake8
commands = flake8 tests/integration
[testenv:bandit]
basepython = python2
skip_install = true
deps = bandit
commands =
/bin/bash -c "bandit -r -ll $(find . -mindepth 1 -maxdepth 1 ! -name tests ! -name \.\* -type d -o -name \*.py)"
ignore_outcome = True
[testenv:integration]
basepython = python3
skipsdist = true
skip_install = true
sitepackages = false
# let's handle integration test deps separately
deps =
kobo
koji
pytest
pytest-html
pytest-xdist
PyYAML
requests
# rpm is an optional dependency for kobo, rpm-py-installer makes it work
rpm-py-installer
sh
# Set this to /etc/pki/tls/certs/ca-bundle.crt, for example,
# if the instance tested has a self-signed certificate.
passenv = REQUESTS_CA_BUNDLE MBS_TEST_CONFIG MBS_TEST_WORKERS HOME
commands =
pytest -rA -vv \
--confcutdir=tests/integration \
-n {env:MBS_TEST_WORKERS:0} \
--html=report.html \
--self-contained-html \
{posargs:tests/integration}