2012-05-03 10:48:26 -07:00
|
|
|
[tox]
|
2016-07-12 18:00:40 -04:00
|
|
|
minversion = 2.0
|
2013-09-30 18:57:43 -04:00
|
|
|
skipsdist = True
|
2016-12-09 14:22:28 -06:00
|
|
|
envlist = py35,py27,compliance,pep8
|
2012-05-03 10:48:26 -07:00
|
|
|
|
|
|
|
[testenv]
|
2014-07-25 14:33:10 -07:00
|
|
|
# Note the hash seed is set to 0 until cinder can be tested with a
|
|
|
|
# random hash seed successfully.
|
2012-05-03 10:48:26 -07:00
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
2014-07-25 14:33:10 -07:00
|
|
|
PYTHONHASHSEED=0
|
2016-09-30 17:01:08 +08:00
|
|
|
PYTHONWARNINGS=default::DeprecationWarning
|
2013-09-30 18:57:43 -04:00
|
|
|
usedevelop = True
|
2016-02-26 19:44:07 +01:00
|
|
|
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
2013-02-11 13:57:27 -06:00
|
|
|
|
2015-11-10 12:55:46 -08:00
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2015-05-29 13:02:13 -06:00
|
|
|
|
2015-06-19 12:32:01 -06:00
|
|
|
# By default ostestr will set concurrency
|
|
|
|
# to ncpu, to specify something else use
|
|
|
|
# the concurrency=<n> option.
|
2015-05-29 13:02:13 -06:00
|
|
|
# call ie: 'tox -epy27 -- --concurrency=4'
|
2016-07-08 12:01:29 +02:00
|
|
|
commands =
|
|
|
|
find . -type f -name "*.pyc" -delete
|
|
|
|
ostestr {posargs}
|
2015-05-29 13:02:13 -06:00
|
|
|
|
2016-07-08 12:01:29 +02:00
|
|
|
whitelist_externals =
|
|
|
|
bash
|
|
|
|
find
|
2015-12-10 15:37:34 +00:00
|
|
|
passenv = *_proxy *_PROXY
|
2013-05-16 08:10:27 +00:00
|
|
|
|
2016-05-13 00:33:12 +05:30
|
|
|
[testenv:api-ref]
|
|
|
|
# (sheel)This environment is called from CI scripts to test and publish
|
|
|
|
# the API Ref to developer.openstack.org.
|
2016-05-14 11:30:24 +02:00
|
|
|
whitelist_externals = rm
|
2016-05-17 22:49:47 +05:30
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2016-05-13 00:33:12 +05:30
|
|
|
commands =
|
2016-05-17 22:49:47 +05:30
|
|
|
rm -rf api-ref/build
|
2016-08-27 16:55:32 +02:00
|
|
|
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html/
|
2016-05-13 00:33:12 +05:30
|
|
|
|
2015-11-04 17:07:04 +01:00
|
|
|
[testenv:releasenotes]
|
2015-11-26 10:15:32 +01:00
|
|
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
2015-11-04 17:07:04 +01:00
|
|
|
|
2016-01-14 22:20:56 +02:00
|
|
|
[testenv:functional]
|
|
|
|
setenv =
|
|
|
|
OS_TEST_PATH = ./cinder/tests/functional
|
|
|
|
|
2016-08-03 12:39:05 -04:00
|
|
|
[testenv:functional-py34]
|
2016-08-10 10:07:35 -04:00
|
|
|
[testenv:functional-py35]
|
|
|
|
basepython=
|
|
|
|
py34: python3.4
|
|
|
|
py35: python3.5
|
2016-08-03 12:39:05 -04:00
|
|
|
setenv =
|
|
|
|
{[testenv:functional]setenv}
|
|
|
|
|
2016-03-23 16:39:07 -05:00
|
|
|
[testenv:compliance]
|
|
|
|
setenv =
|
|
|
|
OS_TEST_PATH = ./cinder/tests/compliance
|
|
|
|
|
2012-05-03 10:48:26 -07:00
|
|
|
[testenv:pep8]
|
2012-11-15 11:27:06 -05:00
|
|
|
commands =
|
2016-01-21 14:12:56 +01:00
|
|
|
flake8 {posargs} .
|
2015-08-13 10:17:36 -05:00
|
|
|
{toxinidir}/tools/config/check_uptodate.sh
|
2015-08-28 14:32:30 -04:00
|
|
|
{toxinidir}/tools/check_exec.py {toxinidir}/cinder
|
2012-05-03 10:48:26 -07:00
|
|
|
|
2015-09-22 15:43:51 -04:00
|
|
|
[testenv:fast8]
|
2015-10-12 10:58:48 -04:00
|
|
|
# Use same environment directory as pep8 env to save space and install time
|
|
|
|
envdir = {toxworkdir}/pep8
|
2015-09-22 15:43:51 -04:00
|
|
|
commands =
|
|
|
|
{toxinidir}/tools/fast8.sh
|
|
|
|
|
2013-05-09 21:31:23 -04:00
|
|
|
[testenv:pylint]
|
2013-06-01 16:20:45 +02:00
|
|
|
deps = -r{toxinidir}/requirements.txt
|
2013-05-09 21:31:23 -04:00
|
|
|
pylint==0.26.0
|
|
|
|
commands = bash tools/lintstack.sh
|
2013-04-20 21:44:09 -07:00
|
|
|
|
2013-05-16 08:10:27 +00:00
|
|
|
[testenv:cover]
|
|
|
|
# Also do not run test_coverage_ext tests while gathering coverage as those
|
|
|
|
# tests conflict with coverage.
|
|
|
|
commands =
|
|
|
|
python setup.py testr --coverage \
|
|
|
|
--testr-args='^(?!.*test.*coverage).*$'
|
2016-06-24 23:10:14 +00:00
|
|
|
coverage report
|
2013-05-16 08:10:27 +00:00
|
|
|
|
2014-06-20 13:19:42 -04:00
|
|
|
[testenv:genconfig]
|
2014-07-15 11:45:17 -06:00
|
|
|
sitepackages = False
|
2015-11-19 16:48:27 -05:00
|
|
|
envdir = {toxworkdir}/pep8
|
2016-05-09 13:12:37 -05:00
|
|
|
commands = oslo-config-generator --config-file=cinder/config/cinder-config-generator.conf
|
2014-06-20 13:19:42 -04:00
|
|
|
|
2015-10-07 08:53:38 -05:00
|
|
|
[testenv:genopts]
|
|
|
|
sitepackages = False
|
2015-11-19 16:48:27 -05:00
|
|
|
envdir = {toxworkdir}/pep8
|
2016-05-09 13:12:37 -05:00
|
|
|
commands = python cinder/config/generate_cinder_opts.py
|
2015-10-07 08:53:38 -05:00
|
|
|
|
2013-05-16 08:10:27 +00:00
|
|
|
[testenv:venv]
|
2015-10-21 09:43:07 +11:00
|
|
|
commands = {posargs}
|
|
|
|
|
2014-08-21 15:52:26 +02:00
|
|
|
[testenv:docs]
|
2016-08-23 13:14:59 -04:00
|
|
|
commands =
|
2016-07-23 12:13:34 -05:00
|
|
|
python setup.py build_sphinx
|
2016-05-29 16:37:06 +05:30
|
|
|
rm -rf api-ref/build
|
2016-08-27 16:55:32 +02:00
|
|
|
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html/
|
2016-12-13 17:28:24 +08:00
|
|
|
whitelist_externals = rm
|
2014-08-21 15:52:26 +02:00
|
|
|
|
2015-06-17 18:57:34 +03:00
|
|
|
[testenv:gendriverlist]
|
|
|
|
sitepackages = False
|
|
|
|
envdir = {toxworkdir}/venv
|
|
|
|
commands = python {toxinidir}/tools/generate_driver_list.py
|
|
|
|
|
2015-05-02 00:13:06 -07:00
|
|
|
[testenv:bandit]
|
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2016-03-18 10:57:59 -05:00
|
|
|
commands = bandit -r cinder -n5 -x tests -ll
|
2015-05-02 00:13:06 -07:00
|
|
|
|
2013-04-20 21:44:09 -07:00
|
|
|
[flake8]
|
2014-07-31 10:17:54 +02:00
|
|
|
# Following checks are ignored on purpose.
|
|
|
|
#
|
|
|
|
# E251 unexpected spaces around keyword / parameter equals
|
|
|
|
# reason: no improvement in readability
|
2016-01-05 10:37:42 +02:00
|
|
|
ignore = E251
|
2016-06-28 18:11:40 +02:00
|
|
|
exclude = .git,.venv,.tox,dist,tools,doc/ext,*egg,build
|
2014-10-16 22:43:20 -06:00
|
|
|
max-complexity=30
|
2014-05-12 18:28:58 +02:00
|
|
|
|
|
|
|
[hacking]
|
|
|
|
local-check-factory = cinder.hacking.checks.factory
|
2014-08-07 04:45:39 +00:00
|
|
|
import_exceptions = cinder.i18n
|
2016-01-15 12:46:09 -05:00
|
|
|
|
|
|
|
[testenv:pip-missing-reqs]
|
|
|
|
# do not install test-requirements as that will pollute the virtualenv for
|
|
|
|
# determining missing packages
|
|
|
|
# this also means that pip-missing-reqs must be installed separately, outside
|
|
|
|
# of the requirements.txt files
|
2016-08-08 16:24:34 -04:00
|
|
|
deps = pip_check_reqs>=2.0.1
|
2016-01-15 12:46:09 -05:00
|
|
|
commands = pip-missing-reqs -d --ignore-file=cinder/tests/* cinder
|