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 original_description = rietveld_obj.get_description(issue) | |
Noel Gordon
2015/05/21 06:20:23
original_description -> description ...
mithro-old
2015/05/21 06:25:11
Done.
| |
346 if re.search( | |
347 r'^CQ_INCLUDE_TRYBOTS=.*', original_description, re.M | re.I): | |
Noel Gordon
2015/05/21 06:20:23
then close up this line (it should fit on one line
mithro-old
2015/05/21 06:25:11
Done.
| |
348 return [] | |
349 | |
350 bots = GetPreferredTryMasters(None, change) | |
351 bots_string_bits = [] | |
352 for master in bots.keys(): | |
353 bots_string_bits.append("%s:%s" % (master, ','.join(bots[master].keys()))) | |
354 | |
355 results = [] | |
356 description = original_description | |
Noel Gordon
2015/05/21 06:20:23
Write this as:
new_description = description
mithro-old
2015/05/21 06:25:11
Done.
| |
357 description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join(bots_string_bits) | |
358 results.append(output_api.PresubmitNotifyResult( | |
359 'Automatically added Perf trybots to run Blink tests on CQ.')) | |
360 | |
361 if description != original_description: | |
362 rietveld_obj.update_description(issue, description) | |
363 | |
364 return results | |
OLD | NEW |