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

Side by Side Diff: build/android/buildbot/bb_device_status_check.py

Issue 988693005: Chromium roll (https://codereview.chromium.org/976353002) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fixed bad android build patch Created 5 years, 9 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
« no previous file with comments | « build/android/OWNERS ('k') | build/android/buildbot/bb_device_steps.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """A class to keep track of devices across builds and report state.""" 7 """A class to keep track of devices across builds and report state."""
8 import json 8 import json
9 import logging 9 import logging
10 import optparse 10 import optparse
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 types, builds, batteries, reports, errors, json_data = [], [], [], [], [], [] 333 types, builds, batteries, reports, errors, json_data = [], [], [], [], [], []
334 fail_step_lst = [] 334 fail_step_lst = []
335 if devices: 335 if devices:
336 types, builds, batteries, reports, errors, fail_step_lst, json_data = ( 336 types, builds, batteries, reports, errors, fail_step_lst, json_data = (
337 zip(*[DeviceInfo(dev, options) for dev in devices])) 337 zip(*[DeviceInfo(dev, options) for dev in devices]))
338 338
339 # Write device info to file for buildbot info display. 339 # Write device info to file for buildbot info display.
340 if os.path.exists('/home/chrome-bot'): 340 if os.path.exists('/home/chrome-bot'):
341 with open('/home/chrome-bot/.adb_device_info', 'w') as f: 341 with open('/home/chrome-bot/.adb_device_info', 'w') as f:
342 for device in json_data: 342 for device in json_data:
343 f.write('%s %s %s %.1fC %s%%\n' % (device['serial'], device['type'], 343 try:
344 device['build'], float(device['battery']['temperature']) / 10, 344 f.write('%s %s %s %.1fC %s%%\n' % (device['serial'], device['type'],
345 device['battery']['level'])) 345 device['build'], float(device['battery']['temperature']) / 10,
346 device['battery']['level']))
347 except Exception:
348 pass
346 349
347 err_msg = CheckForMissingDevices(options, devices) or [] 350 err_msg = CheckForMissingDevices(options, devices) or []
348 351
349 unique_types = list(set(types)) 352 unique_types = list(set(types))
350 unique_builds = list(set(builds)) 353 unique_builds = list(set(builds))
351 354
352 bb_annotations.PrintMsg('Online devices: %d. Device types %s, builds %s' 355 bb_annotations.PrintMsg('Online devices: %d. Device types %s, builds %s'
353 % (len(devices), unique_types, unique_builds)) 356 % (len(devices), unique_types, unique_builds))
354 print '\n'.join(reports) 357 print '\n'.join(reports)
355 358
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 395
393 if num_failed_devs == len(devices): 396 if num_failed_devs == len(devices):
394 return 2 397 return 2
395 398
396 if not devices: 399 if not devices:
397 return 1 400 return 1
398 401
399 402
400 if __name__ == '__main__': 403 if __name__ == '__main__':
401 sys.exit(main()) 404 sys.exit(main())
OLDNEW
« no previous file with comments | « build/android/OWNERS ('k') | build/android/buildbot/bb_device_steps.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698