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 25 matching lines...) Expand all Loading... |
36 | 36 |
37 | 37 |
38 def _CheckWprShaFiles(input_api, output_api): | 38 def _CheckWprShaFiles(input_api, output_api): |
39 """Check whether the wpr sha files have matching URLs.""" | 39 """Check whether the wpr sha files have matching URLs.""" |
40 old_sys_path = sys.path | 40 old_sys_path = sys.path |
41 try: | 41 try: |
42 perf_dir = input_api.PresubmitLocalPath() | 42 perf_dir = input_api.PresubmitLocalPath() |
43 catapult_path = os.path.abspath(os.path.join( | 43 catapult_path = os.path.abspath(os.path.join( |
44 perf_dir, '..', '..', 'third_party', 'catapult', 'catapult_base')) | 44 perf_dir, '..', '..', 'third_party', 'catapult', 'catapult_base')) |
45 sys.path.insert(1, catapult_path) | 45 sys.path.insert(1, catapult_path) |
46 from catapult_base import cloud_storage | 46 from catapult_base import cloud_storage # pylint: disable=import-error |
47 finally: | 47 finally: |
48 sys.path = old_sys_path | 48 sys.path = old_sys_path |
49 | 49 |
50 results = [] | 50 results = [] |
51 for affected_file in input_api.AffectedFiles(include_deletes=False): | 51 for affected_file in input_api.AffectedFiles(include_deletes=False): |
52 filename = affected_file.AbsoluteLocalPath() | 52 filename = affected_file.AbsoluteLocalPath() |
53 if not filename.endswith('wpr.sha1'): | 53 if not filename.endswith('wpr.sha1'): |
54 continue | 54 continue |
55 expected_hash = cloud_storage.ReadHash(filename) | 55 expected_hash = cloud_storage.ReadHash(filename) |
56 is_wpr_file_uploaded = any( | 56 is_wpr_file_uploaded = any( |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 bots_string = ';'.join(bots) | 132 bots_string = ';'.join(bots) |
133 description = original_description | 133 description = original_description |
134 description += '\nCQ_EXTRA_TRYBOTS=%s' % bots_string | 134 description += '\nCQ_EXTRA_TRYBOTS=%s' % bots_string |
135 results.append(output_api.PresubmitNotifyResult( | 135 results.append(output_api.PresubmitNotifyResult( |
136 'Automatically added Perf trybots to run Telemetry benchmarks on CQ.')) | 136 'Automatically added Perf trybots to run Telemetry benchmarks on CQ.')) |
137 | 137 |
138 if description != original_description: | 138 if description != original_description: |
139 rietveld_obj.update_description(issue, description) | 139 rietveld_obj.update_description(issue, description) |
140 | 140 |
141 return results | 141 return results |
OLD | NEW |