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

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

Issue 1964183003: Fixed coverage dir for instrumentation tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
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 fd7cfbbad34d80352cac2630712f3eeeac0e139f..733859080d623ed3199a05de67878bea0249be7f 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
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import logging
+import os
import re
import time
@@ -186,6 +187,17 @@ class LocalDeviceInstrumentationTestRun(
flags = None
test_timeout_scale = None
+
+ if self._test_instance.CoverageDirectory():
+ coverage_basename = '%s.ec' % test['method']
mikecase (-- gone --) 2016/05/11 17:39:58 This will crash if test is a list, which I think i
BigBossZhiling 2016/05/20 18:38:08 Done.
+ extras['coverage'] = 'true'
+ coverage_device_file = '%s/%s/%s' % (
+ device.GetExternalStoragePath(), 'chrome/test/coverage',
+ coverage_basename)
mikecase (-- gone --) 2016/05/11 17:39:58 This indentation is a bit off. Probably do somethi
jbudorick 2016/05/17 00:07:33 This should instead be: coverage_device_file =
BigBossZhiling 2016/05/20 18:38:09 Done.
+ coverage_host_file = os.path.join(
+ self._test_instance.CoverageDirectory(), coverage_basename)
+ extras['coverageFile'] = coverage_device_file
+
if isinstance(test, list):
jbudorick 2016/05/17 00:07:33 yes, test can be a list.
BigBossZhiling 2016/05/20 18:38:08 Done.
if not self._test_instance.driver_apk:
raise Exception('driver_apk does not exist. '
@@ -274,6 +286,9 @@ class LocalDeviceInstrumentationTestRun(
for l in output:
logging.debug(' %s', l)
+ if self._test_instance.CoverageDirectory():
+ device.PullFile(coverage_device_file, coverage_host_file)
+ device.RunShellCommand('rm -f %s' % coverage_device_file)
mikecase (-- gone --) 2016/05/11 17:39:58 Might* be faster to pull all of the files at the e
BigBossZhiling 2016/05/20 18:38:08 I was thinking of collecting ec files after callin
return results
#override

Powered by Google App Engine
This is Rietveld 408576698