OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 |
| 3 set -e |
| 4 |
| 5 . ./test-lib.sh |
| 6 |
| 7 setup_initsvn |
| 8 setup_gitsvn |
| 9 |
| 10 ( |
| 11 set -e |
| 12 cd git-svn |
| 13 git checkout -q -b work |
| 14 echo "some work done on a branch" >> test |
| 15 git add test; git commit -q -m "branch work" |
| 16 echo "some other work done on a branch" >> test |
| 17 git add test; git commit -q -m "branch work" |
| 18 |
| 19 test_expect_success "git-cl upload wants a server" \ |
| 20 "$GIT_CL upload 2>&1 | grep -q 'You must configure'" |
| 21 |
| 22 git config rietveld.server localhost:8080 |
| 23 |
| 24 test_expect_success "git-cl status has no issue" \ |
| 25 "$GIT_CL status | grep -q 'no issue'" |
| 26 |
| 27 # Prevent the editor from coming up when you upload. |
| 28 export EDITOR=/bin/true |
| 29 test_expect_success "upload succeeds (needs a server running on localhost)" \ |
| 30 "$GIT_CL upload -m test master... | grep -q 'Issue created'" |
| 31 |
| 32 test_expect_success "git-cl status now knows the issue" \ |
| 33 "$GIT_CL status | grep -q 'Issue number'" |
| 34 |
| 35 # Push a description to this URL. |
| 36 URL=$($GIT_CL status | sed -ne '/Issue number/s/[^(]*(\(.*\))/\1/p') |
| 37 curl --cookie dev_appserver_login="test@example.com:False" \ |
| 38 --data-urlencode subject="test" \ |
| 39 --data-urlencode description="foo-quux" \ |
| 40 $URL/edit |
| 41 |
| 42 test_expect_success "git-cl dcommits ok" \ |
| 43 "$GIT_CL dcommit -f" |
| 44 |
| 45 git checkout -q master |
| 46 git svn -q rebase >/dev/null 2>&1 |
| 47 test_expect_success "dcommitted code has proper description" \ |
| 48 "git show | grep -q 'foo-quux'" |
| 49 |
| 50 test_expect_success "issue no longer has a branch" \ |
| 51 "git cl status | grep -q 'work: None'" |
| 52 |
| 53 test_expect_success "upstream svn has our commit" \ |
| 54 "svn log $REPO_URL 2>/dev/null | grep -q 'foo-quux'" |
| 55 ) |
| 56 SUCCESS=$? |
| 57 |
| 58 cleanup |
| 59 |
| 60 if [ $SUCCESS == 0 ]; then |
| 61 echo PASS |
| 62 fi |
OLD | NEW |