diff options
author | Ewan Mellor <ewan.mellor@citrix.com> | 2011-08-28 16:19:55 +0530 |
---|---|---|
committer | Ewan Mellor <ewan.mellor@citrix.com> | 2011-08-28 16:19:55 +0530 |
commit | 07cbdbedcab3e796f330e21b1ffe407bd646ae67 (patch) | |
tree | 4a161032acf9f68da206648d801a5e86fddd4731 /run_tests.sh | |
parent | e38ba3a6066de8499ea5cc8d1fb2e5daefbf336a (diff) | |
download | nova-07cbdbedcab3e796f330e21b1ffe407bd646ae67.tar.gz |
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.
Diffstat (limited to 'run_tests.sh')
-rwxr-xr-x | run_tests.sh | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/run_tests.sh b/run_tests.sh index 871332b4ae..c1fda4cf92 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -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 |