kolla-cli/tox.ini

100 lines
2.7 KiB
INI

[tox]
minversion = 2.5.0
skipsdist = True
envlist = py37,pep8,mypy,py27
[testenv]
usedevelop=True
whitelist_externals = find
bash
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_LOG_CAPTURE OS_TEST_TIMEOUT
PYTHON OS_TEST_PATH LISTOPT IDOPTION
commands =
find . -type f -name "*.py[c|o]" -delete -o -type l -name "*.py[c|o]" -delete
find . -type d -name "__pycache__" -delete
[testenv:py27]
commands = stestr run {posargs}
[testenv:py36]
commands = stestr run {posargs}
[testenv:functional]
whitelist_externals =
{[testenv]whitelist_externals}
{toxinidir}/kolla_cli/tests/functional/functional_test_setup.sh
setenv =
OS_TEST_PATH = ./kolla_cli/tests/functional
KOLLA_ETC = /tmp/kollaclitest/etc/kolla
KOLLA_HOME = /tmp/kollaclitest/usr/share/kolla-ansible
KOLLA_TOOLS_DIR = {toxinidir}/tools
commands =
{[testenv]commands}
{toxinidir}/kolla_cli/tests/functional/functional_test_setup.sh
bash -c "pushd /tmp/kollaclitest/usr/share/kolla-ansible/git; python setup.py install; popd"
stestr run {posargs} --serial
[testenv:functional-py36]
basepython = py36: python3.6
setenv = {[testenv:functional]setenv}
commands = {[testenv:functional]commands}
whitelist_externals = {[testenv:functional]whitelist_externals}
[testenv:pep8]
basepython = python3
deps = {[testenv]deps}
commands =
flake8 {posargs}
doc8 doc/source
# Run security linter
{[testenv:bandit]commands}
[testenv:mypy]
basepython = python3
skip_install = true
whitelist_externals = mypy
commands =
mypy --py2 --ignore-missing-imports kolla_cli
[testenv:venv]
basepython = python3
commands = {posargs}
[flake8]
show-source = True
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[testenv:bandit]
basepython = python3
# Run security linter
commands = bandit -r kolla_cli -x tests
[testenv:docs]
basepython = python3
commands = ./builddocs.sh
[testenv:cover]
basepython = python3
setenv = VIRTUAL_ENV={envdir}
NOSE_WITH_COVERAGE=1
NOSE_COVER_BRANCHES=1
NOSE_COVER_HTML=1
NOSE_COVER_HTML_DIR={toxinidir}/cover
PYTHON=coverage run --source kolla_cli --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt