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 | |
10 import re | 9 import re |
11 import sys | 10 import sys |
12 import urllib | 11 import urllib |
13 | 12 |
14 from recipe_engine.types import freeze | 13 from recipe_engine.types import freeze |
15 from recipe_engine import recipe_api | 14 from recipe_engine import recipe_api |
16 | 15 |
17 def _TimestampToIsoFormat(timestamp): | 16 def _TimestampToIsoFormat(timestamp): |
18 return datetime.datetime.utcfromtimestamp(timestamp).strftime('%Y%m%dT%H%M%S') | 17 return datetime.datetime.utcfromtimestamp(timestamp).strftime('%Y%m%dT%H%M%S') |
19 | 18 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 stdout = self.m.raw_io.output(), | 185 stdout = self.m.raw_io.output(), |
187 step_test_data=( | 186 step_test_data=( |
188 lambda: | 187 lambda: |
189 self.m.raw_io.test_api.stream_output('3000\n') | 188 self.m.raw_io.test_api.stream_output('3000\n') |
190 ), | 189 ), |
191 cwd=self.m.path['checkout'], | 190 cwd=self.m.path['checkout'], |
192 infra_step=True, | 191 infra_step=True, |
193 **kwargs) | 192 **kwargs) |
194 | 193 |
195 def java_method_count(self, dexfile, name='java_method_count', perf_id=None): | 194 def java_method_count(self, dexfile, name='java_method_count', perf_id=None): |
196 # TODO(agrieve): Remove once usages are elimintated. | 195 self.m.chromium.runtest( |
197 self.resource_sizes(dexfile, perf_id=perf_id) # pragma: no cover | 196 self.m.path['checkout'].join('build', 'android', 'method_count.py'), |
| 197 args=[dexfile], |
| 198 annotate='graphing', |
| 199 results_url='https://chromeperf.appspot.com', |
| 200 perf_id=perf_id or self.m.properties['buildername'], |
| 201 perf_dashboard_id=name, |
| 202 test_type=name) |
198 | 203 |
199 def resource_sizes(self, apk_path, chartjson_file=False, | 204 def resource_sizes(self, apk_path, so_path=None, so_with_symbols_path=None, |
200 upload_archives_to_bucket=None, perf_id=None): | 205 chartjson_file=False): |
201 cmd = ['build/android/resource_sizes.py', str(apk_path)] | 206 args=[apk_path, '--build_type', self.m.chromium.c.BUILD_CONFIG] |
202 if chartjson_file: | 207 if chartjson_file: |
203 cmd.append('--chartjson') | 208 args.extend(['--chartjson']) |
| 209 if so_path: |
| 210 args.extend(['--so-path', so_path]) |
| 211 if so_with_symbols_path: |
| 212 args.extend(['--so-with-symbols-path', so_with_symbols_path]) |
204 | 213 |
205 config = { | 214 self.m.chromium.runtest( |
206 'steps': { | 215 self.m.path['checkout'].join('build', 'android', 'resource_sizes.py'), |
207 'resource_sizes': { | 216 args=args, |
208 'cmd': ' '.join(pipes.quote(x) for x in cmd), | 217 annotate='graphing', |
209 'device_affinity': None, | 218 results_url='https://chromeperf.appspot.com', |
210 'archive_output_dir': True | 219 perf_id=self.m.properties['buildername'], |
211 } | 220 perf_dashboard_id='resource_sizes', |
212 }, | 221 test_type='resource_sizes', |
213 'version': 1 | 222 env={'CHROMIUM_OUTPUT_DIR': self.m.chromium.output_dir}, |
214 } | 223 chartjson_file=chartjson_file) |
215 self.run_sharded_perf_tests( | |
216 config=self.m.json.input(config), | |
217 flaky_config=None, | |
218 perf_id=perf_id or self.m.properties['buildername'], | |
219 chartjson_file=chartjson_file, | |
220 upload_archives_to_bucket=upload_archives_to_bucket) | |
221 | 224 |
222 def check_webview_licenses(self, name='check licenses'): | 225 def check_webview_licenses(self, name='check licenses'): |
223 self.m.python( | 226 self.m.python( |
224 name, | 227 name, |
225 self.m.path['checkout'].join('android_webview', | 228 self.m.path['checkout'].join('android_webview', |
226 'tools', | 229 'tools', |
227 'webview_licenses.py'), | 230 'webview_licenses.py'), |
228 args=['scan'], | 231 args=['scan'], |
229 cwd=self.m.path['checkout']) | 232 cwd=self.m.path['checkout']) |
230 | 233 |
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1492 script = self.c.test_runner | 1495 script = self.c.test_runner |
1493 if wrapper_script_suite_name: | 1496 if wrapper_script_suite_name: |
1494 script = self.m.chromium.output_dir.join('bin', 'run_%s' % | 1497 script = self.m.chromium.output_dir.join('bin', 'run_%s' % |
1495 wrapper_script_suite_name) | 1498 wrapper_script_suite_name) |
1496 else: | 1499 else: |
1497 env = kwargs.get('env', {}) | 1500 env = kwargs.get('env', {}) |
1498 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', | 1501 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', |
1499 self.m.chromium.output_dir) | 1502 self.m.chromium.output_dir) |
1500 kwargs['env'] = env | 1503 kwargs['env'] = env |
1501 return self.m.python(step_name, script, args, **kwargs) | 1504 return self.m.python(step_name, script, args, **kwargs) |
OLD | NEW |