Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 | 142 |
| 143 missing_devs = list(set(last_devices) - set(adb_online_devs)) | 143 missing_devs = list(set(last_devices) - set(adb_online_devs)) |
| 144 new_missing_devs = list(set(missing_devs) - set(last_missing_devices)) | 144 new_missing_devs = list(set(missing_devs) - set(last_missing_devices)) |
| 145 | 145 |
| 146 if new_missing_devs and os.environ.get('BUILDBOT_SLAVENAME'): | 146 if new_missing_devs and os.environ.get('BUILDBOT_SLAVENAME'): |
| 147 logging.info('new_missing_devs %s' % new_missing_devs) | 147 logging.info('new_missing_devs %s' % new_missing_devs) |
| 148 devices_missing_msg = '%d devices not detected.' % len(missing_devs) | 148 devices_missing_msg = '%d devices not detected.' % len(missing_devs) |
| 149 bb_annotations.PrintSummaryText(devices_missing_msg) | 149 bb_annotations.PrintSummaryText(devices_missing_msg) |
| 150 | 150 |
| 151 from_address = 'chrome-bot@chromium.org' | 151 from_address = 'chrome-bot@chromium.org' |
| 152 to_addresses = ['chrome-labs-tech-ticket@google.com'] | 152 to_addresses = ['chrome-labs-tech-ticket@google.com', |
| 153 'chrome-android-device-alert@google.com'] | |
|
friedman
2014/08/29 22:55:07
I think it needs to be a CC so that GUTS will also
| |
| 153 subject = 'Devices offline on %s, %s, %s' % ( | 154 subject = 'Devices offline on %s, %s, %s' % ( |
| 154 os.environ.get('BUILDBOT_SLAVENAME'), | 155 os.environ.get('BUILDBOT_SLAVENAME'), |
| 155 os.environ.get('BUILDBOT_BUILDERNAME'), | 156 os.environ.get('BUILDBOT_BUILDERNAME'), |
| 156 os.environ.get('BUILDBOT_BUILDNUMBER')) | 157 os.environ.get('BUILDBOT_BUILDNUMBER')) |
| 157 msg = ('Please reboot the following devices:\n%s' % | 158 msg = ('Please reboot the following devices:\n%s' % |
| 158 '\n'.join(map(str,new_missing_devs))) | 159 '\n'.join(map(str,new_missing_devs))) |
| 159 SendEmail(from_address, to_addresses, subject, msg) | 160 SendEmail(from_address, to_addresses, subject, msg) |
| 160 | 161 |
| 161 all_known_devices = list(set(adb_online_devs) | set(last_devices)) | 162 all_known_devices = list(set(adb_online_devs) | set(last_devices)) |
| 162 device_list.WritePersistentDeviceList(last_devices_path, all_known_devices) | 163 device_list.WritePersistentDeviceList(last_devices_path, all_known_devices) |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 379 # devices with critically low battery. Remove those devices from testing, | 380 # devices with critically low battery. Remove those devices from testing, |
| 380 # allowing build to continue with good devices. | 381 # allowing build to continue with good devices. |
| 381 return 2 | 382 return 2 |
| 382 | 383 |
| 383 if not devices: | 384 if not devices: |
| 384 return 1 | 385 return 1 |
| 385 | 386 |
| 386 | 387 |
| 387 if __name__ == '__main__': | 388 if __name__ == '__main__': |
| 388 sys.exit(main()) | 389 sys.exit(main()) |
| OLD | NEW |