|
|
DescriptionMake git cl upload correctly track upstream refs when uploading to Gerrit
NOPRESUBMIT because it's broke on CQ, Cf. https://codereview.chromium.org/1124803002
BUG=478260
NOPRESUBMIT=true
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=295124
Patch Set 1 #
Total comments: 2
Patch Set 2 : Long line fix & rebase #Messages
Total messages: 16 (7 generated)
luqui@chromium.org changed reviewers: + iannucci@chromium.org, wittman@chromium.org
ptal Wdyt about the awful choice? https://codereview.chromium.org/1110293002/diff/1/tests/git_cl_test.py File tests/git_cl_test.py (right): https://codereview.chromium.org/1110293002/diff/1/tests/git_cl_test.py#newcod... tests/git_cl_test.py:579: expected_upstream_ref='origin/refs/heads/master'): Yes yes this is awful. My alternatives: 1. Dig into git_common and get it not to shorten this under some conditions. 2. Manually shorten the upstream ref under some conditions 3. Remove upload --squash coverage 4. Refactor tests to allow "equivalence classes" of tests 4 is the best but way too much work for this. I worry about evil corner cases of 1 and 2.
lgtm Sorry for the delay. https://codereview.chromium.org/1110293002/diff/1/tests/git_cl_test.py File tests/git_cl_test.py (right): https://codereview.chromium.org/1110293002/diff/1/tests/git_cl_test.py#newcod... tests/git_cl_test.py:579: expected_upstream_ref='origin/refs/heads/master'): On 2015/04/28 23:56:24, luqui wrote: > Yes yes this is awful. My alternatives: > > 1. Dig into git_common and get it not to shorten this under some conditions. > 2. Manually shorten the upstream ref under some conditions > 3. Remove upload --squash coverage > 4. Refactor tests to allow "equivalence classes" of tests > > 4 is the best but way too much work for this. I worry about evil corner cases > of 1 and 2. I went the same way attempting to get the GetTargetRef functionality tested in the style of these tests before giving up under the complexity of managing the various equivalent branch names across all the various git calls. This is much more limited in scope though and doesn't look too horrible to me.
lgtm, these tests are, IMO, pretty bonkers anyway, since they mock so many large systems (like git) poorly, or presumptively.
The CQ bit was checked by luqui@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1110293002/1
The CQ bit was unchecked by commit-bot@chromium.org
Presubmit check for 1110293002-1 failed and returned exit status 1. Running presubmit commit checks ... Initialized empty Git repository in /b/infra_internal/commit_queue/workdir/tools/depot_tools/testing_support/_rietveld/.git/ Updating origin From https://chromium.googlesource.com/infra/infra * [new branch] deployed -> origin/deployed * [new branch] master -> origin/master From https://chromium.googlesource.com/infra/infra * branch master -> FETCH_HEAD Checking out rietveld... Running save-description-on-failure.sh Running push-basic.sh Running upstream.sh Running submit-from-new-dir.sh Running abandon.sh Running submodule-merge-test.sh Running upload-local-tracking-branch.sh Running hooks.sh Running post-dcommit-hook-test.sh Running upload-stale.sh Running patch.sh Running basic.sh ** Presubmit ERRORS ** Pylint (117 files) (131.03s) failed ************* Module git_cl_test C:624, 0: Line too long (81/80) (line-too-long) tests/git_rebase_update_test.py (12.35s) failed .Switched to branch foobar. Switched to branch sub_K. Switched to branch old_branch. Switched to branch empty_branch. Switched to branch empty_branch2. FSwitched to branch foobar. . ====================================================================== FAIL: testRebaseUpdate (__main__.GitRebaseUpdateTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/git_rebase_update_test.py", line 207, in testRebaseUpdate 'branch_L', 'old_branch', 'foobar'}) AssertionError: Items in the first set but not the second: 'origin/master)' ---------------------------------------------------------------------- Ran 3 tests in 12.054s FAILED (failures=1) Name Stmts Miss Cover Missing --------------------------------------------------- git_new_branch 28 0 100% git_rebase_update 144 0 100% git_rename_branch 29 0 100% git_reparent_branch 43 0 100% --------------------------------------------------- TOTAL 244 0 100% tests/git_common_test.py (6.34s) failed ...x....F.....FF........uCannot foo with a dirty tree. You must commit locally first. Uncommitted files: (git diff-index --name-status HEAD) A test.file ....... ====================================================================== FAIL: testGetBranchTree (__main__.GitMutableStructuredTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/git_common_test.py", line 536, in testGetBranchTree self.assertEqual(skipped, {'master', 'root_X', 'branch_DOG', 'root_CAT'}) AssertionError: Items in the first set but not the second: '78df7e3)' ====================================================================== FAIL: testTooManyBranches (__main__.GitMutableStructuredTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/git_common_test.py", line 464, in testTooManyBranches self.assertEqual(38, len(self.repo.run(list, self.gc.branches()))) AssertionError: 38 != 39 ====================================================================== FAIL: testBranches (__main__.GitReadOnlyFunctionsTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/git_common_test.py", line 235, in testBranches {'master', 'branch_D', 'root_A'}) AssertionError: Items in the first set but not the second: '696a838)' ---------------------------------------------------------------------- Ran 32 tests in 6.117s FAILED (failures=3, expected failures=1, unexpected successes=1) Name Stmts Miss Cover Missing ------------------------------------------ git_common 388 19 95% 319, 683-706 FATAL: not at 100% coverage. Presubmit checks took 176.5s to calculate. Was the presubmit check useful? If not, run "git cl presubmit -v" to figure out which PRESUBMIT.py was run, then run git blame on the file to figure out who to ask for help.
The CQ bit was checked by luqui@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from wittman@chromium.org, iannucci@chromium.org Link to the patchset: https://codereview.chromium.org/1110293002/#ps20001 (title: "Long line fix & rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1110293002/20001
The CQ bit was unchecked by commit-bot@chromium.org
Presubmit check for 1110293002-20001 failed and returned exit status 1. Running presubmit commit checks ... Initialized empty Git repository in /b/infra_internal/commit_queue/workdir/tools/depot_tools/testing_support/_rietveld/.git/ Updating origin From https://chromium.googlesource.com/infra/infra * [new branch] deployed -> origin/deployed * [new branch] master -> origin/master From https://chromium.googlesource.com/infra/infra * branch master -> FETCH_HEAD Checking out rietveld... Running save-description-on-failure.sh Running push-basic.sh Running upstream.sh Running submit-from-new-dir.sh Running abandon.sh Running submodule-merge-test.sh Running upload-local-tracking-branch.sh Running hooks.sh Running post-dcommit-hook-test.sh Running upload-stale.sh Running patch.sh Running basic.sh ** Presubmit ERRORS ** tests/checkout_test.py (37.92s) failed Cloning into '/tmp/trialGxGZhv/__main__.GitCheckout.testAll/foo'... done. Switched to branch 'master' Already on 'master' .sECloning into '/tmp/trialGxGZhv/__main__.GitCheckout.testProcess/foo'... done. .................... ====================================================================== ERROR: testMove (__main__.GitCheckout) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/checkout_test.py", line 347, in setUp self.enabled = self.FAKE_REPOS.set_up_git() File "/b/infra_internal/commit_queue/workdir/tools/depot_tools/testing_support/fake_repos.py", line 359, in set_up_git self.set_up() File "/b/infra_internal/commit_queue/workdir/tools/depot_tools/testing_support/fake_repos.py", line 211, in set_up self.cleanup_dirt() File "/b/infra_internal/commit_queue/workdir/tools/depot_tools/testing_support/fake_repos.py", line 229, in cleanup_dirt if not self.tear_down_git(): File "/b/infra_internal/commit_queue/workdir/tools/depot_tools/testing_support/fake_repos.py", line 276, in tear_down_git wait_for_port_to_free(self.host, self.git_port) File "/b/infra_internal/commit_queue/workdir/tools/depot_tools/testing_support/fake_repos.py", line 161, in wait_for_port_to_free assert False, '%d is still bound' % port AssertionError: 20000 is still bound ---------------------------------------------------------------------- Ran 23 tests in 37.678s FAILED (errors=1, skipped=1) tests/git_rebase_update_test.py (12.89s) failed .Switched to branch foobar. Switched to branch sub_K. Switched to branch old_branch. Switched to branch empty_branch. Switched to branch empty_branch2. FSwitched to branch foobar. . ====================================================================== FAIL: testRebaseUpdate (__main__.GitRebaseUpdateTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/git_rebase_update_test.py", line 207, in testRebaseUpdate 'branch_L', 'old_branch', 'foobar'}) AssertionError: Items in the first set but not the second: 'origin/master)' ---------------------------------------------------------------------- Ran 3 tests in 12.520s FAILED (failures=1) Name Stmts Miss Cover Missing --------------------------------------------------- git_new_branch 28 0 100% git_rebase_update 144 0 100% git_rename_branch 29 0 100% git_reparent_branch 43 0 100% --------------------------------------------------- TOTAL 244 0 100% tests/git_common_test.py (6.61s) failed ...x....F.....FF........uCannot foo with a dirty tree. You must commit locally first. Uncommitted files: (git diff-index --name-status HEAD) A test.file ....... ====================================================================== FAIL: testGetBranchTree (__main__.GitMutableStructuredTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/git_common_test.py", line 536, in testGetBranchTree self.assertEqual(skipped, {'master', 'root_X', 'branch_DOG', 'root_CAT'}) AssertionError: Items in the first set but not the second: '78df7e3)' ====================================================================== FAIL: testTooManyBranches (__main__.GitMutableStructuredTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/git_common_test.py", line 464, in testTooManyBranches self.assertEqual(38, len(self.repo.run(list, self.gc.branches()))) AssertionError: 38 != 39 ====================================================================== FAIL: testBranches (__main__.GitReadOnlyFunctionsTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/git_common_test.py", line 235, in testBranches {'master', 'branch_D', 'root_A'}) AssertionError: Items in the first set but not the second: '696a838)' ---------------------------------------------------------------------- Ran 32 tests in 6.413s FAILED (failures=3, expected failures=1, unexpected successes=1) Name Stmts Miss Cover Missing ------------------------------------------ git_common 388 19 95% 319, 683-706 FATAL: not at 100% coverage. Presubmit checks took 193.9s to calculate.
The CQ bit was checked by luqui@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1110293002/20001
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as http://src.chromium.org/viewvc/chrome?view=rev&revision=295124 |