From cf78875226f38e6add4b9559093bbb4ca2c5c311 Mon Sep 17 00:00:00 2001 From: mithro Date: Thu, 21 May 2015 00:26:32 -0700 Subject: cc: Adding presubmit to include blink tests Changes in the src/cc directory can often affect the layout tests in Blink however Chromium commit queue doesn't run these tests by default. This leads to breakages being discovered only when the Blink dep is rolled into Chromium. By adding the following line to the CL's description the Blink tests will be run in addition to the normal Chromium tests; CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel BUG=483372 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1142393002 Cr-Commit-Position: refs/heads/master@{#330911} --- cc/PRESUBMIT.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'cc/PRESUBMIT.py') diff --git a/cc/PRESUBMIT.py b/cc/PRESUBMIT.py index fa15632..c850618 100644 --- a/cc/PRESUBMIT.py +++ b/cc/PRESUBMIT.py @@ -333,3 +333,31 @@ def GetPreferredTryMasters(project, change): 'linux_blink_rel': set(['defaulttests']), }, } + +def PostUploadHook(cl, change, output_api): + """git cl upload will call this hook after the issue is created/modified. + + This hook adds extra try bots list to the CL description in order to run + Blink tests in addition to CQ try bots. + """ + rietveld_obj = cl.RpcServer() + issue = cl.issue + description = rietveld_obj.get_description(issue) + if re.search(r'^CQ_INCLUDE_TRYBOTS=.*', description, re.M | re.I): + return [] + + bots = GetPreferredTryMasters(None, change) + bots_string_bits = [] + for master in bots.keys(): + bots_string_bits.append("%s:%s" % (master, ','.join(bots[master].keys()))) + + results = [] + new_description = description + new_description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join(bots_string_bits) + results.append(output_api.PresubmitNotifyResult( + 'Automatically added Perf trybots to run Blink tests on CQ.')) + + if new_description != description: + rietveld_obj.update_description(issue, new_description) + + return results -- cgit v1.1