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. Implements Blueprint: Requirements-Management Change-Id: Icbbb78cfcd074b0050e60c54557637af723f9b92
This commit is contained in:
parent
75ecc63db9
commit
a42e53a8a7
44
tox.ini
44
tox.ini
@ -10,7 +10,7 @@ whitelist_externals = bash
|
|||||||
find
|
find
|
||||||
rm
|
rm
|
||||||
install_command =
|
install_command =
|
||||||
constraints: pip install -U --force-reinstall -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
constraints: {[testenv:common-constraints]install_command}
|
||||||
pip install -U --force-reinstall {opts} {packages}
|
pip install -U --force-reinstall {opts} {packages}
|
||||||
setenv = VIRTUAL_ENV={envdir}
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
OS_TEST_PATH=./nova/tests/unit
|
OS_TEST_PATH=./nova/tests/unit
|
||||||
@ -27,10 +27,18 @@ passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
|||||||
[tox:jenkins]
|
[tox:jenkins]
|
||||||
downloadcache = ~/cache/pip
|
downloadcache = ~/cache/pip
|
||||||
|
|
||||||
|
[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]
|
[testenv:pep8]
|
||||||
commands =
|
commands =
|
||||||
bash tools/flake8wrap.sh {posargs}
|
bash tools/flake8wrap.sh {posargs}
|
||||||
|
|
||||||
|
[testenv:pep8-constraints]
|
||||||
|
install_command = {[testenv:common-constraints]install_command}
|
||||||
|
commands =
|
||||||
|
bash tools/flake8wrap.sh {posargs}
|
||||||
|
|
||||||
[testenv:py34]
|
[testenv:py34]
|
||||||
setenv = {[testenv]setenv}
|
setenv = {[testenv]setenv}
|
||||||
commands =
|
commands =
|
||||||
@ -38,6 +46,13 @@ commands =
|
|||||||
python -m subunit.run discover -t . ./nova/tests/ --list
|
python -m subunit.run discover -t . ./nova/tests/ --list
|
||||||
ostestr --blacklist_file tests-py3.txt
|
ostestr --blacklist_file tests-py3.txt
|
||||||
|
|
||||||
|
[testenv:py34-constraints]
|
||||||
|
install_command = {[testenv:common-constraints]install_command}
|
||||||
|
setenv = {[testenv]setenv}
|
||||||
|
deps = -r{toxinidir}/requirements.txt
|
||||||
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
commands = {[testenv:py34]commands}
|
||||||
|
|
||||||
[testenv:functional]
|
[testenv:functional]
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
install_command = pip install -U --force-reinstall {opts} {packages}
|
install_command = pip install -U --force-reinstall {opts} {packages}
|
||||||
@ -48,6 +63,14 @@ commands =
|
|||||||
find . -type f -name "*.pyc" -delete
|
find . -type f -name "*.pyc" -delete
|
||||||
bash tools/pretty_tox.sh '{posargs}'
|
bash tools/pretty_tox.sh '{posargs}'
|
||||||
|
|
||||||
|
[testenv:functional-constraints]
|
||||||
|
usedevelop = {[testenv:functional]usedevelop}
|
||||||
|
install_command = {[testenv:common-constraints]install_command}
|
||||||
|
setenv = {[testenv:functional]setenv}
|
||||||
|
commands =
|
||||||
|
find . -type f -name "*.pyc" -delete
|
||||||
|
bash tools/pretty_tox.sh '{posargs}'
|
||||||
|
|
||||||
[testenv:genconfig]
|
[testenv:genconfig]
|
||||||
commands = oslo-config-generator --config-file=etc/nova/nova-config-generator.conf
|
commands = oslo-config-generator --config-file=etc/nova/nova-config-generator.conf
|
||||||
|
|
||||||
@ -61,9 +84,24 @@ commands =
|
|||||||
coverage combine
|
coverage combine
|
||||||
coverage html --include='nova/*' --omit='nova/openstack/common/*' -d covhtml -i
|
coverage html --include='nova/*' --omit='nova/openstack/common/*' -d covhtml -i
|
||||||
|
|
||||||
|
[testenv:cover-constraints]
|
||||||
|
install_command = {[testenv:common-constraints]install_command}
|
||||||
|
# Also do not run test_coverage_ext tests while gathering coverage as those
|
||||||
|
# tests conflict with coverage.
|
||||||
|
commands =
|
||||||
|
coverage erase
|
||||||
|
python setup.py testr --coverage \
|
||||||
|
--testr-args='{posargs}'
|
||||||
|
coverage combine
|
||||||
|
coverage html --include='nova/*' --omit='nova/openstack/common/*' -d covhtml -i
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
|
[testenv:venv-constraints]
|
||||||
|
install_command = {[testenv:common-constraints]install_command}
|
||||||
|
commands = {posargs}
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
commands =
|
commands =
|
||||||
rm -rf doc/source/api doc/build
|
rm -rf doc/source/api doc/build
|
||||||
@ -71,6 +109,10 @@ commands =
|
|||||||
bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python'
|
bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python'
|
||||||
oslo-config-generator --config-file=etc/nova/nova-config-generator.conf
|
oslo-config-generator --config-file=etc/nova/nova-config-generator.conf
|
||||||
|
|
||||||
|
[testenv:docs-constraints]
|
||||||
|
install_command = {[testenv:common-constraints]install_command}
|
||||||
|
commands = {[testenv:docs]commands}
|
||||||
|
|
||||||
[testenv:bandit]
|
[testenv:bandit]
|
||||||
commands = bandit -c bandit.yaml -r nova -n 5 -ll
|
commands = bandit -c bandit.yaml -r nova -n 5 -ll
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user