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

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: rebase and retrain 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
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/chromium_android/example.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6ae3b34ad2c39808dfa232dcfb400ecbb35f4260..8beb4e3fac72787987acb800df764295c60ac343 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
@@ -328,19 +328,19 @@ 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 revert_device_file_format(self):
# If current device file is jsonified, revert it back to original format.
if self.m.path.exists(self.known_devices_file):
@@ -360,27 +360,47 @@ class AndroidApi(recipe_api.RecipeApi):
self.m.step.active_result.presentation.step_text += (
'file format is compatible')
- def device_status_check(self, restart_usb=False, **kwargs):
- # TODO(bpastene): Remove once chromium revisions prior to
- # crrev.com/1faecde0c03013b6cd725da413339c60223f8948 are no longer tested.
- # See crbug.com/619707 for context.
- self.revert_device_file_format()
+ # TODO(rnephew): Get rid of this when everything calls device_recovery and
+ # device_status directly.
+ def device_status_check(self):
+ self.device_recovery()
+ self.device_status()
+
- # TODO(phajdan.jr): Remove path['build'] usage, http://crbug.com/437264 .
+ def device_recovery(self, restart_usb=False, **kwargs):
+ self.revert_device_file_format()
args = [
- '--adb-path', self.m.adb.adb_path(),
'--blacklist-file', self.blacklist_file,
- '--json-output', self.m.json.output(),
- '--known-devices-file', self.known_devices_file
+ '--known-devices-file', self.known_devices_file,
+ '--adb-path', self.m.adb.adb_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):
+ self.revert_device_file_format()
+ buildbot_file = '/home/chrome-bot/.adb_device_info'
+ args = [
+ '--json-output', self.m.json.output(),
+ '--blacklist-file', self.blacklist_file,
+ '--known-devices-file', self.known_devices_file,
+ '--buildbot-path', buildbot_file,
+ '--adb-path', self.m.adb.adb_path(),
+ '-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": {
@@ -514,12 +534,6 @@ class AndroidApi(recipe_api.RecipeApi):
env=self.m.chromium.get_env(),
infra_step=True,
**kwargs)
- blacklisted_devices = result.json.output
- if blacklisted_devices:
- result.presentation.status = self.m.step.WARNING
- for d in blacklisted_devices:
- key = 'blacklisted %s' % d
- result.presentation.logs[key] = [d]
def apk_path(self, apk):
return self.m.chromium.output_dir.join('apks', apk) if apk else None
@@ -933,7 +947,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,
@@ -944,6 +958,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()
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/chromium_android/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698