OLD | NEW |
(Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 |
| 5 """Top-level presubmit script for gpu. |
| 6 |
| 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 8 for more details about the presubmit API built into depot_tools. |
| 9 """ |
| 10 |
| 11 |
| 12 import re |
| 13 |
| 14 |
| 15 def PostUploadHook(cl, change, output_api): |
| 16 """git cl upload will call this hook after the issue is created/modified. |
| 17 |
| 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. |
| 20 """ |
| 21 rietveld_obj = cl.RpcServer() |
| 22 issue = cl.issue |
| 23 description = rietveld_obj.get_description(issue) |
| 24 if re.search(r'^CQ_INCLUDE_TRYBOTS=.*', description, re.M | re.I): |
| 25 return [] |
| 26 |
| 27 bots = [ |
| 28 'tryserver.chromium.win:win_optional_gpu_tests_rel', |
| 29 'tryserver.chromium.mac:mac_optional_gpu_tests_rel', |
| 30 ] |
| 31 |
| 32 results = [] |
| 33 new_description = description |
| 34 new_description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join(bots) |
| 35 results.append(output_api.PresubmitNotifyResult( |
| 36 'Automatically added optional GPU tests to run on CQ.')) |
| 37 |
| 38 if new_description != description: |
| 39 rietveld_obj.update_description(issue, new_description) |
| 40 |
| 41 return results |
OLD | NEW |