diff options
author | ilevy@chromium.org <ilevy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-04 22:18:32 +0000 |
---|---|---|
committer | ilevy@chromium.org <ilevy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-04 22:18:32 +0000 |
commit | 725fea61f900866227b14f74d97b17d4ea787769 (patch) | |
tree | bb251879137f926f16e91c58b30b20a48012c753 /build | |
parent | 4982ee1e81b6dc26a6f675b2104d9e083b2fe9fb (diff) | |
download | chromium_src-725fea61f900866227b14f74d97b17d4ea787769.zip chromium_src-725fea61f900866227b14f74d97b17d4ea787769.tar.gz chromium_src-725fea61f900866227b14f74d97b17d4ea787769.tar.bz2 |
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: svn://svn.chromium.org/chrome/trunk/src@154824 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rwxr-xr-x | build/android/device_status_check.py | 20 | ||||
-rw-r--r-- | build/android/pylib/buildbot_report.py | 9 |
2 files changed, 20 insertions, 9 deletions
diff --git a/build/android/device_status_check.py b/build/android/device_status_check.py index 267c1d9..673fbe8 100755 --- a/build/android/device_status_check.py +++ b/build/android/device_status_check.py @@ -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) diff --git a/build/android/pylib/buildbot_report.py b/build/android/pylib/buildbot_report.py index 1e549de..fe3fcd6 100644 --- a/build/android/pylib/buildbot_report.py +++ b/build/android/pylib/buildbot_report.py @@ -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@@@' |