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

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

Issue 1907493003: [Android] Log raw output for instrumentation test failures at info level. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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
« no previous file with comments | « build/android/pylib/local/device/local_device_gtest_run.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f2a75299d0e13a3fc240e0e5098913ad3e2ddf04..fd7cfbbad34d80352cac2630712f3eeeac0e139f 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
@@ -247,10 +247,6 @@ class LocalDeviceInstrumentationTestRun(
# TODO(jbudorick): Make instrumentation tests output a JSON so this
mikecase (-- gone --) 2016/04/20 22:50:31 Is the TODO outdated? Don't instrumentation tests
jbudorick 2016/04/20 22:54:37 No, this is to have the APK expose a JSON, not to
# doesn't have to parse the output.
- logging.debug('output from %s:', test_display_name)
- for l in output:
- logging.debug(' %s', l)
-
result_code, result_bundle, statuses = (
self._test_instance.ParseAmInstrumentRawOutput(output))
results = self._test_instance.GenerateTestResults(
@@ -263,8 +259,21 @@ class LocalDeviceInstrumentationTestRun(
for r in results:
if r.GetType() == base_test_result.ResultType.UNKNOWN:
r.SetType(base_test_result.ResultType.CRASH)
- # TODO(jbudorick): ClearApplicationState on failure before switching
- # instrumentation tests to platform mode (but respect --skip-clear-data).
+
+ if any(r.GetType() not in (base_test_result.ResultType.PASS,
+ base_test_result.ResultType.SKIP)
+ for r in results):
+ logging.info('detected failure in %s. raw output:', test_display_name)
+ for l in output:
+ logging.info(' %s', l)
+ if (not self._env.skip_clear_data
+ and self._test_instance.package_info):
+ device.ClearApplicationState(self._test_instance.package_info.package)
+ else:
+ logging.debug('raw output from %s:', test_display_name)
+ for l in output:
+ logging.debug(' %s', l)
+
return results
#override
« no previous file with comments | « build/android/pylib/local/device/local_device_gtest_run.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698