2016-08-12 16:59:23 +08:00
|
|
|
[tox]
|
|
|
|
minversion = 2.0
|
2017-03-02 17:29:38 +05:30
|
|
|
envlist = py35-constraints,py27-constraints,pypy-constraints,pep8-constraints,functional
|
2016-08-12 16:59:23 +08:00
|
|
|
skipsdist = True
|
|
|
|
|
|
|
|
[testenv]
|
|
|
|
usedevelop = True
|
2016-11-01 15:41:44 +08:00
|
|
|
install_command = {[testenv:common-constraints]install_command}
|
2016-08-12 16:59:23 +08:00
|
|
|
setenv =
|
|
|
|
VIRTUAL_ENV={envdir}
|
2016-12-30 11:33:01 +08:00
|
|
|
OS_TEST_PATH=mogan/tests/unit
|
2016-08-12 16:59:23 +08:00
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
|
|
commands = python setup.py test --slowest --testr-args='{posargs}'
|
|
|
|
|
|
|
|
[testenv:common-constraints]
|
|
|
|
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
|
|
|
|
|
|
|
[testenv:pep8]
|
|
|
|
commands = flake8 {posargs}
|
|
|
|
|
|
|
|
[testenv:pep8-constraints]
|
|
|
|
install_command = {[testenv:common-constraints]install_command}
|
|
|
|
commands = flake8 {posargs}
|
|
|
|
|
|
|
|
[testenv:venv]
|
|
|
|
commands = {posargs}
|
|
|
|
|
|
|
|
[testenv:venv-constraints]
|
|
|
|
install_command = {[testenv:common-constraints]install_command}
|
|
|
|
commands = {posargs}
|
|
|
|
|
|
|
|
[testenv:cover]
|
2017-01-04 09:43:29 +08:00
|
|
|
commands =
|
|
|
|
python setup.py test --coverage --testr-args='{posargs}'
|
|
|
|
coverage report
|
2016-08-12 16:59:23 +08:00
|
|
|
|
|
|
|
[testenv:cover-constraints]
|
|
|
|
install_command = {[testenv:common-constraints]install_command}
|
|
|
|
commands = python setup.py test --coverage --testr-args='{posargs}'
|
|
|
|
|
|
|
|
[testenv:docs]
|
2016-11-30 16:52:59 +08:00
|
|
|
commands =
|
|
|
|
python setup.py build_sphinx
|
2017-01-05 00:49:39 +08:00
|
|
|
oslo-config-generator --config-file=tools/config/mogan-config-generator.conf
|
2016-08-12 16:59:23 +08:00
|
|
|
|
|
|
|
[testenv:releasenotes]
|
|
|
|
commands =
|
|
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
|
|
|
|
|
|
[testenv:docs-constraints]
|
|
|
|
install_command = {[testenv:common-constraints]install_command}
|
|
|
|
commands = python setup.py build_sphinx
|
|
|
|
|
|
|
|
[testenv:debug]
|
|
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
|
2016-10-11 15:39:31 +08:00
|
|
|
[testenv:functional]
|
2016-12-30 11:33:01 +08:00
|
|
|
setenv = OS_TEST_PATH=mogan/tests/functional/
|
2016-10-11 15:39:31 +08:00
|
|
|
commands = python setup.py testr --slowest --testr-args="{posargs}"
|
|
|
|
|
2016-08-12 16:59:23 +08:00
|
|
|
[testenv:debug-constraints]
|
|
|
|
install_command = {[testenv:common-constraints]install_command}
|
|
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
|
2016-08-17 00:51:20 +08:00
|
|
|
[testenv:genconfig]
|
|
|
|
sitepackages = False
|
|
|
|
envdir = {toxworkdir}/venv
|
|
|
|
commands =
|
2017-01-05 00:49:39 +08:00
|
|
|
oslo-config-generator --config-file=tools/config/mogan-config-generator.conf
|
2016-08-17 00:51:20 +08:00
|
|
|
|
2016-10-01 12:02:52 +08:00
|
|
|
[testenv:genpolicy]
|
|
|
|
sitepackages = False
|
|
|
|
envdir = {toxworkdir}/venv
|
|
|
|
commands =
|
2017-01-25 11:30:45 +08:00
|
|
|
oslopolicy-sample-generator --config-file=tools/config/mogan-policy-generator.conf
|
2016-10-01 12:02:52 +08:00
|
|
|
|
2016-09-13 16:01:40 +08:00
|
|
|
[testenv:api-ref]
|
|
|
|
# This environment is called from CI scripts to test and publish
|
|
|
|
# the API Ref to developer.openstack.org.
|
|
|
|
whitelist_externals = bash
|
|
|
|
commands =
|
|
|
|
bash -c 'rm -rf api-ref/build'
|
|
|
|
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
|
|
|
|
|
2016-08-12 16:59:23 +08:00
|
|
|
[flake8]
|
2016-11-22 17:47:55 +08:00
|
|
|
# H405 is another one that is good as a guideline, but sometimes
|
|
|
|
# multiline doc strings just don't have a natural summary
|
|
|
|
# line. Rejecting code for this reason is wrong.
|
2016-08-12 16:59:23 +08:00
|
|
|
|
|
|
|
show-source = True
|
2016-11-24 10:08:11 +08:00
|
|
|
ignore = H405
|
2016-08-12 16:59:23 +08:00
|
|
|
builtins = _
|
|
|
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
2016-08-16 13:23:37 +08:00
|
|
|
|
|
|
|
[hacking]
|
2016-12-30 11:33:01 +08:00
|
|
|
import_exceptions = mogan.common.i18n
|