2014-10-10 15:34:45 +02:00
|
|
|
[tox]
|
2017-12-28 15:00:19 +02:00
|
|
|
envlist = py3,py27,pep8,functional
|
2014-10-10 16:17:51 +02:00
|
|
|
|
2014-10-10 15:34:45 +02:00
|
|
|
[testenv]
|
|
|
|
usedevelop = True
|
2016-04-05 09:19:56 -05:00
|
|
|
install_command = pip install -U -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
2014-10-10 16:17:51 +02:00
|
|
|
deps =
|
2015-01-16 14:08:32 +01:00
|
|
|
-r{toxinidir}/test-requirements.txt
|
2014-10-10 16:17:51 +02:00
|
|
|
commands =
|
2018-06-27 14:51:25 -04:00
|
|
|
stestr run {posargs}
|
2017-09-28 10:43:07 +00:00
|
|
|
setenv =
|
|
|
|
VIRTUAL_ENV={envdir}
|
|
|
|
PYTHONDONTWRITEBYTECODE=1
|
|
|
|
TZ=UTC
|
|
|
|
TESTS_DIR=./ironic_inspector/test/unit/
|
2015-06-15 09:53:20 +09:00
|
|
|
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
2014-10-10 16:17:51 +02:00
|
|
|
|
2015-06-18 16:08:07 +02:00
|
|
|
[testenv:venv]
|
2018-06-09 02:08:21 +08:00
|
|
|
basepython = python3
|
2015-06-18 16:08:07 +02:00
|
|
|
commands = {posargs}
|
|
|
|
|
2015-11-23 13:46:45 +01:00
|
|
|
[testenv:releasenotes]
|
2018-06-09 02:08:21 +08:00
|
|
|
basepython = python3
|
2015-11-23 13:46:45 +01:00
|
|
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
|
|
|
2015-10-06 09:01:26 -05:00
|
|
|
[testenv:cover]
|
2018-06-09 02:08:21 +08:00
|
|
|
basepython = python3
|
2017-09-28 10:43:07 +00:00
|
|
|
setenv =
|
|
|
|
{[testenv]setenv}
|
|
|
|
PYTHON=coverage run --branch --omit='*test*' --source ironic_inspector --parallel-mode
|
2015-10-06 09:01:26 -05:00
|
|
|
commands =
|
2017-09-28 10:43:07 +00:00
|
|
|
coverage erase
|
2018-06-27 14:51:25 -04:00
|
|
|
stestr run {posargs}
|
2017-09-28 10:43:07 +00:00
|
|
|
coverage combine
|
|
|
|
coverage report -m --omit='*test*' --fail-under 90
|
|
|
|
coverage html -d ./cover --omit='*test*'
|
2015-10-06 09:01:26 -05:00
|
|
|
|
2014-11-10 14:14:59 +01:00
|
|
|
[testenv:pep8]
|
2018-06-09 02:08:21 +08:00
|
|
|
basepython = python3
|
2014-10-10 16:17:51 +02:00
|
|
|
commands =
|
2015-06-29 12:22:41 +02:00
|
|
|
flake8 ironic_inspector
|
2015-12-02 17:57:58 +01:00
|
|
|
doc8 README.rst CONTRIBUTING.rst doc/source
|
2014-11-14 15:34:32 +01:00
|
|
|
|
2017-12-17 18:57:24 +01:00
|
|
|
[testenv:functional]
|
2014-12-15 12:59:55 +01:00
|
|
|
basepython = python2.7
|
|
|
|
commands =
|
2015-06-29 13:49:05 +02:00
|
|
|
python -m ironic_inspector.test.functional
|
2015-03-11 04:33:48 +00:00
|
|
|
|
2017-12-17 18:57:24 +01:00
|
|
|
[testenv:functional-py35]
|
2017-04-03 12:05:41 -07:00
|
|
|
basepython = python3
|
2015-08-13 14:51:13 +02:00
|
|
|
commands =
|
|
|
|
python3 -m ironic_inspector.test.functional
|
|
|
|
|
2015-03-11 04:33:48 +00:00
|
|
|
[testenv:genconfig]
|
2018-06-09 02:08:21 +08:00
|
|
|
basepython = python3
|
2015-07-08 20:48:09 +02:00
|
|
|
envdir = {toxworkdir}/venv
|
2016-03-04 14:50:26 +02:00
|
|
|
commands = oslo-config-generator --config-file config-generator.conf
|
2015-07-08 20:48:09 +02:00
|
|
|
|
2017-09-27 09:26:58 +00:00
|
|
|
[testenv:genpolicy]
|
2018-06-09 02:08:21 +08:00
|
|
|
basepython = python3
|
2017-09-27 09:26:58 +00:00
|
|
|
sitepackages = False
|
|
|
|
envdir = {toxworkdir}/venv
|
|
|
|
commands = oslopolicy-sample-generator --config-file {toxinidir}/policy-generator.conf
|
|
|
|
|
2017-02-22 17:26:12 +02:00
|
|
|
[testenv:genstates]
|
2018-06-09 02:08:21 +08:00
|
|
|
basepython = python3
|
2017-02-22 17:26:12 +02:00
|
|
|
deps = {[testenv]deps}
|
|
|
|
commands = {toxinidir}/tools/states_to_dot.py -f {toxinidir}/doc/source/images/states.svg --format svg
|
|
|
|
|
2015-07-08 20:48:09 +02:00
|
|
|
[flake8]
|
2018-05-08 23:35:37 +02:00
|
|
|
# TODO(hjensas): ironic_inspector/rules.py:243:1: C901 'create' is too complex (18)
|
|
|
|
# That method is to complex, it should be fixed.
|
|
|
|
max-complexity=18
|
2017-10-12 14:56:24 -07:00
|
|
|
# [H106] Don't put vim configuration in source files.
|
2016-11-09 05:37:10 -08:00
|
|
|
# [H203] Use assertIs(Not)None to check for None.
|
2017-10-12 15:02:32 -07:00
|
|
|
# [H204] Use assert(Not)Equal to check for equality.
|
|
|
|
# [H205] Use assert(Greater|Less)(Equal) for comparison.
|
2016-11-09 05:37:10 -08:00
|
|
|
# [H904] Delay string interpolations at logging calls.
|
2017-10-12 15:02:32 -07:00
|
|
|
enable-extensions=H106,H203,H204,H205,H904
|
2017-02-16 10:11:06 -08:00
|
|
|
import-order-style = pep8
|
2017-10-12 14:56:24 -07:00
|
|
|
application-import-names = ironic_inspector
|
2015-07-08 20:48:09 +02:00
|
|
|
|
|
|
|
[hacking]
|
|
|
|
import_exceptions = ironicclient.exceptions,ironic_inspector.common.i18n
|
2015-11-18 17:27:05 +02:00
|
|
|
|
|
|
|
[testenv:docs]
|
2018-06-09 02:08:21 +08:00
|
|
|
basepython = python3
|
2015-11-18 17:27:05 +02:00
|
|
|
setenv = PYTHONHASHSEED=0
|
|
|
|
sitepackages = False
|
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
|
|
commands =
|
|
|
|
python setup.py build_sphinx
|
2018-03-22 13:44:49 -04:00
|
|
|
|
|
|
|
[testenv:lower-constraints]
|
|
|
|
basepython = python3
|
|
|
|
deps =
|
|
|
|
-c{toxinidir}/lower-constraints.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-r{toxinidir}/requirements.txt
|