2012-01-07 19:34:41 -08:00
|
|
|
[tox]
|
2015-07-27 15:55:32 +10:00
|
|
|
minversion = 1.8
|
2015-05-22 10:17:27 -07:00
|
|
|
envlist = py34,py27,functional,pep8,pip-missing-reqs
|
2013-08-15 14:36:40 -03:00
|
|
|
skipsdist = True
|
2012-01-07 19:34:41 -08:00
|
|
|
|
|
|
|
[testenv]
|
2013-08-15 14:36:40 -03:00
|
|
|
usedevelop = True
|
2014-10-01 06:25:52 -04:00
|
|
|
# tox is silly... these need to be separated by a newline....
|
|
|
|
whitelist_externals = bash
|
|
|
|
find
|
2015-08-25 13:08:31 -07:00
|
|
|
rm
|
2015-07-27 15:55:32 +10:00
|
|
|
install_command =
|
2015-10-19 17:38:17 +11:00
|
|
|
constraints: {[testenv:common-constraints]install_command}
|
2015-07-27 15:55:32 +10:00
|
|
|
pip install -U --force-reinstall {opts} {packages}
|
2012-02-25 12:25:56 -08:00
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
2014-11-07 14:27:03 +01:00
|
|
|
OS_TEST_PATH=./nova/tests/unit
|
2015-03-03 08:58:42 -08:00
|
|
|
LANGUAGE=en_US
|
2015-05-29 16:41:44 -05:00
|
|
|
LC_ALL=en_US.utf-8
|
2015-11-10 11:48:35 -08:00
|
|
|
# TODO(mriedem): Move oslo.versionedobjects[fixtures] to test-requirements.txt
|
|
|
|
# after I937823ffeb95725f0b55e298ebee1857d6482883 lands.
|
2015-10-16 14:30:59 +13:00
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2015-11-10 11:48:35 -08:00
|
|
|
oslo.versionedobjects[fixtures]
|
2013-03-06 16:00:37 -05:00
|
|
|
commands =
|
2014-09-12 05:47:03 -04:00
|
|
|
find . -type f -name "*.pyc" -delete
|
2014-09-16 11:49:11 -04:00
|
|
|
bash tools/pretty_tox.sh '{posargs}'
|
2015-06-09 15:30:59 +09:00
|
|
|
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
2014-09-24 13:56:49 -04:00
|
|
|
# there is also secret magic in pretty_tox.sh which lets you run in a fail only
|
|
|
|
# mode. To do this define the TRACE_FAILONLY environmental variable.
|
2012-01-07 19:34:41 -08:00
|
|
|
|
2012-05-05 13:51:32 -07:00
|
|
|
[tox:jenkins]
|
2012-01-07 19:34:41 -08:00
|
|
|
downloadcache = ~/cache/pip
|
|
|
|
|
2015-10-19 17:38:17 +11:00
|
|
|
[testenv:common-constraints]
|
|
|
|
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
|
|
|
|
2012-01-07 19:34:41 -08:00
|
|
|
[testenv:pep8]
|
2013-05-17 12:54:12 -07:00
|
|
|
commands =
|
2015-07-24 16:05:49 +01:00
|
|
|
bash tools/flake8wrap.sh {posargs}
|
2012-01-07 19:34:41 -08:00
|
|
|
|
2015-10-19 17:38:17 +11:00
|
|
|
[testenv:pep8-constraints]
|
|
|
|
install_command = {[testenv:common-constraints]install_command}
|
|
|
|
commands =
|
|
|
|
bash tools/flake8wrap.sh {posargs}
|
|
|
|
|
2015-05-22 10:17:27 -07:00
|
|
|
[testenv:py34]
|
2015-07-03 23:06:13 +00:00
|
|
|
setenv = {[testenv]setenv}
|
2015-05-25 13:22:29 +02:00
|
|
|
commands =
|
|
|
|
find . -type f -name "*.pyc" -delete
|
2015-07-22 13:38:28 -05:00
|
|
|
python -m subunit.run discover -t . ./nova/tests/ --list
|
2015-09-29 13:54:26 -04:00
|
|
|
ostestr --blacklist_file tests-py3.txt
|
2015-05-22 10:17:27 -07:00
|
|
|
|
2015-10-19 17:38:17 +11:00
|
|
|
[testenv:py34-constraints]
|
|
|
|
install_command = {[testenv:common-constraints]install_command}
|
|
|
|
setenv = {[testenv]setenv}
|
|
|
|
deps = -r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
commands = {[testenv:py34]commands}
|
|
|
|
|
2014-11-06 11:32:34 +01:00
|
|
|
[testenv:functional]
|
|
|
|
usedevelop = True
|
|
|
|
install_command = pip install -U --force-reinstall {opts} {packages}
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
|
|
OS_TEST_PATH=./nova/tests/functional
|
2015-03-03 08:58:42 -08:00
|
|
|
LANGUAGE=en_US
|
2014-11-06 11:32:34 +01:00
|
|
|
commands =
|
|
|
|
find . -type f -name "*.pyc" -delete
|
2014-11-24 09:34:30 -05:00
|
|
|
bash tools/pretty_tox.sh '{posargs}'
|
2014-11-06 11:32:34 +01:00
|
|
|
|
2015-12-03 17:24:53 -05:00
|
|
|
[testenv:api-samples]
|
|
|
|
usedevelop = True
|
|
|
|
install_command = pip install -U --force-reinstall {opts} {packages}
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
|
|
GENERATE_SAMPLES=True
|
|
|
|
PYTHONHASHSEED=0
|
|
|
|
OS_TEST_PATH=./nova/tests/functional/api_sample_tests
|
|
|
|
LANGUAGE=en_US
|
|
|
|
commands =
|
|
|
|
find . -type f -name "*.pyc" -delete
|
|
|
|
bash tools/pretty_tox.sh '{posargs}'
|
|
|
|
|
2015-10-19 17:38:17 +11:00
|
|
|
[testenv:functional-constraints]
|
|
|
|
usedevelop = {[testenv:functional]usedevelop}
|
|
|
|
install_command = {[testenv:common-constraints]install_command}
|
|
|
|
setenv = {[testenv:functional]setenv}
|
|
|
|
commands =
|
|
|
|
find . -type f -name "*.pyc" -delete
|
|
|
|
bash tools/pretty_tox.sh '{posargs}'
|
|
|
|
|
2014-03-19 10:56:49 -07:00
|
|
|
[testenv:genconfig]
|
2015-05-04 23:00:25 -04:00
|
|
|
commands = oslo-config-generator --config-file=etc/nova/nova-config-generator.conf
|
2014-03-19 10:56:49 -07:00
|
|
|
|
2012-05-25 15:27:03 -04:00
|
|
|
[testenv:cover]
|
2013-01-15 06:40:47 +00:00
|
|
|
# Also do not run test_coverage_ext tests while gathering coverage as those
|
|
|
|
# tests conflict with coverage.
|
|
|
|
commands =
|
2014-05-20 14:01:53 -05:00
|
|
|
coverage erase
|
2014-10-24 14:18:30 -04:00
|
|
|
python setup.py testr --coverage \
|
2014-09-09 17:24:22 -04:00
|
|
|
--testr-args='{posargs}'
|
2014-05-20 14:01:53 -05:00
|
|
|
coverage combine
|
|
|
|
coverage html --include='nova/*' --omit='nova/openstack/common/*' -d covhtml -i
|
2012-01-07 19:34:41 -08:00
|
|
|
|
2015-10-19 17:38:17 +11:00
|
|
|
[testenv:cover-constraints]
|
|
|
|
install_command = {[testenv:common-constraints]install_command}
|
|
|
|
# Also do not run test_coverage_ext tests while gathering coverage as those
|
|
|
|
# tests conflict with coverage.
|
|
|
|
commands =
|
|
|
|
coverage erase
|
|
|
|
python setup.py testr --coverage \
|
|
|
|
--testr-args='{posargs}'
|
|
|
|
coverage combine
|
|
|
|
coverage html --include='nova/*' --omit='nova/openstack/common/*' -d covhtml -i
|
|
|
|
|
2012-01-07 19:34:41 -08:00
|
|
|
[testenv:venv]
|
2015-07-15 06:41:21 -07:00
|
|
|
commands = {posargs}
|
2013-05-17 12:54:12 -07:00
|
|
|
|
2015-10-19 17:38:17 +11:00
|
|
|
[testenv:venv-constraints]
|
|
|
|
install_command = {[testenv:common-constraints]install_command}
|
|
|
|
commands = {posargs}
|
|
|
|
|
2014-04-16 16:56:00 -07:00
|
|
|
[testenv:docs]
|
2015-01-21 22:25:10 -05:00
|
|
|
commands =
|
2015-10-01 17:27:50 -05:00
|
|
|
rm -rf doc/source/api doc/build api-guide/build
|
2015-01-21 22:25:10 -05:00
|
|
|
python setup.py build_sphinx
|
|
|
|
bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python'
|
2015-08-21 13:20:23 -04:00
|
|
|
oslo-config-generator --config-file=etc/nova/nova-config-generator.conf
|
2015-11-13 15:02:29 +01:00
|
|
|
sphinx-build -b html api-guide/source api-guide/build/html
|
2015-10-01 17:27:50 -05:00
|
|
|
|
|
|
|
[testenv:api-guide]
|
|
|
|
# This environment is called from CI scripts to test and publish
|
|
|
|
# the API Guide to developer.openstack.org.
|
|
|
|
commands =
|
2015-11-13 15:02:29 +01:00
|
|
|
sphinx-build -b html -d api-guide/build/doctrees api-guide/source api-guide/build/html
|
2014-04-16 16:56:00 -07:00
|
|
|
|
2015-10-19 17:38:17 +11:00
|
|
|
[testenv:docs-constraints]
|
|
|
|
install_command = {[testenv:common-constraints]install_command}
|
|
|
|
commands = {[testenv:docs]commands}
|
|
|
|
|
2015-05-01 23:52:34 -07:00
|
|
|
[testenv:bandit]
|
|
|
|
commands = bandit -c bandit.yaml -r nova -n 5 -ll
|
|
|
|
|
2015-11-05 12:12:28 +01:00
|
|
|
[testenv:releasenotes]
|
2015-11-28 00:50:51 +01:00
|
|
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
2015-11-05 12:12:28 +01:00
|
|
|
|
2013-05-17 12:54:12 -07:00
|
|
|
[flake8]
|
2013-11-20 22:35:08 +10:30
|
|
|
# E125 is deliberately excluded. See https://github.com/jcrocholl/pep8/issues/126
|
2013-12-11 19:18:53 +01:00
|
|
|
# The rest of the ignores are TODOs
|
2015-01-07 12:09:54 -08:00
|
|
|
# New from hacking 0.9: E129, E131, H407, H405
|
2014-06-09 14:45:26 -07:00
|
|
|
# E251 Skipped due to https://github.com/jcrocholl/pep8/issues/301
|
2013-12-11 19:18:53 +01:00
|
|
|
|
2015-02-09 17:34:09 -05:00
|
|
|
ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405
|
2015-11-05 12:12:28 +01:00
|
|
|
exclude = .venv,.git,.tox,dist,doc,*openstack/common/*,*lib/python*,*egg,build,tools/xenserver*,releasenotes
|
2014-10-29 12:22:29 -07:00
|
|
|
# To get a list of functions that are more complex than 25, set max-complexity
|
|
|
|
# to 25 and run 'tox -epep8'.
|
2015-03-18 01:58:30 -07:00
|
|
|
# 34 is currently the most complex thing we have
|
2014-10-16 21:04:08 -07:00
|
|
|
# TODO(jogo): get this number down to 25 or so
|
2015-03-18 01:58:30 -07:00
|
|
|
max-complexity=35
|
2013-05-17 12:54:12 -07:00
|
|
|
|
|
|
|
[hacking]
|
|
|
|
local-check-factory = nova.hacking.checks.factory
|
2014-07-11 21:03:15 -04:00
|
|
|
import_exceptions = nova.i18n
|
2014-08-14 15:06:00 +10:00
|
|
|
|
|
|
|
[testenv:pip-missing-reqs]
|
|
|
|
# do not install test-requirements as that will pollute the virtualenv for
|
|
|
|
# determining missing packages
|
|
|
|
# this also means that pip-missing-reqs must be installed separately, outside
|
|
|
|
# of the requirements.txt files
|
|
|
|
deps = pip_missing_reqs
|
2015-05-14 11:37:28 -07:00
|
|
|
commands=pip-missing-reqs -d --ignore-file=nova/tests/* --ignore-file=nova/test.py nova
|