Commit 8d1a14ff authored by ilevy@chromium.org's avatar ilevy@chromium.org

Fix depot_tools tests external dependency

git cl was using system git cl.
- replace git cl status with GIT_CL_STATUS var
- add tested depot_tools to tip of PATH.

R=maruel@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/20889002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@214021 0039d316-1c4b-4281-b951-d872f2087c98
parent 885f6519
...@@ -33,7 +33,7 @@ setup_gitsvn ...@@ -33,7 +33,7 @@ setup_gitsvn
# Verify that "status" doesn't know about it anymore. # Verify that "status" doesn't know about it anymore.
# The "exit" trickiness is inverting the exit status of grep. # The "exit" trickiness is inverting the exit status of grep.
test_expect_success "git-cl status dropped abandoned branch" \ test_expect_success "git-cl status dropped abandoned branch" \
"$GIT_CL status | grep -q abandoned && exit 1 || exit 0" "$GIT_CL_STATUS | grep -q abandoned && exit 1 || exit 0"
) )
SUCCESS=$? SUCCESS=$?
......
...@@ -26,7 +26,7 @@ setup_gitsvn ...@@ -26,7 +26,7 @@ setup_gitsvn
git config rietveld.server localhost:8080 git config rietveld.server localhost:8080
test_expect_success "git-cl status has no issue" \ test_expect_success "git-cl status has no issue" \
"$GIT_CL status | grep -q 'no issue'" "$GIT_CL_STATUS | grep -q 'no issue'"
# Prevent the editor from coming up when you upload. # Prevent the editor from coming up when you upload.
export GIT_EDITOR=$(which true) export GIT_EDITOR=$(which true)
...@@ -35,10 +35,10 @@ setup_gitsvn ...@@ -35,10 +35,10 @@ setup_gitsvn
"$GIT_CL upload -m test master | grep -q 'Issue created'" "$GIT_CL upload -m test master | grep -q 'Issue created'"
test_expect_success "git-cl status now knows the issue" \ test_expect_success "git-cl status now knows the issue" \
"$GIT_CL status | grep -q 'Issue number'" "$GIT_CL_STATUS | grep -q 'Issue number'"
# Push a description to this URL. # Push a description to this URL.
URL=$($GIT_CL status | sed -ne '/Issue number/s/[^(]*(\(.*\))/\1/p') URL=$($GIT_CL_STATUS | sed -ne '/Issue number/s/[^(]*(\(.*\))/\1/p')
curl --cookie dev_appserver_login="test@example.com:False" \ curl --cookie dev_appserver_login="test@example.com:False" \
--data-urlencode subject="test" \ --data-urlencode subject="test" \
--data-urlencode description="foo-quux" \ --data-urlencode description="foo-quux" \
...@@ -54,7 +54,7 @@ setup_gitsvn ...@@ -54,7 +54,7 @@ setup_gitsvn
"git show | grep -q 'foo-quux'" "git show | grep -q 'foo-quux'"
test_expect_success "issue no longer has a branch" \ test_expect_success "issue no longer has a branch" \
"$GIT_CL status | grep -q 'work: None'" "$GIT_CL_STATUS | grep -q 'work: None'"
test_expect_success "upstream svn has our commit" \ test_expect_success "upstream svn has our commit" \
"svn log $REPO_URL 2>/dev/null | grep -q 'foo-quux'" "svn log $REPO_URL 2>/dev/null | grep -q 'foo-quux'"
......
...@@ -33,7 +33,7 @@ END ...@@ -33,7 +33,7 @@ END
"$GIT_CL upload -m test master | grep -q 'Issue created'" "$GIT_CL upload -m test master | grep -q 'Issue created'"
test_expect_success "git-cl status has a suggested reviewer" \ test_expect_success "git-cl status has a suggested reviewer" \
"$GIT_CL status | grep -q 'R=ben@chromium.org'" "$GIT_CL_STATUS | grep -q 'R=ben@chromium.org'"
test_expect_failure "git-cl dcommit fails w/ missing LGTM" \ test_expect_failure "git-cl dcommit fails w/ missing LGTM" \
"$GIT_CL dcommit -f" "$GIT_CL dcommit -f"
......
...@@ -27,9 +27,9 @@ setup_gitsvn ...@@ -27,9 +27,9 @@ setup_gitsvn
"$GIT_CL upload -m test master | grep -q 'Issue created'" "$GIT_CL upload -m test master | grep -q 'Issue created'"
test_expect_success "git-cl status now knows the issue" \ test_expect_success "git-cl status now knows the issue" \
"$GIT_CL status | grep -q 'Issue number'" "$GIT_CL_STATUS | grep -q 'Issue number'"
ISSUE=$($GIT_CL status | awk '$0 ~ "Issue number:" { print $3 }') ISSUE=$($GIT_CL_STATUS | awk '$0 ~ "Issue number:" { print $3 }')
git checkout -q -b test2 master git checkout -q -b test2 master
......
...@@ -26,7 +26,7 @@ setup_gitgit ...@@ -26,7 +26,7 @@ setup_gitgit
git config rietveld.server localhost:8080 git config rietveld.server localhost:8080
test_expect_success "git-cl status has no issue" \ test_expect_success "git-cl status has no issue" \
"$GIT_CL status | grep -q 'no issue'" "$GIT_CL_STATUS | grep -q 'no issue'"
# Prevent the editor from coming up when you upload. # Prevent the editor from coming up when you upload.
export GIT_EDITOR=$(which true) export GIT_EDITOR=$(which true)
...@@ -34,10 +34,10 @@ setup_gitgit ...@@ -34,10 +34,10 @@ setup_gitgit
"$GIT_CL upload -m test master | grep -q 'Issue created'" "$GIT_CL upload -m test master | grep -q 'Issue created'"
test_expect_success "git-cl status now knows the issue" \ test_expect_success "git-cl status now knows the issue" \
"$GIT_CL status | grep -q 'Issue number'" "$GIT_CL_STATUS | grep -q 'Issue number'"
# Push a description to this URL. # Push a description to this URL.
URL=$($GIT_CL status | sed -ne '/Issue number/s/[^(]*(\(.*\))/\1/p') URL=$($GIT_CL_STATUS | sed -ne '/Issue number/s/[^(]*(\(.*\))/\1/p')
curl --cookie dev_appserver_login="test@example.com:False" \ curl --cookie dev_appserver_login="test@example.com:False" \
--data-urlencode subject="test" \ --data-urlencode subject="test" \
--data-urlencode description="foo-quux" \ --data-urlencode description="foo-quux" \
...@@ -45,7 +45,7 @@ setup_gitgit ...@@ -45,7 +45,7 @@ setup_gitgit
$URL/edit $URL/edit
test_expect_success "Base URL contains branch name" \ test_expect_success "Base URL contains branch name" \
"curl -s $($GIT_CL status --field=url) | grep 'URL:' | grep -q '@master'" "curl -s $($GIT_CL_STATUS --field=url) | grep 'URL:' | grep -q '@master'"
test_expect_success "git-cl push ok" \ test_expect_success "git-cl push ok" \
"$GIT_CL push -f" "$GIT_CL push -f"
...@@ -57,7 +57,7 @@ setup_gitgit ...@@ -57,7 +57,7 @@ setup_gitgit
"git show | grep -q 'foo-quux'" "git show | grep -q 'foo-quux'"
test_expect_success "issue no longer has a branch" \ test_expect_success "issue no longer has a branch" \
"$GIT_CL status | grep -q 'work: None'" "$GIT_CL_STATUS | grep -q 'work: None'"
cd $GITREPO_PATH cd $GITREPO_PATH
test_expect_success "upstream repo has our commit" \ test_expect_success "upstream repo has our commit" \
......
...@@ -26,7 +26,7 @@ setup_gitgit ...@@ -26,7 +26,7 @@ setup_gitgit
git config rietveld.server localhost:8080 git config rietveld.server localhost:8080
test_expect_success "git-cl status has no issue" \ test_expect_success "git-cl status has no issue" \
"$GIT_CL status | grep -q 'no issue'" "$GIT_CL_STATUS | grep -q 'no issue'"
# Prevent the editor from coming up when you upload. # Prevent the editor from coming up when you upload.
export EDITOR=$(which true) export EDITOR=$(which true)
...@@ -35,15 +35,15 @@ setup_gitgit ...@@ -35,15 +35,15 @@ setup_gitgit
grep -q 'Issue created'" grep -q 'Issue created'"
test_expect_success "git-cl status now knows the issue" \ test_expect_success "git-cl status now knows the issue" \
"$GIT_CL status | grep -q 'Issue number'" "$GIT_CL_STATUS | grep -q 'Issue number'"
# Check to see if the description contains the local commit messages. # Check to see if the description contains the local commit messages.
# Should contain 'branch work' x 2. # Should contain 'branch work' x 2.
test_expect_success "git-cl status has the right description for the log" \ test_expect_success "git-cl status has the right description for the log" \
"$GIT_CL status --field desc | [ $( egrep -q '^branch work$' -c ) -eq 2 ] "$GIT_CL_STATUS --field desc | [ $( egrep -q '^branch work$' -c ) -eq 2 ]
test_expect_success "git-cl status has the right subject from message" \ test_expect_success "git-cl status has the right subject from message" \
"$GIT_CL status --field desc | \ "$GIT_CL_STATUS --field desc | \
[ $( egrep -q '^test$' --byte-offset) | grep '^0:' ] [ $( egrep -q '^test$' --byte-offset) | grep '^0:' ]
test_expect_success "git-cl push ok" \ test_expect_success "git-cl push ok" \
...@@ -56,7 +56,7 @@ setup_gitgit ...@@ -56,7 +56,7 @@ setup_gitgit
"git show | [ $( egrep -q '^branch work$' -c ) -eq 2 ] "git show | [ $( egrep -q '^branch work$' -c ) -eq 2 ]
test_expect_success "issue no longer has a branch" \ test_expect_success "issue no longer has a branch" \
"$GIT_CL status | grep -q 'work: None'" "$GIT_CL_STATUS | grep -q 'work: None'"
cd $GITREPO_PATH cd $GITREPO_PATH
test_expect_success "upstream repo has our commit" \ test_expect_success "upstream repo has our commit" \
......
...@@ -15,7 +15,9 @@ TRUNK_URL=$REPO_URL/trunk ...@@ -15,7 +15,9 @@ TRUNK_URL=$REPO_URL/trunk
BRANCH_URL=$REPO_URL/branches/some_branch BRANCH_URL=$REPO_URL/branches/some_branch
GITREPO_PATH=$PWD/gitrepo GITREPO_PATH=$PWD/gitrepo
GITREPO_URL=file://$GITREPO_PATH GITREPO_URL=file://$GITREPO_PATH
PATH="$PWD/..:$PATH"
GIT_CL=$PWD/../git-cl GIT_CL=$PWD/../git-cl
GIT_CL_STATUS="$GIT_CL status -f"
# Set up an SVN repo that has a few commits to trunk. # Set up an SVN repo that has a few commits to trunk.
setup_initsvn() { setup_initsvn() {
......
...@@ -26,7 +26,7 @@ setup_gitgit ...@@ -26,7 +26,7 @@ setup_gitgit
"$GIT_CL upload -m test | grep -q 'Issue created'" "$GIT_CL upload -m test | grep -q 'Issue created'"
test_expect_failure "description shouldn't contain unrelated commits" \ test_expect_failure "description shouldn't contain unrelated commits" \
"$GIT_CL status | grep -q 'second commit'" "$GIT_CL_STATUS | grep -q 'second commit'"
) )
SUCCESS=$? SUCCESS=$?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment