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
|
2016-07-15 20:58:47 +00:00
|
|
|
envlist = py35,py34,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
|
2015-09-25 22:18:22 -04: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
|
|
|
|
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
|
2016-08-30 15:12:28 -07:00
|
|
|
doc8 README.rst CONTRIBUTING.rst doc/source install-guide/ --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
|
2013-05-02 14:50:57 -04:00
|
|
|
commands =
|
2016-04-17 19:59:30 +03:00
|
|
|
coverage erase
|
|
|
|
python setup.py testr --coverage --omit='*test*' --testr-args='{posargs}'
|
|
|
|
coverage report --omit='*test*'
|
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 =
|
|
|
|
oslopolicy-sample-generator --namespace=ironic.api --output-file=etc/ironic/policy.json.sample
|
|
|
|
|
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]
|
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]
|
2015-11-27 10:52:24 +09:00
|
|
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
2015-11-05 08:29:42 -08:00
|
|
|
|
2016-08-30 15:12:28 -07:00
|
|
|
[testenv:install-guide]
|
|
|
|
commands = sphinx-build -a -E -W -d install-guide/build/doctrees -b html install-guide/source install-guide/build/html
|
|
|
|
|
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]
|
2015-08-13 16:26:45 +01:00
|
|
|
ignore = E129
|
2015-12-23 01:24:02 +00:00
|
|
|
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
2014-10-16 22:27:32 -07:00
|
|
|
max-complexity=17
|
2013-11-19 08:15:25 +08:00
|
|
|
|
|
|
|
[hacking]
|
2014-09-11 21:04:47 +00:00
|
|
|
import_exceptions = testtools.matchers, ironic.common.i18n
|