2014-04-18 08:33:16 +00:00
|
|
|
[tox]
|
2019-12-22 15:24:45 +00:00
|
|
|
minversion = 3.1
|
2020-02-03 17:09:41 +00:00
|
|
|
envlist = py37,pep8
|
|
|
|
ignore_basepython_conflict = true
|
2014-04-18 08:33:16 +00:00
|
|
|
|
|
|
|
[testenv]
|
2019-12-22 15:24:45 +00:00
|
|
|
basepython = python3
|
2019-04-02 13:39:50 +00:00
|
|
|
whitelist_externals =
|
|
|
|
env
|
|
|
|
passenv =
|
|
|
|
OS_TEST_DBAPI_ADMIN_CONNECTION
|
2014-04-18 08:33:16 +00:00
|
|
|
setenv =
|
2019-04-02 13:39:50 +00:00
|
|
|
BASECOMMAND=stestr run
|
|
|
|
{postgresql,all}: PIFPAF_POSTGRESQL=pifpaf -g OS_TEST_DBAPI_ADMIN_CONNECTION run postgresql --
|
|
|
|
{mysql,all}: PIFPAF_MYSQL=pifpaf -g OS_TEST_DBAPI_ADMIN_CONNECTION run mysql --
|
|
|
|
{mysql,postgresql,all}: BASECOMMAND={toxinidir}/tools/run-pifpaf-tests.sh
|
2018-03-08 13:57:56 +00:00
|
|
|
deps =
|
2019-12-22 15:24:45 +00:00
|
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2019-04-02 13:39:50 +00:00
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-r{toxinidir}/requirements.txt
|
2016-07-18 20:02:42 +00:00
|
|
|
commands =
|
2019-12-22 15:24:45 +00:00
|
|
|
env TEST_EVENTLET=0 {env:PIFPAF_MYSQL:} {env:PIFPAF_POSTGRESQL:} {env:BASECOMMAND:} {posargs}
|
|
|
|
env TEST_EVENTLET=1 {env:PIFPAF_MYSQL:} {env:PIFPAF_POSTGRESQL:} {env:BASECOMMAND:} {posargs}
|
2014-07-02 08:23:19 +00:00
|
|
|
|
2014-04-18 08:33:16 +00:00
|
|
|
[testenv:pep8]
|
2017-11-30 05:27:33 +00:00
|
|
|
commands =
|
|
|
|
flake8
|
|
|
|
# Run security linter
|
|
|
|
bandit -r oslo_db -x tests -n5 --skip B105,B311
|
2014-04-18 08:33:16 +00:00
|
|
|
|
|
|
|
[testenv:venv]
|
|
|
|
commands = {posargs}
|
|
|
|
|
|
|
|
[testenv:cover]
|
2018-07-12 07:27:07 +00:00
|
|
|
setenv =
|
2019-04-02 13:39:50 +00:00
|
|
|
PYTHON=coverage run --source oslo_db --parallel-mode
|
2018-07-12 07:27:07 +00:00
|
|
|
commands =
|
2019-04-02 13:39:50 +00:00
|
|
|
stestr run {posargs}
|
|
|
|
coverage combine
|
|
|
|
coverage html -d cover
|
|
|
|
coverage xml -o cover/coverage.xml
|
2014-04-18 08:33:16 +00:00
|
|
|
|
2014-05-30 08:58:09 +00:00
|
|
|
[testenv:docs]
|
2019-04-02 13:39:50 +00:00
|
|
|
whitelist_externals =
|
|
|
|
rm
|
|
|
|
deps =
|
|
|
|
{[testenv]deps}
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2014-05-30 08:58:09 +00:00
|
|
|
commands =
|
2019-04-02 13:39:50 +00:00
|
|
|
rm -rf doc/build doc/source/reference/api
|
|
|
|
doc8 -e .rst CONTRIBUTING.rst HACKING.rst README.rst doc/source
|
2019-10-24 06:09:59 +00:00
|
|
|
sphinx-build -W --keep-going -b html doc/source doc/build/html
|
2014-05-30 08:58:09 +00:00
|
|
|
|
2016-02-23 19:22:14 +00:00
|
|
|
[testenv:releasenotes]
|
2019-10-24 06:09:59 +00:00
|
|
|
whitelist_externals =
|
|
|
|
rm
|
2019-12-22 15:24:45 +00:00
|
|
|
deps =
|
|
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2019-10-24 06:09:59 +00:00
|
|
|
commands =
|
|
|
|
rm -rf releasenotes/build
|
|
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
|
2016-02-23 19:22:14 +00:00
|
|
|
|
2014-04-18 08:33:16 +00:00
|
|
|
[flake8]
|
|
|
|
# E123, E125 skipped as they are invalid PEP-8.
|
2015-08-08 02:12:44 +00:00
|
|
|
ignore = E123,E125
|
2014-04-18 08:33:16 +00:00
|
|
|
show-source = True
|
2016-05-11 11:32:58 +00:00
|
|
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
2014-05-27 08:59:18 +00:00
|
|
|
|
|
|
|
[hacking]
|
|
|
|
import_exceptions =
|
2014-12-12 19:23:13 +00:00
|
|
|
oslo_db._i18n
|
2015-06-26 01:25:35 +00:00
|
|
|
|
2019-06-26 14:03:39 +00:00
|
|
|
[testenv:bindep]
|
|
|
|
# Do not install any requirements. We want this to be fast and work even if
|
|
|
|
# system dependencies are missing, since it's used to tell you what system
|
|
|
|
# dependencies are missing! This also means that bindep must be installed
|
|
|
|
# separately, outside of the requirements files, and develop mode disabled
|
|
|
|
# explicitly to avoid unnecessarily installing the checked-out repo too (this
|
|
|
|
# further relies on "tox.skipsdist = True" above).
|
|
|
|
deps = bindep
|
|
|
|
commands = bindep test
|
|
|
|
usedevelop = False
|
|
|
|
|
2018-03-22 21:33:47 +00:00
|
|
|
[testenv:lower-constraints]
|
|
|
|
deps =
|
|
|
|
-c{toxinidir}/lower-constraints.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-r{toxinidir}/requirements.txt
|