OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 content/test/gpu. | 5 """Top-level presubmit script for content/test/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 import re | |
12 | |
13 def _GetPathsToPrepend(input_api): | 11 def _GetPathsToPrepend(input_api): |
14 current_dir = input_api.PresubmitLocalPath() | 12 current_dir = input_api.PresubmitLocalPath() |
15 chromium_src_dir = input_api.os_path.join(current_dir, '..', '..', '..') | 13 chromium_src_dir = input_api.os_path.join(current_dir, '..', '..', '..') |
16 return [ | 14 return [ |
17 input_api.os_path.join(current_dir, 'gpu_tests'), | 15 input_api.os_path.join(current_dir, 'gpu_tests'), |
18 input_api.os_path.join(chromium_src_dir, 'tools', 'perf'), | 16 input_api.os_path.join(chromium_src_dir, 'tools', 'perf'), |
19 input_api.os_path.join(chromium_src_dir, | 17 input_api.os_path.join(chromium_src_dir, |
20 'third_party', 'catapult', 'telemetry'), | 18 'third_party', 'catapult', 'telemetry'), |
21 input_api.os_path.join(chromium_src_dir, | 19 input_api.os_path.join(chromium_src_dir, |
22 'third_party', 'catapult', 'common', 'py_utils'), | 20 'third_party', 'catapult', 'common', 'py_utils'), |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 return results | 54 return results |
57 | 55 |
58 def CheckChangeOnCommit(input_api, output_api): | 56 def CheckChangeOnCommit(input_api, output_api): |
59 results = [] | 57 results = [] |
60 results.extend(_GpuUnittestsArePassingCheck(input_api, output_api)) | 58 results.extend(_GpuUnittestsArePassingCheck(input_api, output_api)) |
61 return results | 59 return results |
62 | 60 |
63 def PostUploadHook(cl, change, output_api): | 61 def PostUploadHook(cl, change, output_api): |
64 """git cl upload will call this hook after the issue is created/modified. | 62 """git cl upload will call this hook after the issue is created/modified. |
65 | 63 |
66 This hook adds extra try bots list to the CL description in order to run | 64 This hook modifies the CL description in order to run extra GPU |
67 Blink tests in addition to CQ try bots. | 65 tests (in particular, the WebGL 2.0 conformance tests) in addition |
| 66 to the regular CQ try bots. This test suite is too large to run |
| 67 against all Chromium commits, but should be run against changes |
| 68 likely to affect these tests. |
68 """ | 69 """ |
69 rietveld_obj = cl.RpcServer() | 70 return output_api.EnsureCQIncludeTrybotsAreAdded( |
70 issue = cl.issue | 71 cl, |
71 description = rietveld_obj.get_description(issue) | 72 [ |
72 if re.search(r'^CQ_INCLUDE_TRYBOTS=.*', description, re.M | re.I): | 73 'master.tryserver.chromium.linux:linux_optional_gpu_tests_rel', |
73 return [] | 74 'master.tryserver.chromium.mac:mac_optional_gpu_tests_rel', |
74 | 75 'master.tryserver.chromium.win:win_optional_gpu_tests_rel', |
75 bots = [ | 76 'master.tryserver.chromium.android:android_optional_gpu_tests_rel', |
76 'master.tryserver.chromium.linux:linux_optional_gpu_tests_rel', | 77 ], |
77 'master.tryserver.chromium.mac:mac_optional_gpu_tests_rel', | 78 'Automatically added optional GPU tests to run on CQ.') |
78 'master.tryserver.chromium.win:win_optional_gpu_tests_rel', | |
79 'master.tryserver.chromium.android:android_optional_gpu_tests_rel', | |
80 ] | |
81 | |
82 results = [] | |
83 new_description = description | |
84 new_description += '\nCQ_INCLUDE_TRYBOTS=%s' % ';'.join(bots) | |
85 results.append(output_api.PresubmitNotifyResult( | |
86 'Automatically added optional GPU tests to run on CQ.')) | |
87 | |
88 if new_description != description: | |
89 rietveld_obj.update_description(issue, new_description) | |
90 | |
91 return results | |
OLD | NEW |