Minor fixes to android device_status script
- Build titles were too long, making shorter - Switching to STEP_TEXT as STEP_SUMMARY_TEXT is only visible while this is the active step. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10665012 git-svn-id: http://src.chromium.org/svn/trunk/src/build@154824 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
Родитель
a2a8762ff4
Коммит
680786820b
|
@ -10,6 +10,7 @@ import optparse
|
|||
import os
|
||||
import sys
|
||||
|
||||
from pylib import buildbot_report
|
||||
from pylib.android_commands import GetAttachedDevices
|
||||
from pylib.cmd_helper import GetCmdOutput
|
||||
|
||||
|
@ -70,8 +71,9 @@ def CheckForMissingDevices(options, adb_online_devs):
|
|||
|
||||
missing_devs = list(set(last_devices) - set(adb_online_devs))
|
||||
if missing_devs:
|
||||
print '@@@STEP_WARNINGS@@@'
|
||||
print '@@@STEP_SUMMARY_TEXT@%s not detected.@@@' % missing_devs
|
||||
buildbot_report.PrintWarning()
|
||||
buildbot_report.PrintSummaryText(
|
||||
'%d devices not detected.' % len(missing_devs))
|
||||
print 'Current online devices: %s' % adb_online_devs
|
||||
print '%s are no longer visible. Were they removed?\n' % missing_devs
|
||||
print 'SHERIFF: See go/chrome_device_monitor'
|
||||
|
@ -80,9 +82,10 @@ def CheckForMissingDevices(options, adb_online_devs):
|
|||
print GetCmdOutput(['adb', 'devices'])
|
||||
else:
|
||||
new_devs = set(adb_online_devs) - set(last_devices)
|
||||
if new_devs:
|
||||
print '@@@STEP_WARNINGS@@@'
|
||||
print '@@@STEP_SUMMARY_TEXT@New devices detected :-)@@@'
|
||||
if new_devs and os.path.exists(last_devices_path):
|
||||
buildbot_report.PrintWarning()
|
||||
buildbot_report.PrintSummaryText(
|
||||
'%d new devices detected' % len(new_devs))
|
||||
print ('New devices detected %s. And now back to your '
|
||||
'regularly scheduled program.' % list(new_devs))
|
||||
|
||||
|
@ -101,8 +104,8 @@ def main():
|
|||
options, args = parser.parse_args()
|
||||
if args:
|
||||
parser.error('Unknown options %s' % args)
|
||||
buildbot_report.PrintNamedStep('Device Status Check')
|
||||
devices = GetAttachedDevices()
|
||||
|
||||
types, builds, reports = [], [], []
|
||||
if devices:
|
||||
types, builds, reports = zip(*[DeviceInfo(dev) for dev in devices])
|
||||
|
@ -110,9 +113,8 @@ def main():
|
|||
unique_types = list(set(types))
|
||||
unique_builds = list(set(builds))
|
||||
|
||||
print ('@@@BUILD_STEP Device Status Check - '
|
||||
'%d online devices, types %s, builds %s@@@'
|
||||
% (len(devices), unique_types, unique_builds))
|
||||
buildbot_report.PrintMsg('Online devices: %d. Device types %s, builds %s'
|
||||
% (len(devices), unique_types, unique_builds))
|
||||
print '\n'.join(reports)
|
||||
CheckForMissingDevices(options, devices)
|
||||
|
||||
|
|
|
@ -23,6 +23,15 @@ def PrintMsg(msg):
|
|||
print '@@@STEP_TEXT@%s@@@' % msg
|
||||
|
||||
|
||||
def PrintSummaryText(msg):
|
||||
"""Appends |msg| to main build summary. Visible from waterfall.
|
||||
|
||||
Args:
|
||||
msg: String to be appended.
|
||||
"""
|
||||
print '@@@STEP_SUMMARY_TEXT@%s@@@' % msg
|
||||
|
||||
|
||||
def PrintError():
|
||||
"""Marks the current step as failed."""
|
||||
print '@@@STEP_FAILURE@@@'
|
||||
|
|
Загрузка…
Ссылка в новой задаче