Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: build/android/adb_install_apk.py

Issue 1430663002: specify the reason for blacklisting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add reason for local device failures Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 """Utility script to install APKs from the command line quickly.""" 7 """Utility script to install APKs from the command line quickly."""
8 8
9 import argparse 9 import argparse
10 import glob 10 import glob
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 def blacklisting_install(device): 98 def blacklisting_install(device):
99 try: 99 try:
100 if args.splits: 100 if args.splits:
101 device.InstallSplitApk(apk, splits, reinstall=args.keep_data) 101 device.InstallSplitApk(apk, splits, reinstall=args.keep_data)
102 else: 102 else:
103 device.Install(apk, reinstall=args.keep_data) 103 device.Install(apk, reinstall=args.keep_data)
104 except device_errors.CommandFailedError: 104 except device_errors.CommandFailedError:
105 logging.exception('Failed to install %s', args.apk_name) 105 logging.exception('Failed to install %s', args.apk_name)
106 if blacklist: 106 if blacklist:
107 blacklist.Extend([str(device)]) 107 blacklist.Extend([str(device)], reason='install_failure')
108 logging.warning('Blacklisting %s', str(device)) 108 logging.warning('Blacklisting %s', str(device))
109 except device_errors.CommandTimeoutError: 109 except device_errors.CommandTimeoutError:
110 logging.exception('Timed out while installing %s', args.apk_name) 110 logging.exception('Timed out while installing %s', args.apk_name)
111 if blacklist: 111 if blacklist:
112 blacklist.Extend([str(device)]) 112 blacklist.Extend([str(device)], reason='install_timeout')
113 logging.warning('Blacklisting %s', str(device)) 113 logging.warning('Blacklisting %s', str(device))
114 114
115 device_utils.DeviceUtils.parallel(devices).pMap(blacklisting_install) 115 device_utils.DeviceUtils.parallel(devices).pMap(blacklisting_install)
116 116
117 117
118 if __name__ == '__main__': 118 if __name__ == '__main__':
119 sys.exit(main()) 119 sys.exit(main())
120 120
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698