
We want to default to running all tox environments under python 3, so set the basepython value in each environment. We do not want to specify a minor version number, because we do not want to have to update the file every time we upgrade python. We do not want to set the override once in testenv, because that breaks the more specific versions used in default environments like py35 and py36. Change-Id: I9a6e4950e2915fb551c35eba8c78a6b4bb4d932b
133 lines
3.8 KiB
INI
133 lines
3.8 KiB
INI
[tox]
|
||
minversion = 2.3.1
|
||
skipsdist = True
|
||
envlist = py{35,27},py{35,27}-{postgresql},functional,cover,pep8,bandit,docs
|
||
|
||
[testenv]
|
||
usedevelop = True
|
||
whitelist_externals = bash
|
||
find
|
||
rm
|
||
flake8
|
||
setenv = VIRTUAL_ENV={envdir}
|
||
OS_TEST_PATH=./deckhand/tests/unit
|
||
LANGUAGE=en_US
|
||
LC_ALL=en_US.utf-8
|
||
passenv = OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_TEST_TIMEOUT OS_TEST_LOCK_PATH OS_TEST_PATH http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY DECKHAND_IMAGE DECKHAND_TEST_URL DECKHAND_TEST_DIR
|
||
deps = -r{toxinidir}/requirements.txt
|
||
-r{toxinidir}/test-requirements.txt
|
||
commands =
|
||
find . -type f -name "*.pyc" -delete
|
||
rm -Rf .testrepository/times.dbm
|
||
|
||
[testenv:py27]
|
||
basepython = python2.7
|
||
commands =
|
||
{[testenv]commands}
|
||
stestr run {posargs}
|
||
stestr slowest
|
||
|
||
[testenv:py27-postgresql]
|
||
basepython = python2.7
|
||
commands =
|
||
{[testenv]commands}
|
||
{toxinidir}/tools/run_pifpaf.sh '{posargs}'
|
||
|
||
[testenv:py35]
|
||
basepython = python3
|
||
commands =
|
||
{[testenv]commands}
|
||
stestr run {posargs}
|
||
stestr slowest
|
||
|
||
[testenv:py35-postgresql]
|
||
basepython = python3
|
||
commands =
|
||
{[testenv]commands}
|
||
{toxinidir}/tools/run_pifpaf.sh '{posargs}'
|
||
|
||
[testenv:functional]
|
||
basepython=python3
|
||
setenv = VIRTUAL_ENV={envdir}
|
||
deps = -r{toxinidir}/requirements.txt
|
||
-r{toxinidir}/test-requirements.txt
|
||
commands =
|
||
find . -type f -name "*.pyc" -delete
|
||
# TODO(felipemonteiro): Use OpenStack test runner.
|
||
py.test -svx {toxinidir}/deckhand/tests/common/test_gabbi.py -k '{posargs}'
|
||
|
||
[testenv:functional-dev]
|
||
basepython=python3
|
||
# Minimalistic functional test job for running Deckhand functional tests
|
||
# via uwsgi. Uses pifpaf for DB instantiation. Useful for developers.
|
||
# Requires PostgreSQL be installed on host.
|
||
setenv = VIRTUAL_ENV={envdir}
|
||
deps = -r{toxinidir}/requirements.txt
|
||
-r{toxinidir}/test-requirements.txt
|
||
commands =
|
||
find . -type f -name "*.pyc" -delete
|
||
pifpaf run postgresql -- {toxinidir}/tools/functional-tests.sh "{posargs}"
|
||
|
||
[testenv:cover]
|
||
basepython = python3
|
||
setenv = {[testenv]setenv}
|
||
PYTHON=coverage run --source deckhand --parallel-mode
|
||
commands =
|
||
coverage erase
|
||
find . -type f -name "*.pyc" -delete
|
||
stestr run {posargs}
|
||
coverage combine
|
||
coverage html -d cover
|
||
coverage xml -o cover/coverage.xml
|
||
coverage report
|
||
|
||
[testenv:bandit]
|
||
basepython = python3
|
||
commands = bandit -r deckhand -x deckhand/tests -n 5
|
||
|
||
[testenv:genconfig]
|
||
basepython = python3
|
||
commands = oslo-config-generator --config-file=etc/deckhand/config-generator.conf
|
||
|
||
[testenv:genpolicy]
|
||
basepython = python3
|
||
commands = oslopolicy-sample-generator --config-file=etc/deckhand/policy-generator.conf
|
||
|
||
[testenv:pep8]
|
||
basepython = python3
|
||
deps =
|
||
.[bandit]
|
||
{[testenv]deps}
|
||
commands =
|
||
flake8 {posargs}
|
||
# Run security linter as part of the pep8 gate instead of using separate job.
|
||
bandit -r deckhand -x deckhand/tests -n 5
|
||
|
||
[flake8]
|
||
# [H106] Don’t put vim configuration in source files.
|
||
# [H203] Use assertIs(Not)None to check for None.
|
||
# [H204] Use assert(Not)Equal to check for equality.
|
||
# [H205] Use assert(Greater|Less)(Equal) for comparison.
|
||
# [H210] Require ‘autospec’, ‘spec’, or ‘spec_set’ in mock.patch/mock.patch.object calls
|
||
# [H904] Delay string interpolations at logging calls.
|
||
enable-extensions = H106,H203,H204,H205,H210,H904
|
||
ignore = H405
|
||
exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,releasenotes,doc,alembic/versions
|
||
|
||
[testenv:docs]
|
||
deps = -r{toxinidir}/doc/requirements.txt
|
||
commands =
|
||
rm -rf doc/build
|
||
rm -rf releasenotes/build
|
||
sphinx-build -W -b html doc/source doc/build/html
|
||
whitelist_externals =
|
||
rm
|
||
|
||
[testenv:releasenotes]
|
||
deps = -r{toxinidir}/doc/requirements.txt
|
||
commands =
|
||
rm -rf releasenotes/build
|
||
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
||
whitelist_externals =
|
||
rm
|