OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Top-level presubmit script for cc. | 5 """Top-level presubmit script for cc. |
6 | 6 |
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
8 for more details about the presubmit API built into depot_tools. | 8 for more details about the presubmit API built into depot_tools. |
9 """ | 9 """ |
10 | 10 |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 results += FindUselessIfdefs(input_api, output_api) | 326 results += FindUselessIfdefs(input_api, output_api) |
327 results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api) | 327 results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api) |
328 return results | 328 return results |
329 | 329 |
330 def GetPreferredTryMasters(project, change): | 330 def GetPreferredTryMasters(project, change): |
331 return { | 331 return { |
332 'tryserver.blink': { | 332 'tryserver.blink': { |
333 'linux_blink_rel': set(['defaulttests']), | 333 'linux_blink_rel': set(['defaulttests']), |
334 }, | 334 }, |
335 } | 335 } |
| 336 |
| 337 def PostUploadHook(cl, change, output_api): |
| 338 """git cl upload will call this hook after the issue is created/modified. |
| 339 |
| 340 This hook adds extra try bots list to the CL description in order to run |
| 341 Blink tests in addition to CQ try bots. |
| 342 """ |
| 343 rietveld_obj = cl.RpcServer() |
| 344 issue = cl.issue |
| 345 description = rietveld_obj.get_description(issue) |
| 346 if re.search(r'^CQ_INCLUDE_TRYBOTS=.*', description, re.M | re.I): |
| 347 return [] |
| 348 |
| 349 bots = GetPreferredTryMasters(None, change) |
| 350 bots_string_bits = [] |
| 351 for master in bots.keys(): |
| 352 bots_string_bits.append("%s:%s" % (master, ','.join(bots[master].keys()))) |
| 353 |
| 354 results = [] |
| 355 new_description = description |
| 356 new_description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join(bots_string_bits) |
| 357 results.append(output_api.PresubmitNotifyResult( |
| 358 'Automatically added Perf trybots to run Blink tests on CQ.')) |
| 359 |
| 360 if new_description != description: |
| 361 rietveld_obj.update_description(issue, new_description) |
| 362 |
| 363 return results |
OLD | NEW |