Commit d0b9283b authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa Committed by Commit Bot

WPT Import: Use the "cq_experimental" tag to check for experimental builds

We were previously using the "experimental" field in the JSON returned by
`git-cl try-results`, but that field actually corresponds to whether a
recipe is running in experimental mode. See e.g.

    https://cs.chromium.org/chromium/infra/recipes-py/recipe_modules/runtime/api.py?q=is_experimental&sq=package:chromium&l=27&dr=CSs

What we need is the "cq_experimental" tag that really indicates whether a
trybot is scheduled in an experimental commit queue per

    https://cs.chromium.org/chromium/infra/go/src/infra/libs/bqschema/buildevent/completedbuild.go?type=cs&sq=package:chromium&l=31

This tag is also used by the Buildbucket Gerrit plugin to split bots into
experimental and non-experimental ones.

Bug: 792652, 821445
Change-Id: I267bf033729b6a74382d018cb3da06c64dc7b207
Reviewed-on: https://chromium-review.googlesource.com/964121Reviewed-by: default avatarRobert Ma <robertma@chromium.org>
Reviewed-by: default avatarQuinten Yearsley <qyearsley@chromium.org>
Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/master@{#543385}
parent 0ac3ad8c
...@@ -196,7 +196,7 @@ class GitCL(object): ...@@ -196,7 +196,7 @@ class GitCL(object):
if is_swarming_task and not include_swarming_tasks: if is_swarming_task and not include_swarming_tasks:
continue continue
is_cq = 'user_agent:cq' in result.get('tags', []) is_cq = 'user_agent:cq' in result.get('tags', [])
is_experimental = result.get('experimental') is_experimental = 'cq_experimental:true' in result.get('tags', [])
if cq_only and not (is_cq and not is_experimental): if cq_only and not (is_cq and not is_experimental):
continue continue
build_to_status[self._build(result)] = self._try_job_status(result) build_to_status[self._build(result)] = self._try_job_status(result)
......
...@@ -287,27 +287,61 @@ class GitCLTest(unittest.TestCase): ...@@ -287,27 +287,61 @@ class GitCLTest(unittest.TestCase):
'tags': ['user_agent:cq'], 'tags': ['user_agent:cq'],
'url': None, 'url': None,
}, },
{
'builder_name': 'cq-b',
'experimental': False,
'result': None,
'status': 'SCHEDULED',
'tags': ['cq_experimental:false', 'user_agent:cq'],
'url': None,
},
{
'builder_name': 'cq-c',
'experimental': True,
'result': None,
'status': 'SCHEDULED',
'tags': ['cq_experimental:false', 'user_agent:cq'],
'url': None,
},
{ {
'builder_name': 'cq-a-experimental', 'builder_name': 'cq-a-experimental',
'experimental': True, 'experimental': True,
'result': None, 'result': None,
'status': 'SCHEDULED', 'status': 'SCHEDULED',
'tags': ['user_agent:cq'], 'tags': ['cq_experimental:true', 'user_agent:cq'],
'url': None, 'url': None,
}, },
{ {
'builder_name': 'other', 'builder_name': 'cq-b-experimental',
'experimental': False,
'result': None,
'status': 'SCHEDULED',
'tags': ['cq_experimental:true', 'user_agent:cq'],
'url': None,
},
{
'builder_name': 'other-a',
'experimental': False, 'experimental': False,
'status': 'SCHEDULED', 'status': 'SCHEDULED',
'result': None, 'result': None,
'tags': ['user_agent:git_cl_try'], 'tags': ['user_agent:git_cl_try'],
'url': None, 'url': None,
}, },
{
'builder_name': 'other-b',
'experimental': False,
'status': 'SCHEDULED',
'result': None,
'tags': ['is_experimental:false', 'user_agent:git_cl_try'],
'url': None,
},
] ]
self.assertEqual( self.assertEqual(
git_cl.latest_try_jobs(cq_only=True), git_cl.latest_try_jobs(cq_only=True),
{ {
Build('cq-a'): TryJobStatus('SCHEDULED'), Build('cq-a'): TryJobStatus('SCHEDULED'),
Build('cq-b'): TryJobStatus('SCHEDULED'),
Build('cq-c'): TryJobStatus('SCHEDULED'),
}) })
def test_latest_try_jobs(self): def test_latest_try_jobs(self):
......
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