| OLD | NEW |
| 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 set -e | 7 set -e |
| 8 | 8 |
| 9 . ./test-lib.sh | 9 . ./test-lib.sh |
| 10 | 10 |
| 11 setup_initsvn | 11 setup_git_remote |
| 12 setup_gitsvn | 12 setup_git_checkout |
| 13 | 13 |
| 14 ( | 14 ( |
| 15 | |
| 16 set -e | 15 set -e |
| 17 cd git-svn | 16 cd git_checkout |
| 18 git config rietveld.server localhost:10000 | 17 git config rietveld.server localhost:10000 |
| 19 export GIT_EDITOR=$(which true) | 18 export GIT_EDITOR=$(which true) |
| 20 | 19 |
| 21 git checkout -q -b work | 20 git checkout -q -b work |
| 22 echo "ben@chromium.org" > OWNERS | 21 echo "ben@chromium.org" > OWNERS |
| 23 cat <<END > PRESUBMIT.py | 22 cat <<END > PRESUBMIT.py |
| 24 def CheckChangeOnCommit(input_api, output_api): | 23 def CheckChangeOnCommit(input_api, output_api): |
| 25 return input_api.canned_checks.CheckOwners(input_api, output_api) | 24 return input_api.canned_checks.CheckOwners(input_api, output_api) |
| 26 | 25 |
| 27 CheckChangeOnUpload = CheckChangeOnCommit | 26 CheckChangeOnUpload = CheckChangeOnCommit |
| 28 END | 27 END |
| 29 | 28 |
| 30 git add OWNERS PRESUBMIT.py ; git commit -q -m "add OWNERS" | 29 git add OWNERS PRESUBMIT.py ; git commit -q -m "add OWNERS" |
| 31 | 30 |
| 32 test_expect_success "upload succeeds (needs a server running on localhost)" \ | 31 test_expect_success "upload succeeds (needs a server running on localhost)" \ |
| 33 "$GIT_CL upload --no-oauth2 -m test master | grep -q 'Issue created'" | 32 "$GIT_CL upload --no-oauth2 -m test master | grep -q 'Issue created'" |
| 34 | 33 |
| 35 test_expect_success "git-cl status has a suggested reviewer" \ | 34 test_expect_failure "git-cl land fails w/ missing LGTM" \ |
| 36 "$GIT_CL_STATUS | grep -q 'R=ben@chromium.org'" | 35 "$GIT_CL land -f --no-oauth2" |
| 37 | |
| 38 test_expect_failure "git-cl dcommit fails w/ missing LGTM" \ | |
| 39 "$GIT_CL dcommit -f --no-oauth2" | |
| 40 | |
| 41 test_expect_success "git-cl dcommit --tbr succeeds" \ | |
| 42 "$GIT_CL dcommit --tbr -f --no-oauth2 | grep -q -- '--tbr was specified'" | |
| 43 ) | 36 ) |
| 44 SUCCESS=$? | 37 SUCCESS=$? |
| 45 | 38 |
| 46 cleanup | 39 cleanup |
| 47 | 40 |
| 48 if [ $SUCCESS == 0 ]; then | 41 if [ $SUCCESS == 0 ]; then |
| 49 echo PASS | 42 echo PASS |
| 50 fi | 43 fi |
| OLD | NEW |