Add -constraints sections for CI jobs

Tox does not currently support using factors with sections, and work
towards enabling this has stalled, as such we will need to duplicate
sections adding -constraints to facilitate running sections with the
constrained install_command.

Author: Tom Cammann <tom.cammann@hp.com>
Co-Authored-By: Egor Guz <guz_egor@yahoo.com>
Implements Blueprint: Requirements-Management
Change-Id: Ia36b1794077f29eac189e19552c2d3a4bfe26e5e
This commit is contained in:
Tom Cammann 2015-10-30 15:13:06 +09:00 committed by Egor Guz
parent 0839cfeb91
commit eb3d5e9a3a
1 changed files with 29 additions and 1 deletions

30
tox.ini
View File

@ -5,7 +5,9 @@ skipsdist = True
[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
install_command =
constraints: {[testenv:common-constraints]install_command}
pip install -U {opts} {packages}
whitelist_externals = bash
find
setenv =
@ -17,6 +19,9 @@ commands =
find . -type f -name "*.pyc" -delete
bash tools/pretty_tox.sh '{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:functional-api]
sitepackages = True
setenv = OS_TEST_PATH=./magnum/tests/functional/api
@ -52,21 +57,44 @@ commands =
doc8 -e .rst specs/ doc/source/ contrib/ CONTRIBUTING.rst HACKING.rst README.rst
bash tools/flake8wrap.sh {posargs}
[testenv:pep8-constraints]
install_command = {[testenv:common-constraints]install_command}
commands =
doc8 -e .rst specs/ doc/source/ contrib/ CONTRIBUTING.rst HACKING.rst README.rst
bash tools/flake8wrap.sh {posargs}
[testenv:venv]
commands = {posargs}
[testenv:venv-constraints]
install_command = {[testenv:common-constraints]install_command}
commands = {posargs}
[testenv:bandit]
deps = -r{toxinidir}/test-requirements.txt
commands = bandit -c bandit.yaml -r magnum -n5 -p magnum_conservative
[testenv:bandit-constraints]
install_command = {[testenv:common-constraints]install_command}
deps = {[testenv:bandit]deps}
commands = {[testenv:bandit]commands}
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'
[testenv:cover-constraints]
install_command = {[testenv:common-constraints]install_command}
commands = python setup.py testr --coverage --testr-args='{posargs}'
[testenv:docs]
commands =
doc8 -e .rst specs/ doc/source/ contrib/ CONTRIBUTING.rst HACKING.rst README.rst
python setup.py build_sphinx
[testenv:docs-constraints]
install_command = {[testenv:common-constraints]install_command}
commands = {[testenv:docs]commands}
[testenv:genconfig]
commands =
oslo-config-generator --output-file etc/magnum/magnum.conf.sample \