Merge lp:~ewanmellor/nova/lp835952 into lp:~hudson-openstack/nova/trunk

Proposed by Ewan Mellor
Status: Merged
Merged at revision: 1504
Proposed branch: lp:~ewanmellor/nova/lp835952
Merge into: lp:~hudson-openstack/nova/trunk
Prerequisite: lp:~ewanmellor/nova/lp835964
Diff against target: 41 lines (+10/-8)
1 file modified
run_tests.sh (+10/-8)
To merge this branch: bzr merge lp:~ewanmellor/nova/lp835952
Reviewer Review Type Date Requested Status
Vish Ishaya (community) Approve
Brian Lamar (community) Approve
Review via email: mp+73175@code.launchpad.net

Commit message

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.

Description of the change

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.

To post a comment you must log in.
Revision history for this message
Brian Lamar (blamar) wrote :

Nice, works great, thanks!

review: Approve
Revision history for this message
Vish Ishaya (vishvananda) wrote :

lgtm. Will approve once prereq is in.

review: Approve
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

No proposals found for merge of lp:~ewanmellor/nova/lp835964 into lp:nova.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'run_tests.sh'
2--- run_tests.sh 2011-08-12 21:33:27 +0000
3+++ run_tests.sh 2011-08-28 10:54:24 +0000
4@@ -1,5 +1,7 @@
5 #!/bin/bash
6
7+set -eu
8+
9 function usage {
10 echo "Usage: $0 [OPTION]..."
11 echo "Run Nova's test suite(s)"
12@@ -24,13 +26,13 @@
13 function process_option {
14 case "$1" in
15 -h|--help) usage;;
16- -V|--virtual-env) let always_venv=1; let never_venv=0;;
17- -N|--no-virtual-env) let always_venv=0; let never_venv=1;;
18- -r|--recreate-db) let recreate_db=1;;
19- -n|--no-recreate-db) let recreate_db=0;;
20- -f|--force) let force=1;;
21- -p|--pep8) let just_pep8=1;;
22- -c|--coverage) let coverage=1;;
23+ -V|--virtual-env) always_venv=1; never_venv=0;;
24+ -N|--no-virtual-env) always_venv=0; never_venv=1;;
25+ -r|--recreate-db) recreate_db=1;;
26+ -n|--no-recreate-db) recreate_db=0;;
27+ -f|--force) force=1;;
28+ -p|--pep8) just_pep8=1;;
29+ -c|--coverage) coverage=1;;
30 -*) noseopts="$noseopts $1";;
31 *) noseargs="$noseargs $1"
32 esac
33@@ -130,7 +132,7 @@
34 rm -f tests.sqlite
35 fi
36
37-run_tests || exit
38+run_tests
39
40 # NOTE(sirp): we only want to run pep8 when we're running the full-test suite,
41 # not when we're running tests individually. To handle this, we need to