| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 Blink. | 5 """Top-level presubmit script for Blink. |
| 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 gcl. | 8 for more details about the presubmit API built into gcl. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 def PostUploadHook(cl, change, output_api): # pylint: disable=C0103 | 355 def PostUploadHook(cl, change, output_api): # pylint: disable=C0103 |
| 356 """git cl upload will call this hook after the issue is created/modified. | 356 """git cl upload will call this hook after the issue is created/modified. |
| 357 | 357 |
| 358 This hook adds extra try bots to the CL description in order to run slimming | 358 This hook adds extra try bots to the CL description in order to run slimming |
| 359 paint v2 tests in addition to the CQ try bots if the change contains paint | 359 paint v2 tests in addition to the CQ try bots if the change contains paint |
| 360 or compositing changes (see: _ArePaintOrCompositingDirectoriesModified). For | 360 or compositing changes (see: _ArePaintOrCompositingDirectoriesModified). For |
| 361 more information about slimming-paint-v2 tests see https://crbug.com/601275. | 361 more information about slimming-paint-v2 tests see https://crbug.com/601275. |
| 362 """ | 362 """ |
| 363 if not _ArePaintOrCompositingDirectoriesModified(change): | 363 if not _ArePaintOrCompositingDirectoriesModified(change): |
| 364 return [] | 364 return [] |
| 365 | 365 return output_api.EnsureCQIncludeTrybotsAreAdded( |
| 366 rietveld_obj = cl.RpcServer() | 366 cl, |
| 367 issue = cl.issue | 367 ['master.tryserver.chromium.linux:' |
| 368 description = rietveld_obj.get_description(issue) | 368 'linux_layout_tests_slimming_paint_v2'], |
| 369 if re.search(r'^CQ_INCLUDE_TRYBOTS=.*', description, re.M | re.I): | |
| 370 return [] | |
| 371 | |
| 372 bots = [ | |
| 373 'master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2', | |
| 374 ] | |
| 375 | |
| 376 results = [] | |
| 377 new_description = description | |
| 378 new_description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join(bots) | |
| 379 results.append(output_api.PresubmitNotifyResult( | |
| 380 'Automatically added slimming-paint-v2 tests to run on CQ due to ' | 369 'Automatically added slimming-paint-v2 tests to run on CQ due to ' |
| 381 'changes in paint or compositing directories.')) | 370 'changes in paint or compositing directories.') |
| 382 | |
| 383 if new_description != description: | |
| 384 rietveld_obj.update_description(issue, new_description) | |
| 385 | |
| 386 return results | |
| OLD | NEW |