forked from openstack/monasca-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
108 lines (95 loc) · 2.68 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
[tox]
envlist = py27,pep8
minversion = 2.1
skipsdist = True
[testenv]
setenv =
VIRTUAL_ENV={envdir}
OS_TEST_PATH=monasca_api/tests
CLIENT_NAME=monasca-api
passenv = http_proxy
HTTP_PROXY
https_proxy
HTTPS_PROXY
no_proxy
NO_PROXY
usedevelop = True
install_command =
{toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals = bash
find
rm
commands =
find . -type f -name "*.pyc" -delete
[testenv:py27]
basepython = python2.7
deps = {[testenv:unit_deps]deps}
commands =
{[testenv]commands}
ostestr {posargs}
[testenv:py35]
basepython = python3.5
deps = {[testenv:unit_deps]deps}
commands =
{[testenv]commands}
ostestr {posargs}
[testenv:cover]
basepython = python2.7
deps = {[testenv:unit_deps]deps}
commands =
{[testenv]commands}
coverage erase
python setup.py test --coverage --testr-args='{posargs}' --coverage-package-name=monasca_api
coverage report
[testenv:debug]
deps = {[testenv:unit_deps]deps}
commands =
{[testenv]commands}
oslo_debug_helper -t ./monasca_api/tests {posargs}
[testenv:flake8]
commands =
flake8 monasca_api
flake8 monasca_tempest_tests
[testenv:bandit]
commands =
# B101(assert_ussed) - API uses asserts because of performance reasons
bandit -r monasca_api -n5 -s B101 -x monasca_api/tests
# B101(assert_ussed) - asserts in test layers seems appropriate
bandit -r monasca_tempest_tests -n5 -s B101
[testenv:bashate]
whitelist_externals = bashate
commands =
# Ignore too long lines error E006 from bashate and treat
# E005, E042 as errors.
bashate -v -iE006 -eE005,E042 devstack/plugin.sh
[testenv:pep8]
deps =
{[testenv]deps}
commands =
{[testenv:flake8]commands}
{[testenv:bandit]commands}
{[testenv:bashate]commands}
[testenv:venv]
commands = {posargs}
# note(trebskit): this is just placeholder to wrap all common dependencies
# needed to run tests, those dependencies won't likely
# be needed for every possible -e here, so extracted them here
[testenv:unit_deps]
deps =
{[testenv]deps}
influxdb==2.8.0
cassandra-driver>=2.1.4,!=3.6.0
[flake8]
# TODO: ignored checks should be enabled in the future
# H201 no 'except:' at least use 'except Exception:'
# H302 import only modules
# H405 multi line docstring summary not separated with an empty line
ignore = F821,H201,H302,H405
max-complexity = 50
max-line-length = 120
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,build
show-source = True
[hacking]