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

Side by Side Diff: build/android/test_wrapper/logdog_wrapper.py

Issue 2507633002: Check for existence of logdog binary and logcat source before uploading. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 The Chromium Authors. All rights reserved. 2 # Copyright 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Wrapper for adding logdog streaming support to swarming tasks.""" 6 """Wrapper for adding logdog streaming support to swarming tasks."""
7 7
8 import argparse 8 import argparse
9 import logging 9 import logging
10 import os 10 import os
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 args.prefix = args.prefix.replace('${SWARMING_TASK_ID}', 65 args.prefix = args.prefix.replace('${SWARMING_TASK_ID}',
66 os.environ.get('SWARMING_TASK_ID')) 66 os.environ.get('SWARMING_TASK_ID'))
67 url = CreateUrl('luci-logdog.appspot.com', args.project, args.prefix, 67 url = CreateUrl('luci-logdog.appspot.com', args.project, args.prefix,
68 args.name) 68 args.name)
69 logdog_cmd = [args.logdog_bin_cmd, '-project', args.project, 69 logdog_cmd = [args.logdog_bin_cmd, '-project', args.project,
70 '-output', 'logdog,host=%s' % args.logdog_server, 70 '-output', 'logdog,host=%s' % args.logdog_server,
71 '-prefix', args.prefix, 71 '-prefix', args.prefix,
72 '-service-account-json', args.service_account_json, 72 '-service-account-json', args.service_account_json,
73 'stream', '-source', args.source, 73 'stream', '-source', args.source,
74 '-stream', '-name=%s' % args.name] 74 '-stream', '-name=%s' % args.name]
75 if os.path.exists(args.logdog_bin_cmd): 75
76 if not os.path.exists(args.logdog_bin_cmd):
77 logging.error(
78 'Logfog binary %s unavailable. Unable to upload logcats.',
79 args.logdog_bin_cmd)
80 elif not os.path.exists(args.source):
81 logging.error(
82 'Logcat sources not found at %s. Unable to upload logcats.',
83 args.source)
84 else:
76 subprocess.call(logdog_cmd) 85 subprocess.call(logdog_cmd)
77 logging.info('Logcats are located at: %s', url) 86 logging.info('Logcats are located at: %s', url)
78 return result 87 return result
79 88
80 89
81 if __name__ == '__main__': 90 if __name__ == '__main__':
82 sys.exit(main()) 91 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698