2012-10-26 13:21:45 -04:00
|
|
|
[tox]
|
2016-09-09 09:33:49 -04:00
|
|
|
envlist = py{27,34,35},pep8,apiexamples,cover,api-ref,releasenotes,bandit,fakemodetests,pylint
|
2013-12-09 15:27:35 +02:00
|
|
|
minversion = 1.6
|
|
|
|
skipsdist = True
|
2012-09-04 21:07:13 -05:00
|
|
|
|
2012-10-26 13:21:45 -04:00
|
|
|
[testenv]
|
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
2016-10-21 01:32:00 -07:00
|
|
|
PYTHONWARNINGS=default::DeprecationWarning
|
2017-09-25 07:49:32 -05:00
|
|
|
OS_TEST_PATH=./trove/tests/unittests
|
|
|
|
OS_STDOUT_CAPTURE=1
|
|
|
|
OS_STDERR_CAPTURE=1
|
|
|
|
|
2013-12-09 15:27:35 +02:00
|
|
|
usedevelop = True
|
2016-08-29 11:27:51 -04:00
|
|
|
install_command = pip install \
|
|
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} \
|
|
|
|
-U {opts} {packages}
|
2013-06-03 18:42:06 -04:00
|
|
|
deps = -r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2015-11-16 14:11:00 -06:00
|
|
|
commands = find ./trove -type f -name "*.pyc" -delete
|
2016-08-29 11:27:51 -04:00
|
|
|
rm -f trove_test.sqlite
|
2018-04-16 16:59:54 +08:00
|
|
|
stestr run --serial '{posargs}'
|
|
|
|
stestr slowest
|
2016-08-29 11:27:51 -04:00
|
|
|
whitelist_externals = find
|
|
|
|
rm
|
|
|
|
bash
|
2012-05-23 09:32:49 -05:00
|
|
|
|
2012-10-26 13:21:45 -04:00
|
|
|
[tox:jenkins]
|
|
|
|
sitepackages = True
|
|
|
|
|
|
|
|
[testenv:pep8]
|
2016-08-29 11:27:51 -04:00
|
|
|
basepython = python2.7
|
2014-03-31 22:34:57 +02:00
|
|
|
commands =
|
|
|
|
flake8
|
2017-11-30 08:27:38 +07:00
|
|
|
doc8 {posargs}
|
2012-10-26 13:21:45 -04:00
|
|
|
|
2016-08-29 11:27:51 -04:00
|
|
|
[testenv:apiexamples]
|
|
|
|
commands = {envpython} generate_examples.py
|
|
|
|
|
|
|
|
[testenv:fakemodetests]
|
|
|
|
commands = {envpython} run_tests.py
|
2016-02-11 15:25:07 +01:00
|
|
|
|
2016-01-09 17:26:33 +08:00
|
|
|
[testenv:debug]
|
|
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
|
2012-10-26 13:21:45 -04:00
|
|
|
[testenv:cover]
|
2013-02-12 11:21:30 -06:00
|
|
|
basepython = python2.7
|
2012-11-16 11:50:34 -06:00
|
|
|
commands =
|
2016-08-29 11:27:51 -04:00
|
|
|
{[testenv]commands}
|
2013-01-23 11:46:29 -08:00
|
|
|
coverage erase
|
2016-09-15 13:21:31 -05:00
|
|
|
python setup.py testr --coverage --testr-args="--concurrency=1"
|
2013-03-06 18:24:17 -06:00
|
|
|
coverage run -a run_tests.py
|
|
|
|
coverage html
|
2015-07-10 16:43:17 -05:00
|
|
|
coverage xml
|
2013-01-23 11:46:29 -08:00
|
|
|
coverage report
|
2012-11-16 11:50:34 -06:00
|
|
|
|
2012-10-26 13:21:45 -04:00
|
|
|
[testenv:venv]
|
|
|
|
commands = {posargs}
|
2013-05-16 10:07:14 -07:00
|
|
|
|
2017-11-30 08:27:38 +07:00
|
|
|
[doc8]
|
|
|
|
ignore-path = .venv,.tox,.git,dist,doc,*egg-info,tools,etc,build,*.po,*.pot,integration,releasenotes,*.txt,api-ref/source/samples
|
|
|
|
|
2013-05-16 10:07:14 -07:00
|
|
|
[flake8]
|
|
|
|
show-source = True
|
2015-05-20 19:53:12 +00:00
|
|
|
# H301 is ignored on purpose.
|
2014-10-22 20:50:38 +02:00
|
|
|
# The rest of the ignores are TODOs.
|
2017-03-09 15:25:42 -05:00
|
|
|
ignore = F821,H301,H404,H405,H501,E402,W503,E731
|
2016-11-17 06:11:39 -05:00
|
|
|
enable-extensions = H203,H106
|
2013-05-16 10:07:14 -07:00
|
|
|
builtins = _
|
2016-11-28 14:06:58 -05:00
|
|
|
exclude=.venv,.tox,.git,dist,doc,*egg,tools,etc,build,*.po,*.pot,integration,releasenotes
|
2017-11-28 15:19:05 +07:00
|
|
|
filename=*.py,trove-*,app.wsgi
|
2014-04-24 14:41:40 -05:00
|
|
|
|
2016-12-05 11:41:47 -06:00
|
|
|
[hacking]
|
|
|
|
import_exceptions = trove.common.i18n
|
2017-02-09 20:01:36 -08:00
|
|
|
local-check-factory = trove.hacking.checks.factory
|
2016-12-05 11:41:47 -06:00
|
|
|
|
2016-08-17 13:27:51 -04:00
|
|
|
[testenv:api-ref]
|
|
|
|
# This environment is called from CI scripts to test and publish
|
|
|
|
# the API Ref to developer.openstack.org.
|
|
|
|
commands =
|
|
|
|
rm -rf api-ref/build
|
|
|
|
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
|
|
|
|
|
2015-11-03 17:43:44 -06:00
|
|
|
[testenv:releasenotes]
|
2015-12-02 13:13:19 -06:00
|
|
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
2016-02-22 09:33:58 -05:00
|
|
|
|
|
|
|
[testenv:bandit]
|
|
|
|
commands = bandit -r trove -n5 -x tests
|
2016-06-16 15:20:28 +02:00
|
|
|
|
2018-02-07 18:08:04 +08:00
|
|
|
[testenv:bandit-baseline]
|
|
|
|
envdir = {toxworkdir}/bandit
|
|
|
|
commands = bandit-baseline -r trove -n5 -x tests -ii -ll
|
|
|
|
|
2018-02-12 15:19:58 +08:00
|
|
|
[testenv:genpolicy]
|
|
|
|
commands = oslopolicy-sample-generator --config-file=tools/trove-policy-generator.conf
|
|
|
|
|
2016-09-09 09:33:49 -04:00
|
|
|
[testenv:pylint]
|
|
|
|
deps = -r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
commands = {[testenv]commands}
|
2016-09-19 08:26:24 -04:00
|
|
|
python tools/trove-pylint.py {posargs:check}
|
|
|
|
|
2018-03-22 19:07:53 -04:00
|
|
|
|
|
|
|
[testenv:lower-constraints]
|
|
|
|
basepython = python3
|
|
|
|
deps =
|
|
|
|
-c{toxinidir}/lower-constraints.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-r{toxinidir}/requirements.txt
|