]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Add -constraints for CI jobs
authorSachi King <nakato@nakato.io>
Tue, 20 Oct 2015 22:43:07 +0000 (09:43 +1100)
committerSachi King <nakato@nakato.io>
Tue, 20 Oct 2015 23:13:58 +0000 (10:13 +1100)
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

diff --git a/tox.ini b/tox.ini
index b54b40ff16e516acb925779874883cbee94beb6c..7504b6128c1d00809f7587ebec49972608d7cc93 100644 (file)
--- 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