2013-05-02 14:50:57 -04:00
|
|
|
|
[tox]
|
2015-09-04 11:57:16 -07:00
|
|
|
|
minversion = 1.8
|
2013-09-30 22:55:00 +08:00
|
|
|
|
skipsdist = True
|
2017-12-11 07:30:30 -08:00
|
|
|
|
envlist = py3,py27,pep8
|
2013-05-02 14:50:57 -04:00
|
|
|
|
|
|
|
|
|
[testenv]
|
2013-09-30 22:55:00 +08:00
|
|
|
|
usedevelop = True
|
2016-03-31 11:42:27 -07:00
|
|
|
|
install_command = pip install -U -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
2013-05-02 14:50:57 -04:00
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
2014-09-12 12:04:50 +01:00
|
|
|
|
PYTHONDONTWRITEBYTECODE = 1
|
2015-03-13 08:42:51 -07:00
|
|
|
|
LANGUAGE=en_US
|
2015-09-30 09:39:46 -07:00
|
|
|
|
LC_ALL=en_US.UTF-8
|
2016-09-30 00:29:08 +08:00
|
|
|
|
PYTHONWARNINGS=default::DeprecationWarning
|
2015-09-25 22:18:22 -04:00
|
|
|
|
TESTS_DIR=./ironic/tests/unit/
|
2015-07-15 18:31:29 -07:00
|
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2017-06-13 17:30:19 +03:00
|
|
|
|
commands =
|
|
|
|
|
ostestr {posargs}
|
2015-06-15 09:59:20 +09:00
|
|
|
|
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
2014-03-31 20:42:46 +02:00
|
|
|
|
|
2017-02-10 14:00:01 +00:00
|
|
|
|
[testenv:unit-with-driver-libs]
|
2017-02-15 16:01:43 +01:00
|
|
|
|
basepython = python2
|
2017-02-10 14:00:01 +00:00
|
|
|
|
deps = {[testenv]deps}
|
|
|
|
|
-r{toxinidir}/driver-requirements.txt
|
|
|
|
|
|
2015-04-27 11:00:29 -07:00
|
|
|
|
[testenv:genstates]
|
|
|
|
|
deps = {[testenv]deps}
|
|
|
|
|
pydot2
|
2015-06-03 16:56:08 -07:00
|
|
|
|
commands = {toxinidir}/tools/states_to_dot.py -f {toxinidir}/doc/source/images/states.svg --format svg
|
2015-04-27 11:00:29 -07:00
|
|
|
|
|
2013-05-02 14:50:57 -04:00
|
|
|
|
[testenv:pep8]
|
2015-09-29 17:37:07 -07:00
|
|
|
|
whitelist_externals = bash
|
2013-05-02 14:50:57 -04:00
|
|
|
|
commands =
|
2015-12-22 15:46:46 +08:00
|
|
|
|
bash tools/flake8wrap.sh {posargs}
|
2015-12-17 17:45:30 +00:00
|
|
|
|
# Run bashate during pep8 runs to ensure violations are caught by
|
|
|
|
|
# the check and gate queues.
|
2016-09-21 09:02:08 -07:00
|
|
|
|
{toxinidir}/tools/run_bashate.sh {toxinidir}
|
2014-03-31 20:42:46 +02:00
|
|
|
|
# Check that .po and .pot files are valid:
|
2014-04-03 20:25:43 +02:00
|
|
|
|
bash -c "find ironic -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null"
|
2016-01-27 10:36:33 +00:00
|
|
|
|
# Check the *.rst files
|
2017-07-03 16:24:24 +01:00
|
|
|
|
doc8 README.rst CONTRIBUTING.rst doc/source --ignore D001
|
2013-05-02 14:50:57 -04:00
|
|
|
|
|
|
|
|
|
[testenv:cover]
|
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
2015-03-13 08:42:51 -07:00
|
|
|
|
LANGUAGE=en_US
|
2017-09-19 12:34:01 +00:00
|
|
|
|
PYTHON=coverage run --source ironic --omit='*tests*' --parallel-mode
|
2013-05-02 14:50:57 -04:00
|
|
|
|
commands =
|
2016-04-17 19:59:30 +03:00
|
|
|
|
coverage erase
|
2017-09-19 12:34:01 +00:00
|
|
|
|
ostestr {posargs}
|
|
|
|
|
coverage combine
|
|
|
|
|
coverage report --omit='*tests*'
|
|
|
|
|
coverage html -d ./cover --omit='*tests*'
|
2013-05-02 14:50:57 -04:00
|
|
|
|
|
2014-09-29 15:59:36 -07:00
|
|
|
|
[testenv:checkconfig]
|
|
|
|
|
sitepackages = False
|
|
|
|
|
envdir = {toxworkdir}/venv
|
|
|
|
|
commands =
|
|
|
|
|
{toxinidir}/tools/config/check_uptodate.sh
|
|
|
|
|
|
2014-06-20 13:53:17 -04:00
|
|
|
|
[testenv:genconfig]
|
2014-09-29 15:59:36 -07:00
|
|
|
|
sitepackages = False
|
|
|
|
|
envdir = {toxworkdir}/venv
|
2014-06-20 13:53:17 -04:00
|
|
|
|
commands =
|
2015-11-19 14:50:38 +08:00
|
|
|
|
oslo-config-generator --config-file=tools/config/ironic-config-generator.conf
|
2014-06-20 13:53:17 -04:00
|
|
|
|
|
2016-06-03 15:43:12 -07:00
|
|
|
|
[testenv:genpolicy]
|
|
|
|
|
sitepackages = False
|
|
|
|
|
envdir = {toxworkdir}/venv
|
|
|
|
|
commands =
|
2017-07-25 13:30:59 +05:30
|
|
|
|
oslopolicy-sample-generator --config-file=tools/policy/ironic-policy-generator.conf
|
2016-06-03 15:43:12 -07:00
|
|
|
|
|
2016-06-03 10:21:33 +01:00
|
|
|
|
[testenv:debug]
|
|
|
|
|
commands = oslo_debug_helper -t ironic/tests/unit {posargs}
|
|
|
|
|
|
2015-05-20 16:36:35 +02:00
|
|
|
|
[testenv:docs]
|
2017-08-30 16:33:02 +02:00
|
|
|
|
# FIXME(dtantsur): workaround for bug #1714025
|
|
|
|
|
basepython = python2
|
2015-04-07 13:32:53 -07:00
|
|
|
|
setenv = PYTHONHASHSEED=0
|
2014-11-14 17:14:19 +00:00
|
|
|
|
sitepackages = False
|
|
|
|
|
envdir = {toxworkdir}/venv
|
|
|
|
|
commands =
|
|
|
|
|
python setup.py build_sphinx
|
|
|
|
|
|
2016-05-03 13:24:10 -04:00
|
|
|
|
[testenv:api-ref]
|
|
|
|
|
# This environment is called from CI scripts to test and publish
|
|
|
|
|
# the API Ref to developer.openstack.org.
|
2016-05-16 12:18:26 +00:00
|
|
|
|
whitelist_externals = bash
|
2016-05-03 13:24:10 -04:00
|
|
|
|
commands =
|
2016-05-16 12:18:26 +00:00
|
|
|
|
bash -c 'rm -rf api-ref/build'
|
2016-05-03 13:24:10 -04:00
|
|
|
|
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
|
|
|
|
|
|
2015-11-05 08:29:42 -08:00
|
|
|
|
[testenv:releasenotes]
|
2017-04-05 14:49:42 -07:00
|
|
|
|
commands =
|
|
|
|
|
{toxinidir}/tools/check-releasenotes.py
|
|
|
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
2015-11-05 08:29:42 -08:00
|
|
|
|
|
2013-05-02 14:50:57 -04:00
|
|
|
|
[testenv:venv]
|
2014-08-25 12:48:10 -07:00
|
|
|
|
setenv = PYTHONHASHSEED=0
|
2013-05-02 14:50:57 -04:00
|
|
|
|
commands = {posargs}
|
|
|
|
|
|
|
|
|
|
[flake8]
|
2017-10-25 12:59:07 +03:00
|
|
|
|
# TODO(vdrok): Remove I202 from ignore list when we split out
|
|
|
|
|
# the tempest plugin
|
|
|
|
|
ignore = E129,I202
|
2017-11-28 15:25:04 +07:00
|
|
|
|
filename = *.py,app.wsgi
|
2015-12-23 01:24:02 +00:00
|
|
|
|
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
2017-02-16 09:35:28 -08:00
|
|
|
|
import-order-style = pep8
|
2017-03-16 07:20:35 -07:00
|
|
|
|
application-import-names = ironic
|
2014-10-16 22:27:32 -07:00
|
|
|
|
max-complexity=17
|
2016-11-08 10:07:56 -08:00
|
|
|
|
# [H106] Don’t put vim configuration in source files.
|
|
|
|
|
# [H203] Use assertIs(Not)None to check for None.
|
2017-09-07 10:10:07 -07:00
|
|
|
|
# [H204] Use assert(Not)Equal to check for equality.
|
|
|
|
|
# [H205] Use assert(Greater|Less)(Equal) for comparison.
|
2016-11-08 10:07:56 -08:00
|
|
|
|
# [H904] Delay string interpolations at logging calls.
|
2017-09-07 10:10:07 -07:00
|
|
|
|
enable-extensions=H106,H203,H204,H205,H904
|
2013-11-19 08:15:25 +08:00
|
|
|
|
|
|
|
|
|
[hacking]
|
2014-09-11 21:04:47 +00:00
|
|
|
|
import_exceptions = testtools.matchers, ironic.common.i18n
|