Commit ac703268 authored by Quinten Yearsley's avatar Quinten Yearsley Committed by Commit Bot

Change GitCL.trigger_try_jobs to accept any sequence.

GitCL.trigger_try_jobs is called with different types in test_importer.py and
rebaseline_cl.py. It's not very complicated to just make it accept any
sequence. This CL adds a bug fix and unit test.

Bug: 776585
Change-Id: Ie9d57e1d388ef08fb24d78b9a61392a70b76723b
Reviewed-on: https://chromium-review.googlesource.com/729541Reviewed-by: default avatarJoshua Bell <jsbell@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510275}
parent 1bf0b92e
...@@ -55,7 +55,7 @@ class GitCL(object): ...@@ -55,7 +55,7 @@ class GitCL(object):
# which are all on the master tryserver.blink, except android_blink_rel. # which are all on the master tryserver.blink, except android_blink_rel.
if 'android_blink_rel' in builders: if 'android_blink_rel' in builders:
self.run(['try', '-b', 'android_blink_rel']) self.run(['try', '-b', 'android_blink_rel'])
builders = builders - {'android_blink_rel'} builders = set(builders) - {'android_blink_rel'}
# The master name has to be explicitly added for some builders since # The master name has to be explicitly added for some builders since
# git cl try doesn't necessarily have a reliable map of builder names # git cl try doesn't necessarily have a reliable map of builder names
# to masters. See https://crbug.com/700552. # to masters. See https://crbug.com/700552.
......
...@@ -53,6 +53,24 @@ class GitCLTest(unittest.TestCase): ...@@ -53,6 +53,24 @@ class GitCLTest(unittest.TestCase):
], ],
]) ])
def test_trigger_try_jobs_with_list(self):
host = MockHost()
git_cl = GitCL(host, auth_refresh_token_json='token.json')
git_cl.trigger_try_jobs(['builder-a', 'android_blink_rel'])
self.assertEqual(host.executive.calls, [
[
'git', 'cl', 'try',
'-b', 'android_blink_rel',
'--auth-refresh-token-json', 'token.json'
],
[
'git', 'cl', 'try',
'-m', 'tryserver.blink',
'-b', 'builder-a',
'--auth-refresh-token-json', 'token.json'
],
])
def test_trigger_try_jobs_with_android_blink_rel(self): def test_trigger_try_jobs_with_android_blink_rel(self):
# The trigger_try_jobs method may be called with an immutable set. # The trigger_try_jobs method may be called with an immutable set.
# It has special logic which assumes most builders to trigger are # It has special logic which assumes most builders to trigger are
......
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