OLD | NEW |
---|---|
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 import contextlib | 5 import contextlib |
6 import datetime | 6 import datetime |
7 import json | 7 import json |
8 import os | 8 import os |
9 import pipes | |
9 import re | 10 import re |
10 import sys | 11 import sys |
11 import urllib | 12 import urllib |
12 | 13 |
13 from recipe_engine.types import freeze | 14 from recipe_engine.types import freeze |
14 from recipe_engine import recipe_api | 15 from recipe_engine import recipe_api |
15 | 16 |
16 def _TimestampToIsoFormat(timestamp): | 17 def _TimestampToIsoFormat(timestamp): |
17 return datetime.datetime.utcfromtimestamp(timestamp).strftime('%Y%m%dT%H%M%S') | 18 return datetime.datetime.utcfromtimestamp(timestamp).strftime('%Y%m%dT%H%M%S') |
18 | 19 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 stdout = self.m.raw_io.output(), | 185 stdout = self.m.raw_io.output(), |
185 step_test_data=( | 186 step_test_data=( |
186 lambda: | 187 lambda: |
187 self.m.raw_io.test_api.stream_output('3000\n') | 188 self.m.raw_io.test_api.stream_output('3000\n') |
188 ), | 189 ), |
189 cwd=self.m.path['checkout'], | 190 cwd=self.m.path['checkout'], |
190 infra_step=True, | 191 infra_step=True, |
191 **kwargs) | 192 **kwargs) |
192 | 193 |
193 def java_method_count(self, dexfile, name='java_method_count'): | 194 def java_method_count(self, dexfile, name='java_method_count'): |
194 self.m.chromium.runtest( | 195 # TODO(agrieve): Remove once usages are elimintated. |
195 self.m.path['checkout'].join('build', 'android', 'method_count.py'), | 196 self.resource_sizes(dexfile) # pragma: no cover |
196 args=[dexfile], | 197 |
197 annotate='graphing', | 198 def resource_sizes(self, apk_path, chartjson_file=False, |
198 results_url='https://chromeperf.appspot.com', | 199 upload_archives_to_bucket=None): |
200 cmd = ['build/android/resource_sizes.py', str(apk_path)] | |
201 if chartjson_file: | |
202 cmd.append('--chartjson') | |
203 | |
204 config = { | |
205 'steps': { | |
206 'resource_sizes': { | |
jbudorick
2016/08/15 15:37:43
I'm concerned that this change is going to break a
agrieve
2016/09/02 18:23:18
It certainly may, but the old data isn't super imp
| |
207 'cmd': ' '.join(pipes.quote(x) for x in cmd), | |
208 'device_affinity': None, | |
209 'archive_output_dir': True | |
210 } | |
211 }, | |
212 'version': 1 | |
213 } | |
214 self.run_sharded_perf_tests( | |
215 config=self.m.json.input(config), | |
216 flaky_config=None, | |
199 perf_id=self.m.properties['buildername'], | 217 perf_id=self.m.properties['buildername'], |
200 perf_dashboard_id=name, | 218 chartjson_file=chartjson_file, |
201 test_type=name) | 219 upload_archives_to_bucket=upload_archives_to_bucket) |
202 | |
203 def resource_sizes(self, apk_path, so_path=None, so_with_symbols_path=None, | |
204 chartjson_file=False): | |
205 args=[apk_path, '--build_type', self.m.chromium.c.BUILD_CONFIG] | |
206 if chartjson_file: | |
207 args.extend(['--chartjson']) | |
208 if so_path: | |
209 args.extend(['--so-path', so_path]) | |
210 if so_with_symbols_path: | |
211 args.extend(['--so-with-symbols-path', so_with_symbols_path]) | |
212 | |
213 self.m.chromium.runtest( | |
214 self.m.path['checkout'].join('build', 'android', 'resource_sizes.py'), | |
215 args=args, | |
216 annotate='graphing', | |
217 results_url='https://chromeperf.appspot.com', | |
218 perf_id=self.m.properties['buildername'], | |
219 perf_dashboard_id='resource_sizes', | |
220 test_type='resource_sizes', | |
221 env={'CHROMIUM_OUTPUT_DIR': self.m.chromium.output_dir}, | |
222 chartjson_file=chartjson_file) | |
223 | 220 |
224 def check_webview_licenses(self, name='check licenses'): | 221 def check_webview_licenses(self, name='check licenses'): |
225 self.m.python( | 222 self.m.python( |
226 name, | 223 name, |
227 self.m.path['checkout'].join('android_webview', | 224 self.m.path['checkout'].join('android_webview', |
228 'tools', | 225 'tools', |
229 'webview_licenses.py'), | 226 'webview_licenses.py'), |
230 args=['scan'], | 227 args=['scan'], |
231 cwd=self.m.path['checkout']) | 228 cwd=self.m.path['checkout']) |
232 | 229 |
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1471 script = self.c.test_runner | 1468 script = self.c.test_runner |
1472 if wrapper_script_suite_name: | 1469 if wrapper_script_suite_name: |
1473 script = self.m.chromium.output_dir.join('bin', 'run_%s' % | 1470 script = self.m.chromium.output_dir.join('bin', 'run_%s' % |
1474 wrapper_script_suite_name) | 1471 wrapper_script_suite_name) |
1475 else: | 1472 else: |
1476 env = kwargs.get('env', {}) | 1473 env = kwargs.get('env', {}) |
1477 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', | 1474 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', |
1478 self.m.chromium.output_dir) | 1475 self.m.chromium.output_dir) |
1479 kwargs['env'] = env | 1476 kwargs['env'] = env |
1480 return self.m.python(step_name, script, args, **kwargs) | 1477 return self.m.python(step_name, script, args, **kwargs) |
OLD | NEW |