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

Unified Diff: scripts/slave/recipe_modules/chromium_android/api.py

Issue 2059993002: [Android] Move to new device status and recovery scripts. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: scripts/slave/recipe_modules/chromium_android/api.py
diff --git a/scripts/slave/recipe_modules/chromium_android/api.py b/scripts/slave/recipe_modules/chromium_android/api.py
index 8d989dea1cd45651e19324acf1eb62ebe7c839f0..c2e5d134ae385e9c6a467dc88e33b12733b9f986 100644
--- a/scripts/slave/recipe_modules/chromium_android/api.py
+++ b/scripts/slave/recipe_modules/chromium_android/api.py
@@ -32,7 +32,7 @@ class AndroidApi(recipe_api.RecipeApi):
@property
def devices(self):
assert self._devices is not None,\
- 'devices is only available after device_status_check()'
+ 'devices is only available after device_status()'
return self._devices
@property
@@ -324,35 +324,59 @@ class AndroidApi(recipe_api.RecipeApi):
reboot_timeout=None, max_battery_temp=None,
remove_system_webview=False):
self.authorize_adb_devices()
- self.device_status_check(restart_usb=restart_usb)
+ self.device_recovery()
self.provision_devices(
skip_wipe=skip_wipe, disable_location=disable_location,
min_battery_level=min_battery_level, disable_network=disable_network,
disable_java_debug=disable_java_debug, reboot_timeout=reboot_timeout,
max_battery_temp=max_battery_temp,
remove_system_webview=remove_system_webview)
+ self.device_status()
@property
def blacklist_file(self):
return self.out_path.join('bad_devices.json')
- def device_status_check(self, restart_usb=False, **kwargs):
- # TODO(phajdan.jr): Remove path['build'] usage, http://crbug.com/437264 .
jbudorick 2016/06/15 14:05:38 I think this TODO should be maintained for now.
- devices_path = self.m.path['build'].join('site_config', '.known_devices')
+ # TODO(rnephew): Get rid of this when everything calls device_recovery and
+ # device_status directly.
+ def device_status_check(self):
jbudorick 2016/06/15 14:05:38 What's still calling this? Downstream?
rnephew (Reviews Here) 2016/06/15 14:32:45 Im more putting it in there as a just in case I mi
jbudorick 2016/06/15 14:48:50 I don't know of a good way to do this short of add
+ self.device_recovery()
+ self.device_status()
+
+ def device_recovery(self, restart_usb=False, **kwargs):
+ known_devices_path = self.m.path['build'].join('site_config',
jbudorick 2016/06/15 14:05:38 This should probably be in its own private functio
rnephew (Reviews Here) 2016/06/15 16:05:13 Done.
+ '.known_devices')
args = [
- '--adb-path', self.m.adb.adb_path(),
'--blacklist-file', self.blacklist_file,
- '--json-output', self.m.json.output(),
- '--known-devices-file', devices_path,
+ '--known-devices-file', known_devices_path,
+ '-v'
]
- if restart_usb:
- args += ['--restart-usb']
+ self.m.step(
+ 'device_recovery',
+ [self.m.path['checkout'].join('third_party', 'catapult', 'devil',
+ 'devil', 'android', 'tools',
+ 'device_recovery.py')] + args,
+ env=self.m.chromium.get_env(),
+ infra_step=True,
+ **kwargs)
+ def device_status(self, **kwargs):
+ known_devices_path = self.m.path['build'].join('site_config',
+ '.known_devices')
+ buildbot_file = '/home/chrome-bot/.adb_device_info'
+ args = [
+ '--json-output', self.m.json.output(),
+ '--blacklist-file', self.blacklist_file,
+ '--known-devices-file', known_devices_path,
+ '--buildbot-path', buildbot_file,
+ '-v', '--overwrite-known-devices-files',
+ ]
try:
result = self.m.step(
- 'device_status_check',
- [self.m.path['checkout'].join('build', 'android', 'buildbot',
- 'bb_device_status_check.py')] + args,
+ 'device_status',
+ [self.m.path['checkout'].join('third_party', 'catapult', 'devil',
+ 'devil', 'android', 'tools',
+ 'device_status.py')] + args,
step_test_data=lambda: self.m.json.test_api.output([
{
"battery": {
@@ -875,7 +899,7 @@ class AndroidApi(recipe_api.RecipeApi):
else:
self.spawn_logcat_monitor()
self.authorize_adb_devices()
- self.device_status_check()
+ self.device_recovery()
if perf_setup:
kwargs = {
'min_battery_level': 95,
@@ -886,6 +910,7 @@ class AndroidApi(recipe_api.RecipeApi):
kwargs = {}
self.provision_devices(remove_system_webview=remove_system_webview,
**kwargs)
+ self.device_status()
if self.m.chromium.c.gyp_env.GYP_DEFINES.get('asan', 0) == 1:
self.asan_device_setup()

Powered by Google App Engine
This is Rietveld 408576698