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

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

Issue 2143013002: Revert "[Android] Reland splitting of device recovery and device status." (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 5 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 8545f9ac6ff5e6693841cd422dbe14d17d95a82d..59edcf1509b26110e5e98abfd22cbfe7233bd881 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()'
+ 'devices is only available after device_status_check()'
return self._devices
@property
@@ -329,14 +329,13 @@ class AndroidApi(recipe_api.RecipeApi):
reboot_timeout=None, max_battery_temp=None,
remove_system_webview=False):
self.authorize_adb_devices()
- self.device_recovery()
+ self.device_status_check(restart_usb=restart_usb)
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):
@@ -367,41 +366,22 @@ class AndroidApi(recipe_api.RecipeApi):
# crrev.com/1faecde0c03013b6cd725da413339c60223f8948 are no longer tested.
# See crbug.com/619707 for context.
self.revert_device_file_format()
- self.device_recovery()
- self.device_status()
- def device_recovery(self, restart_usb=False, **kwargs):
+ # TODO(phajdan.jr): Remove path['build'] usage, http://crbug.com/437264 .
args = [
- '--blacklist-file', self.blacklist_file,
- '--known-devices-file', self.known_devices_file,
'--adb-path', self.m.adb.adb_path(),
- '-v'
- ]
- 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):
- 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',
+ '--json-output', self.m.json.output(),
+ '--known-devices-file', self.known_devices_file
]
+ if restart_usb:
+ args += ['--restart-usb']
+
try:
result = self.m.step(
- 'device_status',
- [self.m.path['checkout'].join('third_party', 'catapult', 'devil',
- 'devil', 'android', 'tools',
- 'device_status.py')] + args,
+ 'device_status_check',
+ [self.m.path['checkout'].join('build', 'android', 'buildbot',
+ 'bb_device_status_check.py')] + args,
step_test_data=lambda: self.m.json.test_api.output([
{
"battery": {
@@ -485,7 +465,6 @@ class AndroidApi(recipe_api.RecipeApi):
})
raise
-
def provision_devices(self, skip_wipe=False, disable_location=False,
min_battery_level=None, disable_network=False,
disable_java_debug=False, max_battery_temp=None,
@@ -536,6 +515,12 @@ 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
@@ -949,7 +934,7 @@ class AndroidApi(recipe_api.RecipeApi):
else:
self.spawn_logcat_monitor()
self.authorize_adb_devices()
- self.device_recovery()
+ self.device_status_check()
if perf_setup:
kwargs = {
'min_battery_level': 95,
@@ -960,7 +945,6 @@ 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