mogan/tox.ini
Zhenguo Niu 0ce4a05ac7 Gate on nimble.conf.sample generation
If someone makes a change that breaks "tox -egenconfig",
it is not caught today by any of the gate/check job, we
should fail at least docs job like what Nova does to make
sure it works.

Change-Id: I80951cd821029c05f84459dc929a11c9b403131e
2016-11-30 16:55:31 +08:00

95 lines
2.8 KiB
INI

[tox]
minversion = 2.0
envlist = py35-constraints,py34-constraints,py27-constraints,pypy-constraints,pep8-constraints,functional
skipsdist = True
[testenv]
usedevelop = True
install_command = {[testenv:common-constraints]install_command}
setenv =
VIRTUAL_ENV={envdir}
OS_TEST_PATH=nimble/tests/unit
deps = -r{toxinidir}/test-requirements.txt
commands = python setup.py test --slowest --testr-args='{posargs}'
[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}
[testenv:pep8]
commands = flake8 {posargs}
[testenv:pep8-constraints]
install_command = {[testenv:common-constraints]install_command}
commands = flake8 {posargs}
[testenv:venv]
commands = {posargs}
[testenv:venv-constraints]
install_command = {[testenv:common-constraints]install_command}
commands = {posargs}
[testenv:cover]
commands = python setup.py test --coverage --testr-args='{posargs}'
[testenv:cover-constraints]
install_command = {[testenv:common-constraints]install_command}
commands = python setup.py test --coverage --testr-args='{posargs}'
[testenv:docs]
commands =
python setup.py build_sphinx
oslo-config-generator --config-file=tools/config/nimble-config-generator.conf
[testenv:releasenotes]
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:docs-constraints]
install_command = {[testenv:common-constraints]install_command}
commands = python setup.py build_sphinx
[testenv:debug]
commands = oslo_debug_helper {posargs}
[testenv:functional]
setenv = OS_TEST_PATH=nimble/tests/functional/
commands = python setup.py testr --slowest --testr-args="{posargs}"
[testenv:debug-constraints]
install_command = {[testenv:common-constraints]install_command}
commands = oslo_debug_helper {posargs}
[testenv:genconfig]
sitepackages = False
envdir = {toxworkdir}/venv
commands =
oslo-config-generator --config-file=tools/config/nimble-config-generator.conf
[testenv:genpolicy]
sitepackages = False
envdir = {toxworkdir}/venv
commands =
oslopolicy-sample-generator --namespace=nimble.api --output-file=etc/nimble/policy.json.sample
[testenv:api-ref]
# This environment is called from CI scripts to test and publish
# the API Ref to developer.openstack.org.
whitelist_externals = bash
commands =
bash -c 'rm -rf api-ref/build'
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[flake8]
# H405 is another one that is good as a guideline, but sometimes
# multiline doc strings just don't have a natural summary
# line. Rejecting code for this reason is wrong.
show-source = True
ignore = H405
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[hacking]
import_exceptions = nimble.common.i18n