Skip to content

Commit

Permalink
Add -constraints sections for CI jobs
Browse files Browse the repository at this point in the history
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

Depends-On: I59fcf763d7eb9252e950dce5783befc20b4e8fd4
Change-Id: Icbbb78cfcd074b0050e60c54557637af723f9b92
(cherry picked from commit a42e53a)
  • Loading branch information
nakato authored and tbreeds committed Dec 22, 2015
1 parent 1a688e3 commit 05e54eb
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion tox.ini
Expand Up @@ -10,7 +10,7 @@ whitelist_externals = bash
find
rm
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}
setenv = VIRTUAL_ENV={envdir}
OS_TEST_PATH=./nova/tests/unit
Expand All @@ -28,10 +28,18 @@ passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
[tox:jenkins]
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?h=stable/liberty} {opts} {packages}

[testenv:pep8]
commands =
bash tools/flake8wrap.sh {posargs}

[testenv:pep8-constraints]
install_command = {[testenv:common-constraints]install_command}
commands =
bash tools/flake8wrap.sh {posargs}

[testenv:py34]
setenv = {[testenv]setenv}
deps = -r{toxinidir}/requirements.txt
Expand Down Expand Up @@ -128,6 +136,13 @@ commands =
nova.tests.unit.test_utils \
nova.tests.unit.test_versions

[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]
usedevelop = True
install_command = pip install -U --force-reinstall {opts} {packages}
Expand All @@ -140,6 +155,14 @@ commands =
find . -type f -name "*.pyc" -delete
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]
commands = oslo-config-generator --config-file=etc/nova/nova-config-generator.conf

Expand All @@ -153,16 +176,35 @@ commands =
coverage combine
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]
commands = {posargs}

[testenv:venv-constraints]
install_command = {[testenv:common-constraints]install_command}
commands = {posargs}

[testenv:docs]
commands =
rm -rf doc/source/api doc/build
python setup.py build_sphinx
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

[testenv:docs-constraints]
install_command = {[testenv:common-constraints]install_command}
commands = {[testenv:docs]commands}

[testenv:bandit]
deps = -r{toxinidir}/test-requirements.txt
commands = bandit -c bandit.yaml -r nova -n 5 -ll
Expand Down

0 comments on commit 05e54eb

Please sign in to comment.