| OLD | NEW |
| 1 # Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2016 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 gpu. | 5 """Top-level presubmit script for gpu. |
| 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 |
| 11 | 11 |
| 12 import re | 12 import re |
| 13 | 13 |
| 14 | 14 |
| 15 def PostUploadHook(cl, change, output_api): | 15 def PostUploadHook(cl, change, output_api): |
| 16 """git cl upload will call this hook after the issue is created/modified. | 16 """git cl upload will call this hook after the issue is created/modified. |
| 17 | 17 |
| 18 This hook adds extra try bots list to the CL description in order to run | 18 This hook adds extra try bots list to the CL description in order to run |
| 19 extra GPU tests in addition to CQ try bots. | 19 extra GPU tests in addition to CQ try bots. |
| 20 """ | 20 """ |
| 21 rietveld_obj = cl.RpcServer() | 21 rietveld_obj = cl.RpcServer() |
| 22 issue = cl.issue | 22 issue = cl.issue |
| 23 description = rietveld_obj.get_description(issue) | 23 description = rietveld_obj.get_description(issue) |
| 24 if re.search(r'^CQ_INCLUDE_TRYBOTS=.*', description, re.M | re.I): | 24 if re.search(r'^CQ_INCLUDE_TRYBOTS=.*', description, re.M | re.I): |
| 25 return [] | 25 return [] |
| 26 | 26 |
| 27 bots = [ | 27 bots = [ |
| 28 'tryserver.chromium.win:win_optional_gpu_tests_rel', | 28 'tryserver.chromium.win:win_optional_gpu_tests_rel', |
| 29 'tryserver.chromium.mac:mac_optional_gpu_tests_rel', | |
| 30 ] | 29 ] |
| 31 | 30 |
| 32 results = [] | 31 results = [] |
| 33 new_description = description | 32 new_description = description |
| 34 new_description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join(bots) | 33 new_description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join(bots) |
| 35 results.append(output_api.PresubmitNotifyResult( | 34 results.append(output_api.PresubmitNotifyResult( |
| 36 'Automatically added optional GPU tests to run on CQ.')) | 35 'Automatically added optional GPU tests to run on CQ.')) |
| 37 | 36 |
| 38 if new_description != description: | 37 if new_description != description: |
| 39 rietveld_obj.update_description(issue, new_description) | 38 rietveld_obj.update_description(issue, new_description) |
| 40 | 39 |
| 41 return results | 40 return results |
| OLD | NEW |