OLD | NEW |
1 # Copyright 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 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 """Presubmit script for changes affecting tools/perf/. | 5 """Presubmit script for changes affecting tools/perf/. |
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 26 matching lines...) Expand all Loading... |
37 input_api.os_path.join(telemetry_dir, 'third_party', 'mock'), | 37 input_api.os_path.join(telemetry_dir, 'third_party', 'mock'), |
38 experimental_dir, | 38 experimental_dir, |
39 ] | 39 ] |
40 | 40 |
41 | 41 |
42 def _CheckWprShaFiles(input_api, output_api): | 42 def _CheckWprShaFiles(input_api, output_api): |
43 """Check whether the wpr sha files have matching URLs.""" | 43 """Check whether the wpr sha files have matching URLs.""" |
44 old_sys_path = sys.path | 44 old_sys_path = sys.path |
45 try: | 45 try: |
46 perf_dir = input_api.PresubmitLocalPath() | 46 perf_dir = input_api.PresubmitLocalPath() |
47 catapult_path = os.path.abspath(os.path.join( | 47 py_utils_path = os.path.abspath(os.path.join( |
48 perf_dir, '..', '..', 'third_party', 'catapult', 'catapult_base')) | 48 perf_dir, '..', '..', 'third_party', 'catapult', 'common', 'py_utils')) |
49 sys.path.insert(1, catapult_path) | 49 sys.path.insert(1, py_utils_path) |
50 from catapult_base import cloud_storage # pylint: disable=import-error | 50 from py_utils import cloud_storage # pylint: disable=import-error |
51 finally: | 51 finally: |
52 sys.path = old_sys_path | 52 sys.path = old_sys_path |
53 | 53 |
54 results = [] | 54 results = [] |
55 for affected_file in input_api.AffectedFiles(include_deletes=False): | 55 for affected_file in input_api.AffectedFiles(include_deletes=False): |
56 filename = affected_file.AbsoluteLocalPath() | 56 filename = affected_file.AbsoluteLocalPath() |
57 if not filename.endswith('wpr.sha1'): | 57 if not filename.endswith('wpr.sha1'): |
58 continue | 58 continue |
59 expected_hash = cloud_storage.ReadHash(filename) | 59 expected_hash = cloud_storage.ReadHash(filename) |
60 is_wpr_file_uploaded = any( | 60 is_wpr_file_uploaded = any( |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 bots_string = ';'.join(bots) | 137 bots_string = ';'.join(bots) |
138 description = original_description | 138 description = original_description |
139 description += '\nCQ_INCLUDE_TRYBOTS=%s' % bots_string | 139 description += '\nCQ_INCLUDE_TRYBOTS=%s' % bots_string |
140 results.append(output_api.PresubmitNotifyResult( | 140 results.append(output_api.PresubmitNotifyResult( |
141 'Automatically added Perf trybots to run Telemetry benchmarks on CQ.')) | 141 'Automatically added Perf trybots to run Telemetry benchmarks on CQ.')) |
142 | 142 |
143 if description != original_description: | 143 if description != original_description: |
144 rietveld_obj.update_description(issue, description) | 144 rietveld_obj.update_description(issue, description) |
145 | 145 |
146 return results | 146 return results |
OLD | NEW |