[tox] minversion = 3.1 skipsdist = True envlist = py37,pep8,mypy ignore_basepython_conflict = True [testenv] basepython = python3 usedevelop=True whitelist_externals = find bash make mkdir mypy rm deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -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 # run stestr test stestr run {posargs} [testenv:debug] description = Allows to run unit-test with debug mode enabled setenv = KOLLA_ETC = /tmp/kollaclitest/etc/kolla KOLLA_HOME = /tmp/kollaclitest/usr/share/kolla-ansible KOLLA_TOOLS_DIR = {toxinidir}/tools 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" oslo_debug_helper -t {toxinidir}/kolla_cli/tests {posargs} [testenv:functional] 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 = find . -type f -name "*.py[c|o]" -delete -o -type l -name "*.py[c|o]" -delete find . -type d -name "__pycache__" -delete {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 = python3.6 setenv = {[testenv:functional]setenv} commands = {[testenv:functional]commands} [testenv:functional-py37] basepython = python3.7 setenv = {[testenv:functional]setenv} commands = {[testenv:functional]commands} [testenv:pep8] deps = {[testenv]deps} commands = flake8 {posargs} doc8 doc/source {[testenv:bandit]commands} [testenv:mypy] skip_install = true commands = mypy --ignore-missing-imports kolla_cli [testenv:venv] commands = {posargs} [flake8] show-source = True exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build [testenv:bandit] # Run security linter commands = bandit -r kolla_cli -x tests [testenv:docs] deps = {[testenv]deps} -r{toxinidir}/doc/requirements.txt commands = rm -rf doc/build sphinx-build -W --keep-going -b html doc/source doc/build/html [testenv:pdf-docs] deps = {[testenv:docs]deps} commands = rm -rf doc/build/pdf mkdir -p doc/build/pdf/_static sphinx-build -W --keep-going -b latex doc/source doc/build/pdf make -C doc/build/pdf [testenv:releasenotes] deps = {[testenv]deps} -r{toxinidir}/doc/requirements.txt commands = rm -rf releasenotes/build sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html [testenv:cover] 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] deps = -c{toxinidir}/lower-constraints.txt -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt