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

Side by Side 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 DEPS = [ 5 DEPS = [
6 'adb',
7 'depot_tools/bot_update', 6 'depot_tools/bot_update',
8 'depot_tools/gclient', 7 'depot_tools/gclient',
9 'recipe_engine/json', 8 'recipe_engine/json',
10 'recipe_engine/path', 9 'recipe_engine/path',
11 'recipe_engine/platform', 10 'recipe_engine/platform',
12 'recipe_engine/properties', 11 'recipe_engine/properties',
13 'recipe_engine/python', 12 'recipe_engine/python',
14 'recipe_engine/step', 13 'recipe_engine/step',
15 'depot_tools/tryserver', 14 'depot_tools/tryserver',
16 'url', 15 'url',
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 args=['gn', build_type] + args + gn_args, 60 args=['gn', build_type] + args + gn_args,
62 cwd=api.path['checkout'], 61 cwd=api.path['checkout'],
63 env=env) 62 env=env)
64 api.python('mojob build', 63 api.python('mojob build',
65 mojob_path, 64 mojob_path,
66 args=['build', build_type] + args, 65 args=['build', build_type] + args,
67 env=env) 66 env=env)
68 67
69 68
70 def _DeviceCheckStep(api): 69 def _DeviceCheckStep(api):
71 known_devices_path = api.m.path.join( 70 devices_path = api.m.path['build'].join('site_config', '.known_devices')
72 api.m.path.expanduser('~'), '.android', 'known_devices.json')
73 # Device recovery.
74 args = [ 71 args = [
75 '--known-devices-file', known_devices_path, 72 '--json-output', api.json.output(),
76 '--adb-path', api.m.adb.adb_path(), 73 '--restart-usb',
77 '-v' 74 '--known-devices-file', devices_path,
78 ] 75 ]
79 api.m.step(
80 'device_recovery',
81 [api.m.path['checkout'].join('third_party', 'catapult', 'devil',
82 'devil', 'android', 'tools',
83 'device_recovery.py')] + args,
84 infra_step=True)
85
86 # Device provisioning.
87 api.python(
88 'provision_device',
89 api.path['checkout'].join('build', 'android', 'provision_devices.py'),
90 infra_step=True)
91
92 # Device Status.
93 try: 76 try:
94 buildbot_file = '/home/chrome-bot/.adb_device_info'
95 args = [
96 '--json-output', api.m.json.output(),
97 '--known-devices-file', known_devices_path,
98 '--buildbot-path', buildbot_file,
99 '-v', '--overwrite-known-devices-files',
100 ]
101 result = api.python( 77 result = api.python(
102 'device_status', 78 'device_status_check',
103 api.path['checkout'].join('third_party', 'catapult', 'devil', 'devil', 79 api.path['checkout'].join('build', 'android', 'buildbot',
104 'android', 'tools', 'device_status.py'), 80 'bb_device_status_check.py'),
105 args=args, 81 args=args,
106 infra_step=True) 82 infra_step=True)
107 return result 83 devices = [d['serial'] for d in result.json.output]
84 result.presentation.step_text = 'Online devices: %s' % len(devices)
108 except api.step.InfraFailure as f: 85 except api.step.InfraFailure as f:
109 params = { 86 params = {
110 'summary': ('Device Offline on %s %s' % 87 'summary': ('Device Offline on %s %s' %
111 (api.properties['mastername'], api.properties['slavename'])), 88 (api.properties['mastername'], api.properties['slavename'])),
112 'comment': ('Buildbot: %s\n(Please do not change any labels)' % 89 'comment': ('Buildbot: %s\n(Please do not change any labels)' %
113 api.properties['buildername']), 90 api.properties['buildername']),
114 'labels': 'Restrict-View-Google,OS-Android,Infra-Client,Infra-Labs', 91 'labels': 'Restrict-View-Google,OS-Android,Infra-Client,Infra-Labs',
115 } 92 }
116 link = ('https://code.google.com/p/chromium/issues/entry?%s' % 93 link = ('https://code.google.com/p/chromium/issues/entry?%s' %
117 api.url.urlencode(params)) 94 api.url.urlencode(params))
118 f.result.presentation.links.update({ 95 f.result.presentation.links.update({
119 'report a bug': link 96 'report a bug': link
120 }) 97 })
121 raise 98 raise
122 99
100 api.python(
101 'provision_device',
102 api.path['checkout'].join('build', 'android', 'provision_devices.py'),
103 infra_step=True)
123 104
124 105
125 def _GetTestConfig(api): 106 def _GetTestConfig(api):
126 buildername = api.properties.get('buildername') 107 buildername = api.properties.get('buildername')
127 108
128 test_config = {} 109 test_config = {}
129 if 'Android' in buildername: 110 if 'Android' in buildername:
130 test_config['target_os'] = 'android' 111 test_config['target_os'] = 'android'
131 elif 'Linux' in buildername: 112 elif 'Linux' in buildername:
132 test_config['target_os'] = 'linux' 113 test_config['target_os'] = 'linux'
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 ['mojo_android_builder', 'Mojo Android Builder'], 215 ['mojo_android_builder', 'Mojo Android Builder'],
235 ['mojo_android_official', 'Mojo Android Official Builder'], 216 ['mojo_android_official', 'Mojo Android Official Builder'],
236 ['mojo_android_dbg', 'Mojo Android (dbg)'], 217 ['mojo_android_dbg', 'Mojo Android (dbg)'],
237 ['mojo_android_builder_tests_dbg', 'Mojo Android Builder Tests (dbg)'], 218 ['mojo_android_builder_tests_dbg', 'Mojo Android Builder Tests (dbg)'],
238 ['mojo_win_dbg', 'Mojo Win (dbg)'], 219 ['mojo_win_dbg', 'Mojo Win (dbg)'],
239 ['mojo_linux_perf', 'Mojo Linux Perf'] 220 ['mojo_linux_perf', 'Mojo Linux Perf']
240 ] 221 ]
241 for test_name, buildername in tests: 222 for test_name, buildername in tests:
242 test = api.test(test_name) + api.properties.generic(buildername=buildername) 223 test = api.test(test_name) + api.properties.generic(buildername=buildername)
243 if 'Android' in buildername and 'Tests' in buildername: 224 if 'Android' in buildername and 'Tests' in buildername:
244 test += api.step_data("device_status", api.json.output([ 225 test += api.step_data("device_status_check", api.json.output([{
245 { 226 "battery": {
246 "battery": { 227 "status": "5",
247 "status": "5", 228 "scale": "100",
248 "scale": "100", 229 "temperature": "249",
249 "temperature": "249", 230 "level": "100",
250 "level": "100", 231 "AC powered": "false",
251 "AC powered": "false", 232 "health": "2",
252 "health": "2", 233 "voltage": "4286",
253 "voltage": "4286", 234 "Wireless powered": "false",
254 "Wireless powered": "false", 235 "USB powered": "true",
255 "USB powered": "true", 236 "technology": "Li-ion",
256 "technology": "Li-ion", 237 "present": "true"
257 "present": "true" 238 },
258 }, 239 "wifi_ip": "",
259 "wifi_ip": "", 240 "imei_slice": "Unknown",
260 "imei_slice": "Unknown", 241 "build": "LRX21O",
261 "build": "LRX21O", 242 "build_detail":
262 "build_detail": 243 "google/razor/flo:5.0/LRX21O/1570415:userdebug/dev-keys",
263 "google/razor/flo:5.0/LRX21O/1570415:userdebug/dev-keys", 244 "serial": "07a00ca4",
264 "serial": "07a00ca4", 245 "type": "flo"
265 "type": "flo", 246 }]))
266 "adb_status": "device",
267 "blacklisted": False,
268 "usb_status": True,
269 },
270 {
271 "adb_status": "offline",
272 "blacklisted": True,
273 "serial": "03e0363a003c6ad4",
274 "usb_status": False,
275 },
276 {
277 "adb_status": "unauthorized",
278 "blacklisted": True,
279 "serial": "03e0363a003c6ad5",
280 "usb_status": True,
281 },
282 {
283 "adb_status": "device",
284 "blacklisted": True,
285 "serial": "03e0363a003c6ad6",
286 "usb_status": True,
287 },
288 {}
289 ]))
290 yield test 247 yield test
291 yield(api.test('mojo_linux_try') + 248 yield(api.test('mojo_linux_try') +
292 api.properties.tryserver(buildername="Mojo Linux Try")) 249 api.properties.tryserver(buildername="Mojo Linux Try"))
293 yield(api.test('mojo_android_builder_tests_dbg_fail_device_check') + 250 yield(api.test('mojo_android_builder_tests_dbg_fail_device_check') +
294 api.properties.tryserver(buildername="Mojo Android Builder Tests (dbg)") + 251 api.properties.tryserver(buildername="Mojo Android Builder Tests (dbg)") +
295 api.step_data("device_status", retcode=1)) 252 api.step_data("device_status_check", retcode=1))
296 253
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698