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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
370 if options.json_output: | 370 if options.json_output: |
371 with open(options.json_output, 'wb') as f: | 371 with open(options.json_output, 'wb') as f: |
372 f.write(json.dumps({ | 372 f.write(json.dumps({ |
373 'online_devices': devices, | 373 'online_devices': devices, |
374 'offline_devices': offline_devices, | 374 'offline_devices': offline_devices, |
375 'expected_devices': expected_devices, | 375 'expected_devices': expected_devices, |
376 'unique_types': unique_types, | 376 'unique_types': unique_types, |
377 'unique_builds': unique_builds, | 377 'unique_builds': unique_builds, |
378 })) | 378 })) |
379 | 379 |
380 if False in fail_step_lst: | 380 index = 0 |
381 # TODO(navabi): Build fails on device status check step if there exists any | 381 num_failed_devs = 0 |
382 # devices with critically low battery. Remove those devices from testing, | 382 for fail_status in fail_step_lst: |
383 # allowing build to continue with good devices. | 383 if not fail_status: |
384 device_blacklist.ExtendBlacklist([str(devices[index])]) | |
jbudorick
2014/10/23 01:19:32
We may want to do something like what provision_de
navabi
2014/10/23 01:27:27
I'm actually not sure I like what provision_device
jbudorick
2014/10/23 14:05:27
I don't like it, but I can understand why the perf
| |
385 num_failed_devs = num_failed_devs + 1 | |
jbudorick
2014/10/23 01:19:31
nit: num_failed_devs += 1
navabi
2014/10/23 01:27:27
Done.
| |
386 index = index + 1 | |
jbudorick
2014/10/23 01:19:32
nit: index += 1
navabi
2014/10/23 01:27:27
Done.
| |
387 | |
388 if num_failed_devs == len(devices): | |
384 return 2 | 389 return 2 |
385 | 390 |
386 if not devices: | 391 if not devices: |
387 return 1 | 392 return 1 |
388 | 393 |
389 | 394 |
390 if __name__ == '__main__': | 395 if __name__ == '__main__': |
391 sys.exit(main()) | 396 sys.exit(main()) |
OLD | NEW |