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

Unified Diff: scripts/slave/recipes/mojo.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
Index: scripts/slave/recipes/mojo.py
diff --git a/scripts/slave/recipes/mojo.py b/scripts/slave/recipes/mojo.py
index 03cb4eea359ccee7386084bd35bad26b8f7442d6..203ef78edd463485ab360226ea23071e54e0cb45 100644
--- a/scripts/slave/recipes/mojo.py
+++ b/scripts/slave/recipes/mojo.py
@@ -3,7 +3,6 @@
# found in the LICENSE file.
DEPS = [
- 'adb',
'depot_tools/bot_update',
'depot_tools/gclient',
'recipe_engine/json',
@@ -68,43 +67,21 @@ def _BuildSteps(api, buildername, is_debug, is_official):
def _DeviceCheckStep(api):
- known_devices_path = api.m.path.join(
- api.m.path.expanduser('~'), '.android', 'known_devices.json')
- # Device recovery.
+ devices_path = api.m.path['build'].join('site_config', '.known_devices')
args = [
- '--known-devices-file', known_devices_path,
- '--adb-path', api.m.adb.adb_path(),
- '-v'
+ '--json-output', api.json.output(),
+ '--restart-usb',
+ '--known-devices-file', devices_path,
]
- api.m.step(
- 'device_recovery',
- [api.m.path['checkout'].join('third_party', 'catapult', 'devil',
- 'devil', 'android', 'tools',
- 'device_recovery.py')] + args,
- infra_step=True)
-
- # Device provisioning.
- api.python(
- 'provision_device',
- api.path['checkout'].join('build', 'android', 'provision_devices.py'),
- infra_step=True)
-
- # Device Status.
try:
- buildbot_file = '/home/chrome-bot/.adb_device_info'
- args = [
- '--json-output', api.m.json.output(),
- '--known-devices-file', known_devices_path,
- '--buildbot-path', buildbot_file,
- '-v', '--overwrite-known-devices-files',
- ]
result = api.python(
- 'device_status',
- api.path['checkout'].join('third_party', 'catapult', 'devil', 'devil',
- 'android', 'tools', 'device_status.py'),
+ 'device_status_check',
+ api.path['checkout'].join('build', 'android', 'buildbot',
+ 'bb_device_status_check.py'),
args=args,
infra_step=True)
- return result
+ devices = [d['serial'] for d in result.json.output]
+ result.presentation.step_text = 'Online devices: %s' % len(devices)
except api.step.InfraFailure as f:
params = {
'summary': ('Device Offline on %s %s' %
@@ -120,6 +97,10 @@ def _DeviceCheckStep(api):
})
raise
+ api.python(
+ 'provision_device',
+ api.path['checkout'].join('build', 'android', 'provision_devices.py'),
+ infra_step=True)
def _GetTestConfig(api):
@@ -241,56 +222,32 @@ def GenTests(api):
for test_name, buildername in tests:
test = api.test(test_name) + api.properties.generic(buildername=buildername)
if 'Android' in buildername and 'Tests' in buildername:
- test += api.step_data("device_status", api.json.output([
- {
- "battery": {
- "status": "5",
- "scale": "100",
- "temperature": "249",
- "level": "100",
- "AC powered": "false",
- "health": "2",
- "voltage": "4286",
- "Wireless powered": "false",
- "USB powered": "true",
- "technology": "Li-ion",
- "present": "true"
- },
- "wifi_ip": "",
- "imei_slice": "Unknown",
- "build": "LRX21O",
- "build_detail":
- "google/razor/flo:5.0/LRX21O/1570415:userdebug/dev-keys",
- "serial": "07a00ca4",
- "type": "flo",
- "adb_status": "device",
- "blacklisted": False,
- "usb_status": True,
- },
- {
- "adb_status": "offline",
- "blacklisted": True,
- "serial": "03e0363a003c6ad4",
- "usb_status": False,
- },
- {
- "adb_status": "unauthorized",
- "blacklisted": True,
- "serial": "03e0363a003c6ad5",
- "usb_status": True,
- },
- {
- "adb_status": "device",
- "blacklisted": True,
- "serial": "03e0363a003c6ad6",
- "usb_status": True,
- },
- {}
- ]))
+ test += api.step_data("device_status_check", api.json.output([{
+ "battery": {
+ "status": "5",
+ "scale": "100",
+ "temperature": "249",
+ "level": "100",
+ "AC powered": "false",
+ "health": "2",
+ "voltage": "4286",
+ "Wireless powered": "false",
+ "USB powered": "true",
+ "technology": "Li-ion",
+ "present": "true"
+ },
+ "wifi_ip": "",
+ "imei_slice": "Unknown",
+ "build": "LRX21O",
+ "build_detail":
+ "google/razor/flo:5.0/LRX21O/1570415:userdebug/dev-keys",
+ "serial": "07a00ca4",
+ "type": "flo"
+ }]))
yield test
yield(api.test('mojo_linux_try') +
api.properties.tryserver(buildername="Mojo Linux Try"))
yield(api.test('mojo_android_builder_tests_dbg_fail_device_check') +
api.properties.tryserver(buildername="Mojo Android Builder Tests (dbg)") +
- api.step_data("device_status", retcode=1))
+ api.step_data("device_status_check", retcode=1))

Powered by Google App Engine
This is Rietveld 408576698