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

Unified Diff: build/android/pylib/local/device/local_device_instrumentation_test_run.py

Issue 2451523002: Insert logcat as part of test result for android instrumentation tests. (Closed)
Patch Set: using logdog 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 side-by-side diff with in-line comments
Download patch
Index: build/android/pylib/local/device/local_device_instrumentation_test_run.py
diff --git a/build/android/pylib/local/device/local_device_instrumentation_test_run.py b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
index 6c00b7087dc9f5c44aeabdc2ca2abe8a17c0174c..a1e6a926782d3b0b4d5ba35a22a336f9226087d1 100644
--- a/build/android/pylib/local/device/local_device_instrumentation_test_run.py
+++ b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
@@ -12,6 +12,7 @@ from devil.android import device_errors
from devil.android import flag_changer
from devil.utils import reraiser_thread
from pylib import valgrind_tools
+from pylib import logcat_monitor_using_logdog
from pylib.base import base_test_result
from pylib.local.device import local_device_environment
from pylib.local.device import local_device_test_run
@@ -261,10 +262,15 @@ class LocalDeviceInstrumentationTestRun(
device.RunShellCommand(
['log', '-p', 'i', '-t', _TAG, 'START %s' % test_name],
check_return=True)
+ logcat = None
time_ms = lambda: int(time.time() * 1e3)
start_ms = time_ms()
- output = device.StartInstrumentation(
- target, raw=True, extras=extras, timeout=timeout, retries=0)
+ with logcat_monitor_using_logdog.LogcatMonitorUsingLogdog(device.adb,
jbudorick 2016/11/18 02:31:42 This should totally be something like "LogcatdogMo
BigBossZhiling 2016/11/22 02:54:37 Done.
+ 'logcat_%s' % test_name.replace('#', '.')) as logmon:
+ output = device.StartInstrumentation(
+ target, raw=True, extras=extras, timeout=timeout, retries=0)
+ logcat = logmon.GetLogcatURL()
+ logmon.Close()
finally:
device.RunShellCommand(
['log', '-p', 'i', '-t', _TAG, 'END %s' % test_name],
@@ -282,6 +288,8 @@ class LocalDeviceInstrumentationTestRun(
self._test_instance.ParseAmInstrumentRawOutput(output))
results = self._test_instance.GenerateTestResults(
result_code, result_bundle, statuses, start_ms, duration_ms)
+ for result in results:
+ result.SetLogcat(logcat)
# Update the result name if the test used flags.
if flags:

Powered by Google App Engine
This is Rietveld 408576698