octavia/tox.ini
Michael Johnson 7fdc8a1e06 Update for new pep8 rules E402 and W503
Change-Id: I181f396b002d0c3b89579c4fc33c34b1c099953e
2017-03-10 22:21:39 +00:00

133 lines
3.9 KiB
INI

[tox]
minversion = 1.6
envlist = docs,py35,py27,functional,pep8,specs
skipsdist = True
[testenv]
usedevelop = True
setenv = VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
install_command =
pip install -U -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
whitelist_externals = find
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/doc-requirements.txt
commands =
{toxinidir}/tools/ostestr_compat_shim.sh {posargs}
[testenv:api-ref]
# This environment is called from CI scripts to test and publish
# the API Ref to developer.openstack.org.
basepython = python2.7
whitelist_externals = rm
commands =
rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[testenv:cover]
whitelist_externals = sh
commands =
sh -c 'COVERAGE_FILE={toxinidir}/.coverage-py27 python setup.py testr --coverage --testr-args='{posargs}''
sh -c 'COVERAGE_FILE={toxinidir}/.coverage-functional OS_TEST_PATH={toxinidir}/octavia/tests/functional python setup.py testr --coverage --testr-args='{posargs}''
sh -c 'ls -al'
coverage combine --debug=dataio {toxinidir}/.coverage-py27 {toxinidir}/.coverage-functional
coverage html -d cover
[testenv:functional]
setenv = OS_TEST_PATH={toxinidir}/octavia/tests/functional
[testenv:functional-py35]
basepython = python3.5
setenv = OS_TEST_PATH={toxinidir}/octavia/tests/functional
[testenv:debug]
commands = oslo_debug_helper {posargs}
[testenv:debug-py27]
basepython = python2.7
commands = oslo_debug_helper {posargs}
[testenv:debug-py35]
basepython = python3.5
commands = oslo_debug_helper {posargs}
[testenv:pep8]
commands = flake8
# RST linter
doc8 specs doc/source octavia \
CONSTITUTION.rst HACKING.rst README.rst
# Run security linter
bandit -r octavia -ll -ii -x octavia/tests
# Make sure specs follow our template
find . -type f -name "*.pyc" -delete
python -m unittest specs-tests.test_titles
sh ./tools/misc-sanity-checks.sh
whitelist_externals =
sh
find
[testenv:docs]
# TODO(johnsom) Remove when the docs utilities support python3.x
basepython = python2.7
whitelist_externals = rm
commands =
rm -rf doc/build api-guide/build api-ref/build
python setup.py build_sphinx
sphinx-build -W -b html api-ref/source api-ref/build/html
[testenv:venv]
commands = {posargs}
[testenv:genconfig]
commands =
oslo-config-generator --output-file etc/octavia/octavia.conf.sample \
--namespace octavia \
--namespace oslo.db \
--namespace oslo.log \
--namespace oslo.messaging \
--namespace keystonemiddleware.auth_token
[testenv:specs]
commands =
find . -type f -name "*.pyc" -delete
python -m unittest specs-tests.test_titles
[testenv:bandit]
commands = bandit -r octavia -ll -ii -x octavia/tests {posargs}
[flake8]
# Ignoring O321 because it's unnecessarily restricting use of json package.
# jsonutils version doesn't add additional value
ignore = O321
show-source = true
builtins = _
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[hacking]
import_exceptions = octavia.i18n
local-check-factory = octavia.hacking.checks.factory
[doc8]
max-line-length = 79
[testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
# If you are running the tests locally you should set the env variable
# TEMPEST_CONFIG_DIR=/opt/stack/tempest/etc
[testenv:apiv1]
passenv = TEMPEST_CONFIG_DIR
setenv =
OS_TEST_PATH={toxinidir}/octavia/tests/tempest/v1/api
OS_TESTR_CONCURRENCY=1
# If you are running the tests locally you should set the env variable
# TEMPEST_CONFIG_DIR=/opt/stack/tempest/etc
[testenv:scenario]
passenv = TEMPEST_CONFIG_DIR
setenv =
OS_TEST_PATH={toxinidir}/octavia/tests/tempest/v1/scenario
OS_TESTR_CONCURRENCY=1