From ef5cb04ce1eb1f443c8b05b31feb08a7fdb385a9 Mon Sep 17 00:00:00 2001 From: Kaitlin Farr Date: Sun, 10 Jul 2016 19:05:44 -0400 Subject: [PATCH] Modify tox tests to respect upper-constraints.txt This forces pip install to use the upper-constraints.txt specified version of pip modules. Otherwise, the versions of the requirements that are pulled are the most recent ones, which is not always desired, e.g. for testing stable branches. This change was inspired by Ie1133e4c020106e8098685ba9125f84b356d8e0c Closes-Bug: #1563038 Change-Id: I921257a1e4cc3223878d3559af80410f24313425 (cherry picked from commit 9ca366f843ab9ddeb0050c1009634903d2fde29d) --- tox.ini | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 562914ec..e5bfa741 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ envlist = pep8,py34,py27,docs [testenv] -install_command = pip install -U {opts} {packages} +install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/mitaka} {opts} {packages} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt @@ -13,8 +13,11 @@ commands = coverage report -m [testenv:cover] +# TODO(kfarr): remove once infra supports constraints for this target +install_command = pip install -U {opts} {packages} deps = - {[testenv]deps} + -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt diff_cover commands = python setup.py testr --coverage --testr-args='{posargs}' @@ -23,6 +26,8 @@ commands = diff-cover --fail-under 100 coverage.xml [testenv:releasenotes] +# TODO(kfarr): remove once infra supports constraints for this target +install_command = pip install -U {opts} {packages} commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:py34] @@ -69,6 +74,8 @@ commands = bandit -r barbican -x tests -n5 [testenv:venv] +# TODO(kfarr): remove once infra supports constraints for this target +install_command = pip install -U {opts} {packages} commands = {posargs} [testenv:debug] @@ -84,6 +91,8 @@ commands = flake8 barbican setup.py [testenv:docs] +# TODO(kfarr): remove once infra supports constraints for this target +install_command = pip install -U {opts} {packages} commands= rm -rf api-guide/build python setup.py build_sphinx @@ -92,6 +101,8 @@ commands= [testenv:api-guide] # This environment is called from CI scripts to test and publish # the API Guide to developer.openstack.org. +# TODO(kfarr): remove once infra supports constraints for this target +install_command = pip install -U {opts} {packages} commands = sphinx-build -W -b html -d api-guide/build/doctrees api-guide/source api-guide/build/html