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

Unified Diff: git_cl/test/owners.sh

Issue 6674014: Make git-cl work with OWNERS files in a non .git/hooks/pre-cl-* world (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: rebase to HEAD, minor linting, cleanup, testing, fix post-commit hook 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 side-by-side diff with in-line comments
Download patch
Index: git_cl/test/owners.sh
diff --git a/git_cl/test/owners.sh b/git_cl/test/owners.sh
new file mode 100755
index 0000000000000000000000000000000000000000..4c3ad72008c8af6b6a3fec458652131bc6e6bd29
--- /dev/null
+++ b/git_cl/test/owners.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+set -e
+
+. ./test-lib.sh
+
+setup_initsvn
+setup_gitsvn
+
+(
+
+ set -e
+ cd git-svn
+ git config rietveld.server localhost:8080
+ export EDITOR=$(which true)
+
+ git checkout -q -b work
+ echo "ben@chromium.org" > OWNERS
+ cat <<END > PRESUBMIT.py
+def CheckChangeOnCommit(input_api, output_api):
+ return input_api.canned_checks.CheckOwners(input_api, output_api)
+
+CheckChangeOnUpload = CheckChangeOnCommit
+END
+
+ git add OWNERS PRESUBMIT.py ; git commit -q -m "add OWNERS"
+
+ test_expect_success "upload succeeds (needs a server running on localhost)" \
+ "$GIT_CL upload -m test master | grep -q 'Issue created'"
+
+ test_expect_success "git-cl status has a suggested reviewer" \
+ "$GIT_CL status | grep -q 'R=ben@chromium.org'"
+
+ test_expect_failure "git-cl dcommit fails w/ missing LGTM" \
+ "$GIT_CL dcommit"
+
+ test_expect_success "git-cl dcommit --tbr succeeds" \
+ "$GIT_CL dcommit --tbr -f | grep -q -- '--tbr was specified'"
+)
+SUCCESS=$?
+
+cleanup
+
+if [ $SUCCESS == 0 ]; then
+ echo PASS
+fi
« git_cl/git_cl.py ('K') | « git_cl/git_cl.py ('k') | git_cl/test/post-dcommit-hook-test.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698