diff options
| author | Ewan Mellor <ewan.mellor@citrix.com> | 2011-08-28 19:41:22 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-08-28 19:41:22 +0000 |
| commit | 0ef2581749f39fa4fd41c2376186418e730f0afb (patch) | |
| tree | 5331d5fdad87aba2732c60a2b59ea60e8f43985d | |
| parent | de05bf07a69f07871e3c6d3e2d87ed8be178754c (diff) | |
| parent | 07cbdbedcab3e796f330e21b1ffe407bd646ae67 (diff) | |
| download | nova-0ef2581749f39fa4fd41c2376186418e730f0afb.tar.gz nova-0ef2581749f39fa4fd41c2376186418e730f0afb.tar.xz nova-0ef2581749f39fa4fd41c2376186418e730f0afb.zip | |
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.
| -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 871332b4a..c1fda4cf9 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 |
