From fb17ed86534291f4c03a5dba8304b9e3ad786d05 Mon Sep 17 00:00:00 2001 From: Sachi King Date: Wed, 21 Oct 2015 09:43:07 +1100 Subject: [PATCH] Add -constraints for CI jobs This adds the constraints factor to the base section and duplicates the sections required for CI with -constraints as tox does not currently support factors in sections. Work towards enabling factor support in sections is currently 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: I7afd52517750b82dcac94b8aae68dc0e94d00e54 --- tox.ini | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index b54b40ff1..7504b6128 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,9 @@ envlist = py27,pep8 setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 usedevelop = True -install_command = pip install {opts} {packages} +install_command = + constraints: {[testenv:common-constraints]install_command} + pip install {opts} {packages} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt @@ -26,10 +28,17 @@ 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} {opts} {packages} + [testenv:py34] commands = ostestr --whitelist_file=tests-py3.txt +[testenv:py34-constraints] +install_command = {[testenv:common-constraints]install_command} +commands = {[testenv:py34]commands} + [testenv:pep8] commands = flake8 {posargs} . cinder/common @@ -38,6 +47,15 @@ commands = {toxinidir}/tools/config/check_uptodate.sh {toxinidir}/tools/check_exec.py {toxinidir}/cinder +[testenv:pep8-constraints] +install_command = {[testenv:common-constraints]install_command} +commands = + flake8 {posargs} . cinder/common + # Check that .po and .pot files are valid: + bash -c "find cinder -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null" + {toxinidir}/tools/config/check_uptodate.sh + {toxinidir}/tools/check_exec.py {toxinidir}/cinder + [testenv:fast8] # Use same environment directory as pep8 env to save space and install time envdir = {toxworkdir}/pep8 @@ -49,6 +67,11 @@ deps = -r{toxinidir}/requirements.txt pylint==0.26.0 commands = bash tools/lintstack.sh +[testenv:pylint-constraints] +install_command = {[testenv:common-constraints]install_command} +deps = {[testenv:pylint]deps} +commands = {[testenv:pylint]commands} + [testenv:cover] # Also do not run test_coverage_ext tests while gathering coverage as those # tests conflict with coverage. @@ -56,6 +79,10 @@ commands = python setup.py testr --coverage \ --testr-args='^(?!.*test.*coverage).*$' +[testenv:cover-constraints] +install_command = {[testenv:common-constraints]install_command} +commands = {[testenv:cover]commands} + [testenv:genconfig] sitepackages = False envdir = {toxworkdir}/venv @@ -64,6 +91,10 @@ commands = {toxinidir}/tools/config/generate_sample.sh from_tox [testenv:venv] commands = {posargs} +[testenv:venv-constraints] +install_command = {[testenv:common-constraints]install_command} +commands = {posargs} + [testenv:docs] commands = python setup.py build_sphinx -- 2.45.2