2014-06-25 02:58:49 -07:00
|
|
|
[tox]
|
|
|
|
minversion = 1.6
|
2017-01-24 14:12:53 -08:00
|
|
|
envlist = docs,py35,py27,functional,pep8,specs
|
2014-06-25 02:58:49 -07:00
|
|
|
skipsdist = True
|
|
|
|
|
|
|
|
[testenv]
|
|
|
|
usedevelop = True
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
2016-08-09 19:00:22 -04:00
|
|
|
PYTHONWARNINGS=default::DeprecationWarning
|
2016-06-01 13:56:08 +02:00
|
|
|
install_command =
|
|
|
|
pip install -U -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
2015-03-31 11:18:31 -05:00
|
|
|
whitelist_externals = find
|
2014-06-25 02:58:49 -07:00
|
|
|
deps = -r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2015-02-16 12:33:13 -07:00
|
|
|
-r{toxinidir}/doc-requirements.txt
|
2015-03-31 11:18:31 -05:00
|
|
|
commands =
|
2017-01-01 01:50:56 -08:00
|
|
|
{toxinidir}/tools/ostestr_compat_shim.sh {posargs}
|
2014-06-25 02:58:49 -07:00
|
|
|
|
2017-02-10 14:04:20 -08:00
|
|
|
[testenv:api-ref]
|
|
|
|
# This environment is called from CI scripts to test and publish
|
|
|
|
# the API Ref to developer.openstack.org.
|
|
|
|
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
|
|
|
|
|
2015-03-27 16:10:59 +00:00
|
|
|
[testenv:cover]
|
2016-10-04 17:22:38 +00:00
|
|
|
whitelist_externals = sh
|
|
|
|
commands =
|
2017-04-18 15:28:10 -07:00
|
|
|
coverage erase
|
2016-10-04 17:22:38 +00:00
|
|
|
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}''
|
2017-04-18 15:28:10 -07:00
|
|
|
coverage combine {toxinidir}/.coverage-py27 {toxinidir}/.coverage-functional
|
|
|
|
coverage report --fail-under=80 --skip-covered
|
2017-04-23 11:12:50 -07:00
|
|
|
# Generate a new HTML report with the combined results
|
|
|
|
# otherwise the HTML report will only show partial results
|
|
|
|
coverage html -d cover
|
2015-03-27 16:10:59 +00:00
|
|
|
|
2015-04-09 15:25:25 -05:00
|
|
|
[testenv:functional]
|
|
|
|
setenv = OS_TEST_PATH={toxinidir}/octavia/tests/functional
|
|
|
|
|
2016-10-04 17:22:38 +00:00
|
|
|
[testenv:functional-py35]
|
|
|
|
basepython = python3.5
|
|
|
|
setenv = OS_TEST_PATH={toxinidir}/octavia/tests/functional
|
|
|
|
|
2016-01-13 13:12:37 +08:00
|
|
|
[testenv:debug]
|
|
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
|
|
|
|
[testenv:debug-py27]
|
|
|
|
basepython = python2.7
|
|
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
|
2016-07-12 21:12:27 +05:30
|
|
|
[testenv:debug-py35]
|
|
|
|
basepython = python3.5
|
|
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
|
2014-06-25 02:58:49 -07:00
|
|
|
[testenv:pep8]
|
|
|
|
commands = flake8
|
2016-09-02 14:57:08 +02:00
|
|
|
# RST linter
|
2014-07-30 00:59:02 -07:00
|
|
|
doc8 specs doc/source octavia \
|
2016-11-28 17:30:04 -06:00
|
|
|
CONSTITUTION.rst HACKING.rst README.rst TESTING.rst
|
2016-09-02 14:57:08 +02:00
|
|
|
# Run security linter
|
2016-09-07 21:30:38 +00:00
|
|
|
bandit -r octavia -ll -ii -x octavia/tests
|
2016-12-15 00:46:17 +00:00
|
|
|
# Make sure specs follow our template
|
2016-09-08 18:11:36 -07:00
|
|
|
find . -type f -name "*.pyc" -delete
|
|
|
|
python -m unittest specs-tests.test_titles
|
2016-12-15 00:46:17 +00:00
|
|
|
sh ./tools/misc-sanity-checks.sh
|
|
|
|
whitelist_externals =
|
|
|
|
sh
|
|
|
|
find
|
2014-06-25 02:58:49 -07:00
|
|
|
|
|
|
|
[testenv:docs]
|
2017-02-10 14:04:20 -08:00
|
|
|
whitelist_externals = rm
|
2016-03-24 18:03:27 +00:00
|
|
|
commands =
|
2017-02-10 14:04:20 -08:00
|
|
|
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
|
2014-06-25 02:58:49 -07:00
|
|
|
|
2015-09-30 16:31:55 +00:00
|
|
|
[testenv:venv]
|
|
|
|
commands = {posargs}
|
|
|
|
|
2015-08-25 17:36:27 +02:00
|
|
|
[testenv:genconfig]
|
2017-03-25 17:21:13 +08:00
|
|
|
whitelist_externals = mkdir
|
2015-08-25 17:36:27 +02:00
|
|
|
commands =
|
2017-03-25 17:21:13 +08:00
|
|
|
mkdir -p etc/octavia
|
2015-08-25 17:36:27 +02:00
|
|
|
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
|
|
|
|
|
2017-06-09 18:53:18 -07:00
|
|
|
[testenv:genpolicy]
|
|
|
|
whitelist_externals = mkdir
|
|
|
|
commands =
|
|
|
|
mkdir -p etc/octavia
|
|
|
|
oslopolicy-sample-generator \
|
|
|
|
--config-file etc/policy/octavia-policy-generator.conf \
|
|
|
|
--output-file etc/octavia/json.policy.sample
|
|
|
|
|
2015-04-17 11:46:44 -05:00
|
|
|
[testenv:specs]
|
2017-06-20 09:36:12 -07:00
|
|
|
whitelist_externals =
|
|
|
|
rm
|
|
|
|
find
|
2015-04-17 11:46:44 -05:00
|
|
|
commands =
|
|
|
|
find . -type f -name "*.pyc" -delete
|
2017-04-24 16:37:23 -04:00
|
|
|
rm -f .testrepository/times.dbm
|
2015-04-17 11:46:44 -05:00
|
|
|
python -m unittest specs-tests.test_titles
|
|
|
|
|
2016-03-01 15:23:51 -08:00
|
|
|
|
|
|
|
[testenv:bandit]
|
2016-09-07 21:30:38 +00:00
|
|
|
commands = bandit -r octavia -ll -ii -x octavia/tests {posargs}
|
2016-03-01 15:23:51 -08:00
|
|
|
|
2014-06-25 02:58:49 -07:00
|
|
|
[flake8]
|
2017-06-06 15:17:14 -07:00
|
|
|
ignore =
|
2014-06-25 02:58:49 -07:00
|
|
|
show-source = true
|
2014-08-28 23:38:38 -07:00
|
|
|
builtins = _
|
2016-06-06 06:13:43 -07:00
|
|
|
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
2017-07-06 03:59:23 -04:00
|
|
|
# [H904] Delay string interpolations at logging calls.
|
|
|
|
enable-extensions=H904
|
2014-07-30 00:59:02 -07:00
|
|
|
|
2014-12-01 22:05:29 -07:00
|
|
|
[hacking]
|
|
|
|
import_exceptions = octavia.i18n
|
|
|
|
local-check-factory = octavia.hacking.checks.factory
|
|
|
|
|
2014-07-30 00:59:02 -07:00
|
|
|
[doc8]
|
|
|
|
max-line-length = 79
|
2015-12-04 13:14:06 -06:00
|
|
|
|
|
|
|
[testenv:releasenotes]
|
|
|
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
2015-04-09 15:25:25 -05:00
|
|
|
|
|
|
|
# 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
|