111 lines
3.3 KiB
INI
111 lines
3.3 KiB
INI
[tox]
|
|
minversion = 2.0
|
|
envlist = py27, py36, flake8
|
|
skipsdist = True
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
usedevelop=True
|
|
|
|
[testenv]
|
|
setenv = OS_STDOUT_CAPTURE=1
|
|
OS_STDERR_CAPTURE=1
|
|
OS_TEST_TIMEOUT=60
|
|
OS_TEST_PATH=./cinderlib/tests/unit
|
|
install_command = pip install {opts} {packages}
|
|
deps= -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
commands =
|
|
find . -ignore_readdir_race -type f -name "*.pyc" -delete
|
|
stestr run {posargs}
|
|
stestr slowest
|
|
|
|
whitelist_externals =
|
|
bash
|
|
find
|
|
passenv = *_proxy *_PROXY
|
|
|
|
[testenv:functional]
|
|
basepython=python2.7
|
|
setenv = OS_TEST_PATH=./cinderlib/tests/functional
|
|
CL_FTEST_CFG={env:CL_FTEST_CFG:{toxinidir}/tools/lvm.yaml}
|
|
CL_FTEST_ROOT_HELPER={env:CL_FTEST_ROOT_HELPER:{toxinidir}/tools/virtualenv-sudo.sh}
|
|
sitepackages = True
|
|
# Not reusing py27's env due to https://github.com/tox-dev/tox/issues/477
|
|
# envdir = {toxworkdir}/py27
|
|
|
|
# Must run serially or test_stats_with_creation may fail occasionally
|
|
commands =
|
|
find . -ignore_readdir_race -type f -name "*.pyc" -delete
|
|
stestr run --serial {posargs}
|
|
stestr slowest
|
|
|
|
whitelist_externals =
|
|
bash
|
|
find
|
|
|
|
[testenv:functional-py35]
|
|
setenv =
|
|
{[testenv:functional]setenv}
|
|
sitepackages = True
|
|
basepython=python3.5
|
|
# Not reusing py35's env due to https://github.com/tox-dev/tox/issues/477
|
|
# envdir = {toxworkdir}/py35
|
|
commands = {[testenv:functional]commands}
|
|
whitelist_externals = {[testenv:functional]whitelist_externals}
|
|
|
|
[testenv:releasenotes]
|
|
# Not reusing doc's env due to https://github.com/tox-dev/tox/issues/477
|
|
# envdir = {toxworkdir}/docs
|
|
basepython = python3
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
|
|
[testenv:docs]
|
|
basepython = python3
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
doc8 --ignore D001 --ignore-path .tox --ignore-path *.egg-info --ignore-path doc/build --ignore-path .eggs/*/EGG-INFO/*.txt -e txt -e rst
|
|
rm -rf doc/build .autogenerated doc/source/api
|
|
sphinx-build -W -b html doc/source doc/build/html
|
|
rm -rf api-ref/build
|
|
whitelist_externals = rm
|
|
|
|
[testenv:pylint]
|
|
basepython = python3
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
-r{toxinidir}/requirements.txt
|
|
pylint==2.1.1
|
|
commands =
|
|
bash ./tools/coding-checks.sh --pylint {posargs}
|
|
|
|
[testenv:cover]
|
|
# Also do not run test_coverage_ext tests while gathering coverage as those
|
|
# tests conflict with coverage.
|
|
basepython = python3
|
|
setenv =
|
|
{[testenv]setenv}
|
|
PYTHON=coverage run --source cinderlib --parallel-mode
|
|
commands =
|
|
stestr run {posargs}
|
|
coverage combine
|
|
coverage html -d cover
|
|
coverage xml -o cover/coverage.xml
|
|
|
|
[testenv:flake8]
|
|
basepython=python3
|
|
commands=flake8 cinderlib
|
|
deps=
|
|
flake8
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
[testenv:fast8]
|
|
basepython=python3
|
|
# Not reusing Flake8's env due to https://github.com/tox-dev/tox/issues/477
|
|
# envdir = {toxworkdir}/flake8
|
|
commands={toxinidir}/tools/fast8.sh
|
|
passenv = FAST8_NUM_COMMITS
|