| 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 pipes |
| 10 import re | 10 import re |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 'spawn_logcat_monitor', | 315 'spawn_logcat_monitor', |
| 316 [self.package_repo_resource('scripts', 'slave', 'daemonizer.py'), | 316 [self.package_repo_resource('scripts', 'slave', 'daemonizer.py'), |
| 317 '--', self.c.cr_build_android.join('adb_logcat_monitor.py'), | 317 '--', self.c.cr_build_android.join('adb_logcat_monitor.py'), |
| 318 self.m.chromium.c.build_dir.join('logcat'), | 318 self.m.chromium.c.build_dir.join('logcat'), |
| 319 self.m.adb.adb_path()], | 319 self.m.adb.adb_path()], |
| 320 env=self.m.chromium.get_env(), | 320 env=self.m.chromium.get_env(), |
| 321 infra_step=True) | 321 infra_step=True) |
| 322 | 322 |
| 323 def spawn_device_monitor(self): | 323 def spawn_device_monitor(self): |
| 324 script = self.package_repo_resource('scripts', 'slave', 'daemonizer.py') | 324 script = self.package_repo_resource('scripts', 'slave', 'daemonizer.py') |
| 325 # TODO(bpastene) Enable everywhere. | 325 args = [ |
| 326 if self.m.properties.get('buildername') == 'Android Tests (trial)(dbg)': | 326 '--action', 'restart', |
| 327 args = [ | 327 '--pid-file-path', '/tmp/device_monitor.pid', '--', |
| 328 '--action', 'restart', | 328 self.m.path['checkout'].join('third_party', 'catapult', 'devil', |
| 329 '--pid-file-path', '/tmp/device_monitor.pid', '--', | 329 'devil', 'android', 'tools', |
| 330 self.m.path['checkout'].join('third_party', 'catapult', 'devil', | 330 'device_monitor.py'), |
| 331 'devil', 'android', 'tools', | 331 '--adb-path', self.m.adb.adb_path(), |
| 332 'device_monitor.py'), | 332 '--blacklist-file', self.blacklist_file |
| 333 '--adb-path', self.m.adb.adb_path(), | 333 ] |
| 334 '--blacklist-file', self.blacklist_file | |
| 335 ] | |
| 336 else: | |
| 337 args = [ | |
| 338 '--action', 'restart', | |
| 339 '--pid-file-path', '/tmp/device_monitor.pid', | |
| 340 '--', self.resource('spawn_device_monitor.py'), | |
| 341 self.m.adb.adb_path(), | |
| 342 json.dumps(self._devices), | |
| 343 '--blacklist-file', self.blacklist_file | |
| 344 ] | |
| 345 self.m.python('spawn_device_monitor', script, args, infra_step=True) | 334 self.m.python('spawn_device_monitor', script, args, infra_step=True) |
| 346 | 335 |
| 347 def shutdown_device_monitor(self): | 336 def shutdown_device_monitor(self): |
| 348 script = self.package_repo_resource('scripts', 'slave', 'daemonizer.py') | 337 script = self.package_repo_resource('scripts', 'slave', 'daemonizer.py') |
| 349 args = [ | 338 args = [ |
| 350 '--action', 'stop', | 339 '--action', 'stop', |
| 351 '--pid-file-path', '/tmp/device_monitor.pid', | 340 '--pid-file-path', '/tmp/device_monitor.pid', |
| 352 ] | 341 ] |
| 353 self.m.python('shutdown_device_monitor', script, args, infra_step=True) | 342 self.m.python('shutdown_device_monitor', script, args, infra_step=True) |
| 354 | 343 |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 args=[self.m.path['checkout'].join('out', | 1078 args=[self.m.path['checkout'].join('out', |
| 1090 self.m.chromium.c.BUILD_CONFIG, | 1079 self.m.chromium.c.BUILD_CONFIG, |
| 1091 'test_logs', | 1080 'test_logs', |
| 1092 '*.log')], | 1081 '*.log')], |
| 1093 ) | 1082 ) |
| 1094 | 1083 |
| 1095 def common_tests_setup_steps(self, perf_setup=False, | 1084 def common_tests_setup_steps(self, perf_setup=False, |
| 1096 remove_system_webview=False, skip_wipe=False): | 1085 remove_system_webview=False, skip_wipe=False): |
| 1097 self.create_adb_symlink() | 1086 self.create_adb_symlink() |
| 1098 self.spawn_logcat_monitor() | 1087 self.spawn_logcat_monitor() |
| 1088 self.spawn_device_monitor() |
| 1099 self.authorize_adb_devices() | 1089 self.authorize_adb_devices() |
| 1100 # TODO(jbudorick): Restart USB only on perf bots while we | 1090 # TODO(jbudorick): Restart USB only on perf bots while we |
| 1101 # figure out the fate of the usb reset in general. | 1091 # figure out the fate of the usb reset in general. |
| 1102 self.device_recovery(restart_usb=perf_setup) | 1092 self.device_recovery(restart_usb=perf_setup) |
| 1103 if perf_setup: | 1093 if perf_setup: |
| 1104 kwargs = { | 1094 kwargs = { |
| 1105 'min_battery_level': 95, | 1095 'min_battery_level': 95, |
| 1106 'disable_network': True, | 1096 'disable_network': True, |
| 1107 'disable_java_debug': True, | 1097 'disable_java_debug': True, |
| 1108 'max_battery_temp': 350} | 1098 'max_battery_temp': 350} |
| 1109 else: | 1099 else: |
| 1110 kwargs = {} | 1100 kwargs = {} |
| 1111 if skip_wipe: | 1101 if skip_wipe: |
| 1112 kwargs['skip_wipe'] = True | 1102 kwargs['skip_wipe'] = True |
| 1113 self.provision_devices(remove_system_webview=remove_system_webview, | 1103 self.provision_devices(remove_system_webview=remove_system_webview, |
| 1114 **kwargs) | 1104 **kwargs) |
| 1115 self.device_status() | 1105 self.device_status() |
| 1116 if self.m.chromium.c.gyp_env.GYP_DEFINES.get('asan', 0) == 1: | 1106 if self.m.chromium.c.gyp_env.GYP_DEFINES.get('asan', 0) == 1: |
| 1117 self.asan_device_setup() | 1107 self.asan_device_setup() |
| 1118 | 1108 |
| 1119 self.spawn_device_monitor() | |
| 1120 | |
| 1121 def common_tests_final_steps(self, logcat_gs_bucket='chromium-android'): | 1109 def common_tests_final_steps(self, logcat_gs_bucket='chromium-android'): |
| 1122 self.shutdown_device_monitor() | 1110 self.shutdown_device_monitor() |
| 1123 self.logcat_dump(gs_bucket=logcat_gs_bucket) | 1111 self.logcat_dump(gs_bucket=logcat_gs_bucket) |
| 1124 self.stack_tool_steps() | 1112 self.stack_tool_steps() |
| 1125 if self.m.chromium.c.gyp_env.GYP_DEFINES.get('asan', 0) == 1: | 1113 if self.m.chromium.c.gyp_env.GYP_DEFINES.get('asan', 0) == 1: |
| 1126 self.asan_device_teardown() | 1114 self.asan_device_teardown() |
| 1127 self.test_report() | 1115 self.test_report() |
| 1128 | 1116 |
| 1129 def run_bisect_script(self, extra_src='', path_to_config='', **kwargs): | 1117 def run_bisect_script(self, extra_src='', path_to_config='', **kwargs): |
| 1130 self.m.step('prepare bisect perf regression', | 1118 self.m.step('prepare bisect perf regression', |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1569 script = self.c.test_runner | 1557 script = self.c.test_runner |
| 1570 if wrapper_script_suite_name: | 1558 if wrapper_script_suite_name: |
| 1571 script = self.m.chromium.output_dir.join('bin', 'run_%s' % | 1559 script = self.m.chromium.output_dir.join('bin', 'run_%s' % |
| 1572 wrapper_script_suite_name) | 1560 wrapper_script_suite_name) |
| 1573 else: | 1561 else: |
| 1574 env = kwargs.get('env', {}) | 1562 env = kwargs.get('env', {}) |
| 1575 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', | 1563 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', |
| 1576 self.m.chromium.output_dir) | 1564 self.m.chromium.output_dir) |
| 1577 kwargs['env'] = env | 1565 kwargs['env'] = env |
| 1578 return self.m.python(step_name, script, args, **kwargs) | 1566 return self.m.python(step_name, script, args, **kwargs) |
| OLD | NEW |