summaryrefslogtreecommitdiffstats
path: root/run_tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'run_tests.sh')
-rwxr-xr-xrun_tests.sh42
1 files changed, 8 insertions, 34 deletions
diff --git a/run_tests.sh b/run_tests.sh
index be9b0fa73..389a74f6d 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -12,6 +12,7 @@ function usage {
echo " -r, --recreate-db Recreate the test database (deprecated, as this is now the default)."
echo " -n, --no-recreate-db Don't recreate the test database."
echo " -f, --force Force a clean re-build of the virtual environment. Useful when dependencies have been added."
+ echo " -u, --update Update the virtual environment with any newer package versions"
echo " -p, --pep8 Just run PEP8 and HACKING compliance check"
echo " -P, --no-pep8 Don't run static code checks"
echo " -c, --coverage Generate coverage report"
@@ -42,6 +43,7 @@ function process_options {
-r|--recreate-db) recreate_db=1;;
-n|--no-recreate-db) recreate_db=0;;
-f|--force) force=1;;
+ -u|--update) update=1;;
-p|--pep8) just_pep8=1;;
-P|--no-pep8) no_pep8=1;;
-c|--coverage) coverage=1;;
@@ -80,6 +82,7 @@ just_pep8=0
no_pep8=0
coverage=0
recreate_db=1
+update=0
LANG=en_US.UTF-8
LANGUAGE=en_US:en
@@ -147,40 +150,7 @@ function copy_subunit_log {
function run_pep8 {
echo "Running PEP8 and HACKING compliance check..."
-
- # Files of interest
- # NOTE(lzyeval): Avoid selecting nova-api-paste.ini and nova.conf in nova/bin
- # when running on devstack.
- # NOTE(lzyeval): Avoid selecting *.pyc files to reduce pep8 check-up time
- # when running on devstack.
- srcfiles=`find nova -type f -name "*.py" ! -wholename "nova\/openstack*"`
- srcfiles+=" `find bin -type f ! -name "nova.conf*" ! -name "*api-paste.ini*" ! -name "*~"`"
- srcfiles+=" `find tools -type f -name "*.py"`"
- srcfiles+=" `find plugins -type f -name "*.py"`"
- srcfiles+=" `find smoketests -type f -name "*.py"`"
- srcfiles+=" setup.py"
-
- # Until all these issues get fixed, ignore.
- ignore='--ignore=E12,E711,E721,E712,N403,N404'
-
- # First run the hacking selftest, to make sure it's right
- echo "Running hacking.py self test"
- ${wrapper} python tools/hacking.py --doctest
-
- # Then actually run it
- echo "Running pep8"
- ${wrapper} python tools/hacking.py ${ignore} ${srcfiles}
-
- ${wrapper} bash tools/unused_imports.sh
- # NOTE(sdague): as of grizzly-2 these are passing however leaving the comment
- # in here in case we need to break it out when we get more of our hacking working
- # again.
- #
- # NOTE(sirp): Dom0 plugins are written for Python 2.4, meaning some HACKING
- # checks are too strict.
- # pep8onlyfiles=`find plugins -type f -name "*.py"`
- # pep8onlyfiles+=" `find plugins/xenserver/xenapi/etc/xapi.d/plugins/ -type f -perm +111`"
- # ${wrapper} pep8 ${ignore} ${pep8onlyfiles}
+ bash tools/run_pep8.sh
}
@@ -193,6 +163,10 @@ then
echo "Cleaning virtualenv..."
rm -rf ${venv}
fi
+ if [ $update -eq 1 ]; then
+ echo "Updating virtualenv..."
+ python tools/install_venv.py $installvenvopts
+ fi
if [ -e ${venv} ]; then
wrapper="${with_venv}"
else