Commit c68a1753 authored by Andrii Shyshkalov's avatar Andrii Shyshkalov Committed by Commit Bot

git cl try-results: delete Rietveld support.

R=ehmaldonado

Bug: 770408
Change-Id: I94ff37f198937dc7d341a859a71becd91cf3a706
Reviewed-on: https://chromium-review.googlesource.com/c/1279140
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
parent 38d36a61
......@@ -5400,16 +5400,6 @@ def CMDtry(parser, args):
return 1
patchset = cl.GetMostRecentPatchset()
# TODO(tandrii): Checking local patchset against remote patchset is only
# supported for Rietveld. Extend it to Gerrit or remove it completely.
if not cl.IsGerrit() and patchset != cl.GetPatchset():
print('Warning: Codereview server has newer patchsets (%s) than most '
'recent upload from local checkout (%s). Did a previous upload '
'fail?\n'
'By default, git cl try uses the latest patchset from '
'codereview, continuing to use patchset %s.\n' %
(patchset, cl.GetPatchset(), patchset))
try:
_trigger_try_jobs(auth_config, cl, buckets, options, patchset)
except BuildbucketResponseException as ex:
......@@ -5459,15 +5449,6 @@ def CMDtry_results(parser, args):
'Either upload first, or pass --patchset explicitly' %
cl.GetIssue())
# TODO(tandrii): Checking local patchset against remote patchset is only
# supported for Rietveld. Extend it to Gerrit or remove it completely.
if not cl.IsGerrit() and patchset != cl.GetPatchset():
print('Warning: Codereview server has newer patchsets (%s) than most '
'recent upload from local checkout (%s). Did a previous upload '
'fail?\n'
'By default, git cl try-results uses the latest patchset from '
'codereview, continuing to use patchset %s.\n' %
(patchset, cl.GetPatchset(), patchset))
try:
jobs = fetch_try_jobs(auth_config, cl, options.buildbucket_host, patchset)
except BuildbucketResponseException as ex:
......
......@@ -2526,38 +2526,6 @@ class TestGitCl(TestCase):
self.mock(git_cl, '_buildbucket_retry', lambda *_, **__:
self._mocked_call(['_buildbucket_retry']))
def _setup_fetch_try_jobs_rietveld(self, *request_results):
self._setup_fetch_try_jobs(most_recent_patchset=20001)
self.calls += [
((['git', 'symbolic-ref', 'HEAD'],), 'feature'),
((['git', 'config', 'branch.feature.rietveldissue'],), '1'),
((['git', 'config', 'rietveld.autoupdate'],), CERR1),
((['git', 'config', 'rietveld.server'],), 'codereview.example.com'),
((['git', 'config', 'branch.feature.rietveldpatchset'],), '20001'),
((['git', 'config', 'branch.feature.rietveldserver'],),
'codereview.example.com'),
((['get_authenticator_for_host', 'codereview.example.com'],),
AuthenticatorMock()),
] + [((['_buildbucket_retry'],), r) for r in request_results]
def test_fetch_try_jobs_none_rietveld(self):
self._setup_fetch_try_jobs_rietveld({})
# Simulate that user isn't logged in.
self.mock(AuthenticatorMock, 'has_cached_credentials', lambda _: False)
self.assertEqual(0, git_cl.main(['try-results']))
self.assertRegexpMatches(sys.stdout.getvalue(),
'Warning: Some results might be missing')
self.assertRegexpMatches(sys.stdout.getvalue(), 'No try jobs')
def test_fetch_try_jobs_some_rietveld(self):
self._setup_fetch_try_jobs_rietveld({
'builds': self.BUILDBUCKET_BUILDS_MAP.values(),
})
self.assertEqual(0, git_cl.main(['try-results']))
self.assertRegexpMatches(sys.stdout.getvalue(), '^Failures:')
self.assertRegexpMatches(sys.stdout.getvalue(), 'Started:')
self.assertRegexpMatches(sys.stdout.getvalue(), '2 try jobs')
def _setup_fetch_try_jobs_gerrit(self, *request_results):
self._setup_fetch_try_jobs(most_recent_patchset=13)
self.calls += [
......
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