aodh/tox.ini
Doug Hellmann ed99254573 fix tox python3 overrides
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: I8049df0d8241271122c0587b639c135836846827
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 16:05:56 -04:00

85 lines
2.4 KiB
INI

[tox]
minversion = 1.6
skipsdist = True
envlist = py{27,35}{,-mysql,-postgresql},functional,pep8
[testenv]
# NOTE(tonyb): This project has chosen to *NOT* consume upper-constraints.txt
usedevelop = True
setenv =
AODH_TEST_DRIVERS=postgresql mysql
mysql: AODH_TEST_DRIVERS=mysql
postgresql: AODH_TEST_DRIVERS=postgresql
AODH_TEST_DEPS=postgresql,mysql
mysql: AODH_TEST_DEPS=mysql
postgresql: AODH_TEST_DEPS=postgresql
deps = .[test,{env:AODH_TEST_DEPS}]
passenv = OS_TEST_TIMEOUT OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_LOG_CAPTURE AODH_TEST_DRIVERS
commands =
{toxinidir}/run-tests.sh {posargs}
{toxinidir}/run-functional-tests.sh "{posargs}"
aodh-config-generator
whitelist_externals = bash
[testenv:cover]
basepython = python3
commands =
pifpaf -g AODH_TEST_STORAGE_URL run mysql -- python setup.py testr --slowest --coverage --testr-args="{posargs}"
coverage report
[testenv:pep8]
basepython = python3
deps = hacking>=0.12,<0.13
commands =
flake8
# Check that .po and .pot files are valid:
bash -c "find aodh -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null"
[testenv:releasenotes]
basepython = python3
deps = -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 = -r{toxinidir}/doc/requirements.txt
commands = python setup.py build_sphinx
setenv = PYTHONHASHSEED=0
[testenv:venv]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands = {posargs}
setenv = PYTHONHASHSEED=0
[testenv:debug]
basepython = python3
commands = bash -x oslo_debug_helper {posargs}
[testenv:debug-mysql]
basepython = python3
deps = .[mysql,test]
setenv = OS_TEST_PATH=aodh/tests/functional/
commands = pifpaf -g AODH_TEST_STORAGE_URL run mysql -- oslo_debug_helper {posargs}
[testenv:debug-pgsql]
basepython = python3
deps = .[postgresql,test]
setenv = OS_TEST_PATH=aodh/tests/functional/
commands = pifpaf -g AODH_TEST_STORAGE_URL run postgresql -- oslo_debug_helper {posargs}
[flake8]
ignore =
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
# [H106] Do not 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.
enable-extensions=H106,H203,H204,H205
show-source = True
[hacking]
import_exceptions =
aodh.i18n