Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: tests/save-description-on-failure.sh

Issue 1095033002: Enable OAuth2 by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: fix smoke tests Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/rename.sh ('k') | tests/submit-from-new-dir.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env bash 1 #!/usr/bin/env bash
2 2
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 # We should save a change's description when an upload fails. 7 # We should save a change's description when an upload fails.
8 8
9 set -e 9 set -e
10 10
(...skipping 16 matching lines...) Expand all
27 DESC="this is the description" 27 DESC="this is the description"
28 28
29 # Create a branch and check in a file. 29 # Create a branch and check in a file.
30 git checkout -q --track -b work origin 30 git checkout -q --track -b work origin
31 echo foo >> test 31 echo foo >> test
32 git add test; git commit -q -m "$DESC" 32 git add test; git commit -q -m "$DESC"
33 33
34 # Try to upload the change to an unresolvable hostname; git-cl should fail. 34 # Try to upload the change to an unresolvable hostname; git-cl should fail.
35 export GIT_EDITOR=$(which true) 35 export GIT_EDITOR=$(which true)
36 git config rietveld.server bogus.example.com:80 36 git config rietveld.server bogus.example.com:80
37 test_expect_failure "uploading to bogus server" "$GIT_CL upload 2>/dev/null" 37 test_expect_failure "uploading to bogus server" \
38 "$GIT_CL upload --no-oauth2 2>/dev/null"
38 39
39 # Check that the change's description was saved. 40 # Check that the change's description was saved.
40 test_expect_success "description was backed up" \ 41 test_expect_success "description was backed up" \
41 "grep -q '$DESC' '$BACKUP_FILE'" 42 "grep -q '$DESC' '$BACKUP_FILE'"
42 ) 43 )
43 44
44 SUCCESS=$? 45 SUCCESS=$?
45 46
46 cleanup 47 cleanup
47 48
48 # Restore the previously-saved description. 49 # Restore the previously-saved description.
49 rm -f "$BACKUP_FILE" 50 rm -f "$BACKUP_FILE"
50 if [ -e "$BACKUP_FILE_TMP" ]; then 51 if [ -e "$BACKUP_FILE_TMP" ]; then
51 mv "$BACKUP_FILE_TMP" "$BACKUP_FILE" 52 mv "$BACKUP_FILE_TMP" "$BACKUP_FILE"
52 fi 53 fi
53 54
54 if [ $SUCCESS == 0 ]; then 55 if [ $SUCCESS == 0 ]; then
55 echo PASS 56 echo PASS
56 fi 57 fi
OLDNEW
« no previous file with comments | « tests/rename.sh ('k') | tests/submit-from-new-dir.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698