]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
update tox.ini to pep8 latest (1.3.4)
authorSteven Hardy <shardy@redhat.com>
Wed, 19 Dec 2012 17:27:49 +0000 (17:27 +0000)
committerSteven Hardy <shardy@redhat.com>
Thu, 20 Dec 2012 10:53:40 +0000 (10:53 +0000)
Most of the core projects are currently 1.3.3, but since 1.3.4 is
the current latest it seemed best to align with the latest.A
Also add a check to run_tests.sh to ensure peoples local tests align
with the new gate version

fixes bug 1092057

Change-Id: I16dc7e51536781f7a14b7954c24b1aa078b37fa8
Signed-off-by: Steven Hardy <shardy@redhat.com>
run_tests.sh
tox.ini

index dbe12fd3e9033ad488680c9ca4272b33e8eedcbd..70190f49404fd7ebefccf93ffa2425a018a11450 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+BASE_DIR=`dirname $0`
+
 function usage {
   echo "Usage: $0 [OPTION]..."
   echo "Run Heat's test suite(s)"
@@ -44,10 +46,26 @@ function run_tests {
 }
 
 function run_pep8 {
-  echo "Running pep8..."
-  PEP8_OPTIONS="--exclude=$PEP8_EXCLUDE --repeat"
-  PEP8_INCLUDE="bin/heat-cfn bin/heat-boto bin/heat-api-cfn bin/heat-api bin/heat-engine heat tools setup.py heat/testing/runner.py"
-  ${wrapper} pep8 $PEP8_OPTIONS $PEP8_INCLUDE
+    # Check the installed pep8 matches what is in the tox.ini,
+    # so the local test matches the jenkins gate tests
+    TOX_PEP_VERSION=$(grep "pep8==" $BASE_DIR/tox.ini | sed "s/.*pep8==//")
+    INST_PEP_VERSION=$(pep8 --version 2>/dev/null)
+    if [[ "$TOX_PEP_VERSION" != "$INST_PEP_VERSION" ]]
+    then
+        if [[ -z "$INST_PEP_VERSION" ]]
+        then
+            echo "ERROR pep8 is not installed, please install pep8 $TOX_PEP_VERSION" >&2
+        else
+            echo "ERROR installed version of pep8 $INST_PEP_VERSION"  >&2
+            echo "does not match the required version in tox.ini ($TOX_PEP_VERSION)" >&2
+            echo "please install the requied version of pep8" >&2
+        fi
+        exit 1
+    fi
+    echo "Running pep8..."
+    PEP8_OPTIONS="--exclude=$PEP8_EXCLUDE --repeat"
+    PEP8_INCLUDE="bin/heat-cfn bin/heat-boto bin/heat-api-cfn bin/heat-api bin/heat-engine heat tools setup.py heat/testing/runner.py"
+    ${wrapper} pep8 $PEP8_OPTIONS $PEP8_INCLUDE
 }
 
 # run unit tests with pep8 when no arguments are specified
diff --git a/tox.ini b/tox.ini
index c6b6d6721720b0976348a26e20019f02bd162216..91c7614df58702130a77ef6a27fcc00edc1bcf0a 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -8,7 +8,7 @@ deps = -r{toxinidir}/tools/pip-requires
 commands = nosetests -a tag='unit'
 
 [testenv:pep8]
-deps = pep8==1.1
+deps = pep8==1.3.4
 commands = pep8 --repeat --show-source heat setup.py
 
 [testenv:venv]