testing: make start-local-mozreview fail on all script errors (bug 1279881) r?glob draft
authorMāris Fogels <mars@mozilla.com>
Tue, 28 Jun 2016 10:34:53 -0400
changeset 8670 6874efa078fd2d586f85aeab770c4d23100a099d
parent 8653 2d69b5c7a0f56b309dba5acb815aa5afc8d8c880
push id958
push usermfogels@mozilla.com
push dateTue, 28 Jun 2016 15:30:10 +0000
reviewersglob
bugs1279881
testing: make start-local-mozreview fail on all script errors (bug 1279881) r?glob Make start-local-mozreview fail on any script error, not just 'mozreview start'. Also avoid the much more strict 'set -u' because it doesn't play nice with scripts that call virtualenv. MozReview-Commit-ID: CXn0mKhN8Wr
start-local-mozreview
--- a/start-local-mozreview
+++ b/start-local-mozreview
@@ -1,32 +1,33 @@
 #!/bin/bash
 # This script starts the mozreview servers, creates a default user, some bugs
 # and a properly configured mercurial repository for pushing reviews.
 # You need to source this script (e.g. run with ". start-local-mozreview") in
 # order for the environment variables to be set correctly.
 
+set -eo pipefail
+
 TEST_MOZREVIEW_NAME=mozreview-test
 TEST_REPO_NAME=local-mozreview-test-repo
 
 VCT_PATH=`pwd`
 cd ..
 PARENT_PATH=`pwd`
 cd $VCT_PATH
 
 REPO_PATH=$PARENT_PATH/$TEST_REPO_NAME
 TEST_MOZREVIEW_PATH=$PARENT_PATH/$TEST_MOZREVIEW_NAME
 
 export MOZREVIEW_HOME=$TEST_MOZREVIEW_PATH
 . venv/bin/activate
 
 ./mozreview stop $TEST_MOZREVIEW_PATH
-if ! ./mozreview start --reviewboard-port=55556 $TEST_MOZREVIEW_PATH; then
-    exit 1
-fi
+
+./mozreview start --reviewboard-port=55556 $TEST_MOZREVIEW_PATH
 
 $(./mozreview shellinit)
 
 ./mozreview create-repo test-repo
 
 ./mozreview create-user default@example.com password 'Default User :default' \
     --uid 2000 --scm-level 1 --bugzilla-group editbugs
 ./reviewboard associate-ldap-user default default@example.com