2013-12-16 15:38:02 -08:00
|
|
|
[tox]
|
2018-11-10 14:23:22 +08:00
|
|
|
minversion = 2.0
|
2014-03-11 12:44:14 -07:00
|
|
|
skipsdist = True
|
2017-11-21 16:43:17 -05:00
|
|
|
envlist = py3,py27,functional,pep8
|
2013-12-16 15:38:02 -08:00
|
|
|
|
|
|
|
[testenv]
|
2014-03-11 12:44:14 -07:00
|
|
|
usedevelop = True
|
2019-04-22 14:42:59 +03:00
|
|
|
install_command = pip install -U -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} {opts} {packages}
|
2015-08-14 09:51:57 -07:00
|
|
|
setenv =
|
2015-08-19 10:56:33 -07:00
|
|
|
VIRTUAL_ENV={envdir}
|
2017-12-01 09:53:15 -08:00
|
|
|
PYTHONDONTWRITEBYTECODE = 1
|
2015-08-19 10:56:33 -07:00
|
|
|
OS_TEST_PATH=./ironic_python_agent/tests/unit
|
2016-09-24 07:06:45 +08:00
|
|
|
LANGUAGE=en_US
|
|
|
|
LC_ALL=en_US.utf-8
|
2016-04-08 15:13:18 -07:00
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2018-06-27 14:43:29 -04:00
|
|
|
commands = stestr run {posargs}
|
2013-12-16 15:38:02 -08:00
|
|
|
|
2017-11-21 16:43:17 -05:00
|
|
|
[testenv:functional]
|
2018-06-09 02:18:32 +08:00
|
|
|
basepython = python3
|
2015-08-19 10:56:33 -07:00
|
|
|
usedevelop = True
|
|
|
|
# Define virtualenv directory, port to use for functional testing, and number
|
|
|
|
# of seconds to wait for the agent to come alive during functional testing.
|
|
|
|
setenv =
|
|
|
|
VIRTUAL_ENV={envdir}
|
2017-12-01 09:53:15 -08:00
|
|
|
PYTHONDONTWRITEBYTECODE = 1
|
2015-08-19 10:56:33 -07:00
|
|
|
OS_TEST_PATH=./ironic_python_agent/tests/functional
|
|
|
|
TEST_PORT=9999
|
2015-09-15 21:28:34 +00:00
|
|
|
IPA_WAIT_TRIES=100
|
2018-06-27 14:43:29 -04:00
|
|
|
commands = stestr run {posargs}
|
2015-08-19 10:56:33 -07:00
|
|
|
|
2014-03-11 12:44:14 -07:00
|
|
|
[testenv:pep8]
|
2018-06-09 02:18:32 +08:00
|
|
|
basepython = python3
|
2016-11-04 14:08:31 +00:00
|
|
|
whitelist_externals = bash
|
2013-12-20 16:56:40 -08:00
|
|
|
commands =
|
2014-09-17 17:51:08 +03:00
|
|
|
flake8 {posargs:ironic_python_agent imagebuild}
|
2016-11-04 14:08:31 +00:00
|
|
|
# Run bashate during pep8 runs to ensure violations are caught by
|
|
|
|
# the check and gate queues.
|
|
|
|
{toxinidir}/tools/run_bashate.sh {toxinidir}
|
2015-09-30 23:48:46 +00:00
|
|
|
doc8 doc/source README.rst
|
2013-12-20 16:56:40 -08:00
|
|
|
|
2014-03-11 12:44:14 -07:00
|
|
|
[testenv:cover]
|
2018-06-09 02:18:32 +08:00
|
|
|
basepython = python3
|
2014-03-11 12:44:14 -07:00
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
2017-09-25 14:00:05 -07:00
|
|
|
PYTHON=coverage run --source ironic_python_agent --omit='*tests*' --parallel-mode
|
2014-03-11 12:44:14 -07:00
|
|
|
commands =
|
2017-09-25 14:00:05 -07:00
|
|
|
coverage erase
|
2018-06-27 14:43:29 -04:00
|
|
|
stestr run {posargs}
|
2017-09-25 14:00:05 -07:00
|
|
|
coverage combine
|
|
|
|
coverage report --omit='*tests*'
|
|
|
|
coverage html -d ./cover --omit='*tests*'
|
2014-03-11 12:44:14 -07:00
|
|
|
|
|
|
|
[testenv:venv]
|
2018-06-09 02:18:32 +08:00
|
|
|
basepython = python3
|
2015-04-06 08:35:08 -07:00
|
|
|
setenv = PYTHONHASHSEED=0
|
2014-03-11 12:44:14 -07:00
|
|
|
commands = {posargs:}
|
|
|
|
|
2017-03-31 14:29:19 +10:00
|
|
|
[testenv:debug]
|
2018-06-09 02:18:32 +08:00
|
|
|
basepython = python3
|
2017-03-31 14:29:19 +10:00
|
|
|
envdir = {toxworkdir}/venv
|
|
|
|
commands = oslo_debug_helper -t ironic_python_agent/tests/unit {posargs}
|
|
|
|
|
2013-12-16 15:38:02 -08:00
|
|
|
[testenv:devenv]
|
2018-06-09 02:18:32 +08:00
|
|
|
basepython = python3
|
2013-12-16 15:38:02 -08:00
|
|
|
envdir = devenv
|
|
|
|
usedevelop = True
|
2014-03-17 15:17:27 -07:00
|
|
|
|
2015-05-20 16:37:56 +02:00
|
|
|
[testenv:docs]
|
2018-06-09 02:18:32 +08:00
|
|
|
basepython = python3
|
2015-03-27 15:17:00 -07:00
|
|
|
setenv = PYTHONHASHSEED=0
|
|
|
|
sitepackages = False
|
|
|
|
commands =
|
|
|
|
python setup.py build_sphinx
|
|
|
|
|
2015-12-16 16:04:29 -08:00
|
|
|
[testenv:releasenotes]
|
2018-06-09 02:18:32 +08:00
|
|
|
basepython = python3
|
2015-12-16 16:04:29 -08:00
|
|
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
|
|
|
2014-03-11 12:44:14 -07:00
|
|
|
[flake8]
|
2018-04-11 09:33:45 -07:00
|
|
|
# [E129] visually indented line with same indent as next logical line.
|
|
|
|
# [W503] Line break before binary operator.
|
|
|
|
ignore = E129,W503
|
2016-06-21 19:53:29 +03:00
|
|
|
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,imagebuild/tinyipa/tinyipafinal,imagebuild/tinyipa/tinyipabuild
|
2017-02-16 09:46:08 -08:00
|
|
|
import-order-style = pep8
|
2017-03-16 07:08:21 -07:00
|
|
|
application-import-names = ironic_python_agent
|
2017-08-09 15:39:14 +02:00
|
|
|
# [H106] Don't put vim configuration in source files.
|
2016-11-08 11:08:21 -08:00
|
|
|
# [H203] Use assertIs(Not)None to check for None.
|
2017-09-22 10:47:14 -07:00
|
|
|
# [H204] Use assert(Not)Equal to check for equality.
|
|
|
|
# [H205] Use assert(Greater|Less)(Equal) for comparison.
|
2018-01-26 00:55:18 +08:00
|
|
|
# [H210] Require 'autospec', 'spec', or 'spec_set' in mock.patch/mock.patch.object calls
|
2016-11-08 11:08:21 -08:00
|
|
|
# [H904] Delay string interpolations at logging calls.
|
2017-09-22 10:47:14 -07:00
|
|
|
enable-extensions=H106,H203,H204,H205,H210,H904
|
2014-03-11 12:44:14 -07:00
|
|
|
|
|
|
|
[hacking]
|
2014-03-27 15:35:16 -07:00
|
|
|
import_exceptions = ironic.openstack.common.gettextutils._,testtools.matchers
|
2016-11-17 14:25:23 +02:00
|
|
|
|
|
|
|
[testenv:checkconfig]
|
2018-06-09 02:18:32 +08:00
|
|
|
basepython = python3
|
2016-11-17 14:25:23 +02:00
|
|
|
sitepackages = False
|
|
|
|
envdir = {toxworkdir}/venv
|
|
|
|
commands =
|
|
|
|
{toxinidir}/tools/config/check_uptodate.sh
|
|
|
|
|
|
|
|
[testenv:genconfig]
|
2018-06-09 02:18:32 +08:00
|
|
|
basepython = python3
|
2016-11-17 14:25:23 +02:00
|
|
|
sitepackages = False
|
|
|
|
envdir = {toxworkdir}/venv
|
|
|
|
commands =
|
|
|
|
oslo-config-generator --config-file=tools/config/ipa-config-generator.conf
|
|
|
|
|
2018-03-22 13:45:58 -04:00
|
|
|
|
|
|
|
[testenv:lower-constraints]
|
|
|
|
basepython = python3
|
|
|
|
deps =
|
|
|
|
-c{toxinidir}/lower-constraints.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-r{toxinidir}/requirements.txt
|
2019-06-03 15:44:02 +08:00
|
|
|
|
|
|
|
[testenv:bandit]
|
|
|
|
basepython = python3
|
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
|
|
commands = bandit -r ironic_python_agent -x tests -n5 -ll
|