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

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

Issue 794923003: [Android] Implement instrumentation tests in platform mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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_test_run.py
diff --git a/build/android/pylib/local/device/local_device_test_run.py b/build/android/pylib/local/device/local_device_test_run.py
index e79b3880a51e5322aa6eac559b8ba567b5a17bbf..c6d29f48ca35f5356c7270b9ed2400e8dfd8c3ff 100644
--- a/build/android/pylib/local/device/local_device_test_run.py
+++ b/build/android/pylib/local/device/local_device_test_run.py
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import logging
from pylib import valgrind_tools
from pylib.base import base_test_result
@@ -35,8 +36,12 @@ class LocalDeviceTestRun(test_run.TestRun):
tries = 0
results = base_test_result.TestRunResults()
- fail_results = []
+ all_fail_results = {}
while tries < self._env.max_tries and tests:
+ logging.debug('try %d, will run %d tests:', tries, len(tests))
+ for t in tests:
+ logging.debug(' %s', t)
+
if self._ShouldShard():
tc = test_collection.TestCollection(self._CreateShards(tests))
try_results = self._env.parallel_devices.pMap(
@@ -44,26 +49,31 @@ class LocalDeviceTestRun(test_run.TestRun):
else:
try_results = self._env.parallel_devices.pMap(
run_tests_on_device, tests).pGet(None)
- fail_results = []
for try_result in try_results:
for result in try_result.GetAll():
if result.GetType() in (base_test_result.ResultType.PASS,
base_test_result.ResultType.SKIP):
results.AddResult(result)
else:
- fail_results.append(result)
+ all_fail_results[result.GetName()] = result
results_names = set(r.GetName() for r in results.GetAll())
tests = [t for t in tests if t not in results_names]
tries += 1
- if tests:
+ all_unknown_test_names = set(tests)
+ all_failed_test_names = set(all_fail_results.iterkeys())
+
+ unknown_tests = all_unknown_test_names.difference(all_failed_test_names)
+ failed_tests = all_failed_test_names.intersection(all_unknown_test_names)
+
+ if unknown_tests:
results.AddResults(
base_test_result.BaseTestResult(
t, base_test_result.ResultType.UNKNOWN)
for t in tests)
- if fail_results:
- results.AddResults(fail_results)
+ if failed_tests:
+ results.AddResults(all_fail_results[f] for f in failed_tests)
return results
def GetTool(self, device):
« no previous file with comments | « build/android/pylib/local/device/local_device_instrumentation_test_run.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698