Bug #835952: pep8 failures do not cause the tests to fail

Add set -eu to run_tests.sh.  This will cause it to fail whenever anything
goes wrong, which is exactly what we want in a test script.

To do this, I had to remove the use of the "let" keyword, which has a bizarre
exit status in bash.

I also removed the "|| exit" after run_tests, which means that this script
will now exit with status 1, not status 0, if run_tests fails.
This commit is contained in:
Ewan Mellor 2011-08-28 16:19:55 +05:30
parent e38ba3a606
commit 07cbdbedca
1 changed files with 10 additions and 8 deletions

View File

@ -1,5 +1,7 @@
#!/bin/bash
set -eu
function usage {
echo "Usage: $0 [OPTION]..."
echo "Run Nova's test suite(s)"
@ -24,13 +26,13 @@ function usage {
function process_option {
case "$1" in
-h|--help) usage;;
-V|--virtual-env) let always_venv=1; let never_venv=0;;
-N|--no-virtual-env) let always_venv=0; let never_venv=1;;
-r|--recreate-db) let recreate_db=1;;
-n|--no-recreate-db) let recreate_db=0;;
-f|--force) let force=1;;
-p|--pep8) let just_pep8=1;;
-c|--coverage) let coverage=1;;
-V|--virtual-env) always_venv=1; never_venv=0;;
-N|--no-virtual-env) always_venv=0; never_venv=1;;
-r|--recreate-db) recreate_db=1;;
-n|--no-recreate-db) recreate_db=0;;
-f|--force) force=1;;
-p|--pep8) just_pep8=1;;
-c|--coverage) coverage=1;;
-*) noseopts="$noseopts $1";;
*) noseargs="$noseargs $1"
esac
@ -130,7 +132,7 @@ if [ $recreate_db -eq 1 ]; then
rm -f tests.sqlite
fi
run_tests || exit
run_tests
# NOTE(sirp): we only want to run pep8 when we're running the full-test suite,
# not when we're running tests individually. To handle this, we need to