Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: tools/perf/PRESUBMIT.py

Issue 1568103002: Update tools/perf to use cloud_storage from catapult. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Erik comment Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/perf/core/path_util.py » ('j') | tools/perf/core/path_util.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 21 matching lines...) Expand all
32 return [ 32 return [
33 telemetry_dir, 33 telemetry_dir,
34 input_api.os_path.join(telemetry_dir, 'third_party', 'mock'), 34 input_api.os_path.join(telemetry_dir, 'third_party', 'mock'),
35 ] 35 ]
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 # TODO: The cloud_storage module is in telemetry. 42 perf_dir = input_api.PresubmitLocalPath()
43 sys.path = [os.path.join('..', 'telemetry')] + sys.path 43 catapult_path = os.path.abspath(os.path.join(
44 perf_dir, '..', '..', 'third_party', 'catapult', 'catapult_base'))
45 sys.path.insert(1, catapult_path)
44 from catapult_base import cloud_storage 46 from catapult_base import cloud_storage
45 finally: 47 finally:
46 sys.path = old_sys_path 48 sys.path = old_sys_path
47 49
48 results = [] 50 results = []
49 for affected_file in input_api.AffectedFiles(include_deletes=False): 51 for affected_file in input_api.AffectedFiles(include_deletes=False):
50 filename = affected_file.AbsoluteLocalPath() 52 filename = affected_file.AbsoluteLocalPath()
51 if not filename.endswith('wpr.sha1'): 53 if not filename.endswith('wpr.sha1'):
52 continue 54 continue
53 expected_hash = cloud_storage.ReadHash(filename) 55 expected_hash = cloud_storage.ReadHash(filename)
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 bots_string = ';'.join(bots) 132 bots_string = ';'.join(bots)
131 description = original_description 133 description = original_description
132 description += '\nCQ_EXTRA_TRYBOTS=%s' % bots_string 134 description += '\nCQ_EXTRA_TRYBOTS=%s' % bots_string
133 results.append(output_api.PresubmitNotifyResult( 135 results.append(output_api.PresubmitNotifyResult(
134 'Automatically added Perf trybots to run Telemetry benchmarks on CQ.')) 136 'Automatically added Perf trybots to run Telemetry benchmarks on CQ.'))
135 137
136 if description != original_description: 138 if description != original_description:
137 rietveld_obj.update_description(issue, description) 139 rietveld_obj.update_description(issue, description)
138 140
139 return results 141 return results
OLDNEW
« no previous file with comments | « no previous file | tools/perf/core/path_util.py » ('j') | tools/perf/core/path_util.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698