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

Unified Diff: build/android/buildbot/bb_device_status_check.py

Issue 383933003: Add option to output device status to a JSON file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added more fields to JSON output. Created 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/buildbot/bb_device_status_check.py
diff --git a/build/android/buildbot/bb_device_status_check.py b/build/android/buildbot/bb_device_status_check.py
index 1a238de9a054febd12cfde75b76b53d6016eaf5e..4c55b4848192e20247abd5e05869f78bba1cf434 100755
--- a/build/android/buildbot/bb_device_status_check.py
+++ b/build/android/buildbot/bb_device_status_check.py
@@ -5,6 +5,7 @@
# found in the LICENSE file.
"""A class to keep track of devices across builds and report state."""
+import json
import logging
import optparse
import os
@@ -275,6 +276,8 @@ def main():
help='Output device status data for dashboard.')
parser.add_option('--restart-usb', action='store_true',
help='Restart USB ports before running device check.')
+ parser.add_option('--json-output',
+ help='Output JSON information into a specified file.')
options, args = parser.parse_args()
if args:
@@ -359,6 +362,16 @@ def main():
[battery], '%',
'unimportant')
+ if options.json_output:
+ with open(options.json_output, 'wb') as f:
+ f.write(json.dumps({
+ 'online_devices': devices,
+ 'offline_devices': offline_devices,
+ 'expected_devices': expected_devices,
+ 'unique_types': unique_types,
+ 'unique_builds': unique_builds,
+ }))
+
if False in fail_step_lst:
# TODO(navabi): Build fails on device status check step if there exists any
# devices with critically low battery. Remove those devices from testing,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698