OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 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 | 8 |
9 import optparse | 9 import optparse |
10 import os | 10 import os |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 subject = 'Devices offline on %s, %s (%d remaining).' % (slave_name, | 93 subject = 'Devices offline on %s, %s (%d remaining).' % (slave_name, |
94 bot_name, | 94 bot_name, |
95 num_online_devs) | 95 num_online_devs) |
96 buildbot_report.PrintWarning() | 96 buildbot_report.PrintWarning() |
97 devices_missing_msg = '%d devices not detected.' % len(missing_devs) | 97 devices_missing_msg = '%d devices not detected.' % len(missing_devs) |
98 buildbot_report.PrintSummaryText(devices_missing_msg) | 98 buildbot_report.PrintSummaryText(devices_missing_msg) |
99 | 99 |
100 body = '\n'.join( | 100 body = '\n'.join( |
101 ['Current online devices: %s' % adb_online_devs, | 101 ['Current online devices: %s' % adb_online_devs, |
102 '%s are no longer visible. Were they removed?\n' % missing_devs, | 102 '%s are no longer visible. Were they removed?\n' % missing_devs, |
103 'SHERIFF: See go/clank/engineering/buildbots/troubleshooting', | 103 'SHERIFF: See go/chrome_device_monitor', |
104 'Cache file: %s\n\n' % last_devices_path, | 104 'Cache file: %s\n\n' % last_devices_path, |
105 'adb devices: %s' % GetCmdOutput(['adb', 'devices'])]) | 105 'adb devices: %s' % GetCmdOutput(['adb', 'devices'])]) |
106 | 106 |
107 print body | 107 print body |
108 | 108 |
109 # Only send email if the first time a particular device goes offline | 109 # Only send email if the first time a particular device goes offline |
110 last_missing = ReadDeviceList('.last_missing') | 110 last_missing = ReadDeviceList('.last_missing') |
111 new_missing_devs = set(missing_devs) - set(last_missing) | 111 new_missing_devs = set(missing_devs) - set(last_missing) |
112 | 112 |
113 if new_missing_devs: | 113 if new_missing_devs: |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 unique_types = list(set(types)) | 150 unique_types = list(set(types)) |
151 unique_builds = list(set(builds)) | 151 unique_builds = list(set(builds)) |
152 | 152 |
153 buildbot_report.PrintMsg('Online devices: %d. Device types %s, builds %s' | 153 buildbot_report.PrintMsg('Online devices: %d. Device types %s, builds %s' |
154 % (len(devices), unique_types, unique_builds)) | 154 % (len(devices), unique_types, unique_builds)) |
155 print '\n'.join(reports) | 155 print '\n'.join(reports) |
156 CheckForMissingDevices(options, devices) | 156 CheckForMissingDevices(options, devices) |
157 | 157 |
158 if __name__ == '__main__': | 158 if __name__ == '__main__': |
159 sys.exit(main()) | 159 sys.exit(main()) |
OLD | NEW |