2012-05-03 10:48:26 -07:00
|
|
|
[tox]
|
2015-11-03 16:47:01 -06:00
|
|
|
minversion = 1.8
|
2013-09-30 18:57:43 -04:00
|
|
|
skipsdist = True
|
2014-11-25 16:55:03 +01:00
|
|
|
envlist = py27,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
|
2013-09-30 18:57:43 -04:00
|
|
|
usedevelop = True
|
2015-10-21 09:43:07 +11:00
|
|
|
install_command =
|
|
|
|
constraints: {[testenv:common-constraints]install_command}
|
|
|
|
pip install {opts} {packages}
|
2013-02-11 13:57:27 -06:00
|
|
|
|
2015-11-10 12:55:46 -08:00
|
|
|
# TODO(mriedem): Move oslo.versionedobjects[fixtures] to test-requirements.txt
|
|
|
|
# after I937823ffeb95725f0b55e298ebee1857d6482883 lands.
|
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
|
|
oslo.versionedobjects[fixtures]
|
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'
|
2015-06-19 12:32:01 -06:00
|
|
|
commands = ostestr {posargs}
|
2015-05-29 13:02:13 -06:00
|
|
|
|
2014-03-31 20:37:27 +02:00
|
|
|
whitelist_externals = bash
|
2015-12-10 15:37:34 +00:00
|
|
|
passenv = *_proxy *_PROXY
|
2013-05-16 08:10:27 +00:00
|
|
|
|
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
|
|
|
|
2015-10-21 09:43:07 +11:00
|
|
|
[testenv:common-constraints]
|
|
|
|
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
|
|
|
|
2015-06-23 11:11:04 +02:00
|
|
|
[testenv:py34]
|
|
|
|
commands =
|
2015-10-07 15:33:38 +02:00
|
|
|
ostestr --whitelist_file=tests-py3.txt
|
2015-06-23 11:11:04 +02:00
|
|
|
|
2015-10-21 09:43:07 +11:00
|
|
|
[testenv:py34-constraints]
|
|
|
|
install_command = {[testenv:common-constraints]install_command}
|
|
|
|
commands = {[testenv:py34]commands}
|
|
|
|
|
2012-05-03 10:48:26 -07:00
|
|
|
[testenv:pep8]
|
2012-11-15 11:27:06 -05:00
|
|
|
commands =
|
2013-06-14 23:37:11 +02:00
|
|
|
flake8 {posargs} . cinder/common
|
2014-03-31 20:37:27 +02:00
|
|
|
# Check that .po and .pot files are valid:
|
|
|
|
bash -c "find cinder -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null"
|
2015-11-19 16:30:37 -05:00
|
|
|
{toxinidir}/tools/config/check_uptodate.sh --checkopts
|
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-10-21 09:43:07 +11:00
|
|
|
[testenv:pep8-constraints]
|
|
|
|
install_command = {[testenv:common-constraints]install_command}
|
|
|
|
commands =
|
|
|
|
flake8 {posargs} . cinder/common
|
|
|
|
# Check that .po and .pot files are valid:
|
|
|
|
bash -c "find cinder -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null"
|
2015-10-07 08:53:38 -05:00
|
|
|
{toxinidir}/tools/config/check_uptodate.sh --checkopts
|
2015-10-21 09:43:07 +11:00
|
|
|
{toxinidir}/tools/config/check_uptodate.sh
|
|
|
|
{toxinidir}/tools/check_exec.py {toxinidir}/cinder
|
|
|
|
|
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
|
|
|
|
2015-10-21 09:43:07 +11:00
|
|
|
[testenv:pylint-constraints]
|
|
|
|
install_command = {[testenv:common-constraints]install_command}
|
|
|
|
deps = {[testenv:pylint]deps}
|
|
|
|
commands = {[testenv:pylint]commands}
|
|
|
|
|
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).*$'
|
|
|
|
|
2015-10-21 09:43:07 +11:00
|
|
|
[testenv:cover-constraints]
|
|
|
|
install_command = {[testenv:common-constraints]install_command}
|
|
|
|
commands = {[testenv:cover]commands}
|
|
|
|
|
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
|
2015-08-13 10:17:36 -05:00
|
|
|
commands = {toxinidir}/tools/config/generate_sample.sh from_tox
|
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
|
2015-10-07 08:53:38 -05:00
|
|
|
commands = {toxinidir}/tools/config/generate_sample.sh from_tox --nosamplefile
|
|
|
|
|
2013-05-16 08:10:27 +00:00
|
|
|
[testenv:venv]
|
|
|
|
commands = {posargs}
|
|
|
|
|
2015-10-21 09:43:07 +11:00
|
|
|
[testenv:venv-constraints]
|
|
|
|
install_command = {[testenv:common-constraints]install_command}
|
|
|
|
commands = {posargs}
|
|
|
|
|
2014-08-21 15:52:26 +02:00
|
|
|
[testenv:docs]
|
|
|
|
commands = python setup.py build_sphinx
|
|
|
|
|
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
|
|
|
|
commands = bandit -c tools/bandit.yaml -r cinder -n 5 -ll
|
|
|
|
|
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
|
2013-12-13 13:29:12 +01:00
|
|
|
exclude = .git,.venv,.tox,dist,tools,doc,common,*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
|