OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 set -e | 3 set -e |
4 | 4 |
5 . ./test-lib.sh | 5 . ./test-lib.sh |
6 | 6 |
7 setup_initgit | 7 setup_initgit |
8 setup_gitgit | 8 setup_gitgit |
9 | 9 |
10 ( | 10 ( |
11 set -e | 11 set -e |
12 cd git-git | 12 cd git-git |
13 git checkout -q --track -b work origin | 13 git checkout -q --track -b work origin |
14 echo "some work done on a branch" >> test | 14 echo "some work done on a branch" >> test |
15 git add test; git commit -q -m "branch work" | 15 git add test; git commit -q -m "branch work" |
16 echo "some other work done on a branch" >> test | 16 echo "some other work done on a branch" >> test |
17 git add test; git commit -q -m "branch work" | 17 git add test; git commit -q -m "branch work" |
18 | 18 |
19 test_expect_success "git-cl upload wants a server" \ | 19 test_expect_success "git-cl upload wants a server" \ |
20 "$GIT_CL upload 2>&1 | grep -q 'You must configure'" | 20 "$GIT_CL upload 2>&1 | grep -q 'You must configure'" |
21 | 21 |
22 git config rietveld.server localhost:8080 | 22 git config rietveld.server localhost:8080 |
23 | 23 |
24 test_expect_success "git-cl status has no issue" \ | 24 test_expect_success "git-cl status has no issue" \ |
25 "$GIT_CL status | grep -q 'no issue'" | 25 "$GIT_CL status | grep -q 'no issue'" |
26 | 26 |
27 # Prevent the editor from coming up when you upload. | 27 # Prevent the editor from coming up when you upload. |
28 export EDITOR=$(which true) | 28 export EDITOR=$(which true) |
29 test_expect_success "upload succeeds (needs a server running on localhost)" \ | 29 test_expect_success "upload succeeds (needs a server running on localhost)" \ |
30 "$GIT_CL upload -m test master... | grep -q 'Issue created'" | 30 "$GIT_CL upload -m test master | grep -q 'Issue created'" |
31 | 31 |
32 test_expect_success "git-cl status now knows the issue" \ | 32 test_expect_success "git-cl status now knows the issue" \ |
33 "$GIT_CL status | grep -q 'Issue number'" | 33 "$GIT_CL status | grep -q 'Issue number'" |
34 | 34 |
35 # Push a description to this URL. | 35 # Push a description to this URL. |
36 URL=$($GIT_CL status | sed -ne '/Issue number/s/[^(]*(\(.*\))/\1/p') | 36 URL=$($GIT_CL status | sed -ne '/Issue number/s/[^(]*(\(.*\))/\1/p') |
37 curl --cookie dev_appserver_login="test@example.com:False" \ | 37 curl --cookie dev_appserver_login="test@example.com:False" \ |
38 --data-urlencode subject="test" \ | 38 --data-urlencode subject="test" \ |
39 --data-urlencode description="foo-quux" \ | 39 --data-urlencode description="foo-quux" \ |
40 --data-urlencode xsrf_token="$(print_xsrf_token)" \ | 40 --data-urlencode xsrf_token="$(print_xsrf_token)" \ |
(...skipping 18 matching lines...) Expand all Loading... |
59 test_expect_success "upstream repo has our commit" \ | 59 test_expect_success "upstream repo has our commit" \ |
60 "git log master 2>/dev/null | grep -q 'foo-quux'" | 60 "git log master 2>/dev/null | grep -q 'foo-quux'" |
61 ) | 61 ) |
62 SUCCESS=$? | 62 SUCCESS=$? |
63 | 63 |
64 cleanup | 64 cleanup |
65 | 65 |
66 if [ $SUCCESS == 0 ]; then | 66 if [ $SUCCESS == 0 ]; then |
67 echo PASS | 67 echo PASS |
68 fi | 68 fi |
OLD | NEW |