From 760a187640ddf1ee6aab41614d7232702eb65a78 Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Wed, 19 Dec 2012 17:27:49 +0000 Subject: [PATCH] update tox.ini to pep8 latest (1.3.4) 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 --- run_tests.sh | 26 ++++++++++++++++++++++---- tox.ini | 2 +- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index dbe12fd3..70190f49 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -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 c6b6d672..91c7614d 100644 --- 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] -- 2.45.2