octavia/tox.ini
Stephen Balukoff 26ab83e9aa Add tox 'specs' test to pep8 environment
It turns out the gate doesn't actually use tox for the docs test,
so in order to catch errors in specs, this commit moves the tox
specs testing to the pep8 environment, where the gate actually does
use tox for the test.

Change-Id: I660d360eed5b109c85d7ba73d421d3973c96c452
2016-09-09 11:10:30 -07:00

91 lines
2.4 KiB
INI

[tox]
minversion = 1.6
envlist = docs,py35,py34,py27,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 =
find . -type f -name "*.pyc" -delete
python setup.py testr --slowest --testr-args='{posargs}'
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'
[testenv:debug]
commands = oslo_debug_helper {posargs}
[testenv:debug-py27]
basepython = python2.7
commands = oslo_debug_helper {posargs}
[testenv:debug-py34]
basepython = python3.4
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
[testenv:docs]
commands =
python setup.py build_sphinx
[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