Index: build/android/test_runner.py |
diff --git a/build/android/test_runner.py b/build/android/test_runner.py |
index 08ec868e2b55155acc85e226f9088fae6134bda1..ea7eedcb07183874b4f1bfe5ea7d491d5942be2e 100755 |
--- a/build/android/test_runner.py |
+++ b/build/android/test_runner.py |
@@ -13,6 +13,7 @@ import itertools |
import logging |
import os |
import signal |
+import subprocess |
import sys |
import threading |
import traceback |
@@ -115,6 +116,9 @@ def AddCommonOptions(parser): |
help='Path to save test_runner trace data to. This option ' |
'has been implemented for gtest, instrumentation ' |
'test and perf test.') |
+ group.add_argument('--upload-full-logcat', |
+ dest='upload_full_logcat', |
+ help=('The logcat file to upload to logdog.')) |
logcat_output_group = group.add_mutually_exclusive_group() |
logcat_output_group.add_argument( |
@@ -774,6 +778,27 @@ def RunTestsInPlatformMode(args): |
str(all_pass), |
str(tot_tests), |
str(iteration_count)) |
+ if args.upload_full_logcat: |
+ swarming_task_id = os.environ['SWARMING_TASK_ID'] |
dnj
2017/02/18 07:59:25
This is being bootstrapped through Butler, right?
BigBossZhiling
2017/02/21 20:24:17
Done.
|
+ project = 'chromium' |
+ output = 'logdog,host=services-dot-luci-logdog.appspot.com' |
+ prefix = 'android/swarming/logcats/%s' % swarming_task_id |
+ service_account_json = ('/creds/service_accounts/' |
+ 'service-account-luci-logdog-publisher.json') |
+ |
+ if not os.path.exists(args.upload_full_logcat): |
+ logging.error( |
+ 'Logcat sources not found at %s. Unable to upload logcats.', |
+ args.upload_full_logcat) |
+ else: |
+ stream_source_cmdline = [ |
+ '../../bin/logdog_butler', '-project', project, |
+ '-output', output, |
+ '-prefix', prefix, |
+ '-service-account-json', service_account_json, |
+ 'stream', '-source', args.upload_full_logcat, |
+ '-stream', '-name=unified_logcats'] |
+ subprocess.call(stream_source_cmdline) |
if args.command == 'perf' and (args.steps or args.single_step): |
return 0 |