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

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

Issue 6646041: Make git-cl tests work on Mac SnowLeopard (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 9 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 | « git_cl/test/rename.sh ('k') | git_cl/test/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 #!/bin/bash 1 #!/bin/bash
2 2
3 # We should save a change's description when an upload fails. 3 # We should save a change's description when an upload fails.
4 4
5 set -e 5 set -e
6 6
7 . ./test-lib.sh 7 . ./test-lib.sh
8 8
9 # Back up any previously-saved description the user might have. 9 # Back up any previously-saved description the user might have.
10 BACKUP_FILE="$HOME/.git_cl_description_backup" 10 BACKUP_FILE="$HOME/.git_cl_description_backup"
(...skipping 10 matching lines...) Expand all
21 cd git-git 21 cd git-git
22 22
23 DESC="this is the description" 23 DESC="this is the description"
24 24
25 # Create a branch and check in a file. 25 # Create a branch and check in a file.
26 git checkout -q --track -b work origin 26 git checkout -q --track -b work origin
27 echo foo >> test 27 echo foo >> test
28 git add test; git commit -q -m "$DESC" 28 git add test; git commit -q -m "$DESC"
29 29
30 # Try to upload the change to an unresolvable hostname; git-cl should fail. 30 # Try to upload the change to an unresolvable hostname; git-cl should fail.
31 export EDITOR=/bin/true 31 export EDITOR=$(which true)
32 git config rietveld.server bogus.example.com:80 32 git config rietveld.server bogus.example.com:80
33 test_expect_failure "uploading to bogus server" "$GIT_CL upload 2>/dev/null" 33 test_expect_failure "uploading to bogus server" "$GIT_CL upload 2>/dev/null"
34 34
35 # Check that the change's description was saved. 35 # Check that the change's description was saved.
36 test_expect_success "description was backed up" \ 36 test_expect_success "description was backed up" \
37 "grep -q '$DESC' '$BACKUP_FILE'" 37 "grep -q '$DESC' '$BACKUP_FILE'"
38 ) 38 )
39 39
40 SUCCESS=$? 40 SUCCESS=$?
41 41
42 cleanup 42 cleanup
43 43
44 # Restore the previously-saved description. 44 # Restore the previously-saved description.
45 rm -f "$BACKUP_FILE" 45 rm -f "$BACKUP_FILE"
46 if [ -e "$BACKUP_FILE_TMP" ]; then 46 if [ -e "$BACKUP_FILE_TMP" ]; then
47 mv "$BACKUP_FILE_TMP" "$BACKUP_FILE" 47 mv "$BACKUP_FILE_TMP" "$BACKUP_FILE"
48 fi 48 fi
49 49
50 if [ $SUCCESS == 0 ]; then 50 if [ $SUCCESS == 0 ]; then
51 echo PASS 51 echo PASS
52 fi 52 fi
OLDNEW
« no previous file with comments | « git_cl/test/rename.sh ('k') | git_cl/test/submit-from-new-dir.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698