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

Unified Diff: build/android/pylib/instrumentation/dispatch.py

Issue 12378048: [Android] Switch instrumentation tests to the new shard/runner paradigm. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add retries to the end of the queue instead of the beginning Created 7 years, 10 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/instrumentation/dispatch.py
diff --git a/build/android/pylib/instrumentation/dispatch.py b/build/android/pylib/instrumentation/dispatch.py
index 81b59873c629c63a3d483f7743b18fb0640347a4..43a3ab5a66efc6282505f6124819979e7421a807 100644
--- a/build/android/pylib/instrumentation/dispatch.py
+++ b/build/android/pylib/instrumentation/dispatch.py
@@ -8,10 +8,11 @@ import logging
import os
from pylib import android_commands
+from pylib.base import shard
from pylib.base import test_result
import apk_info
-import test_sharder
+import test_runner
def Dispatch(options, apks):
@@ -71,16 +72,15 @@ def Dispatch(options, apks):
tests = available_tests
if not tests:
- logging.warning('No Java tests to run with current args.')
+ logging.warning('No instrumentation tests to run with current args.')
return test_result.TestResults()
tests *= options.number_of_runs
attached_devices = android_commands.GetAttachedDevices()
- test_results = test_result.TestResults()
if not attached_devices:
- raise Exception('You have no devices attached or visible!')
+ raise Exception('There are no devices online.')
if options.device:
attached_devices = [options.device]
@@ -90,6 +90,9 @@ def Dispatch(options, apks):
logging.warning('Coverage / debugger can not be sharded, '
'using first available device')
attached_devices = attached_devices[:1]
- sharder = test_sharder.TestSharder(attached_devices, options, tests, apks)
- test_results = sharder.RunShardedTests()
- return test_results
+
+ def TestRunnerFactory(device, shard_index):
+ return test_runner.TestRunner(options, device, shard_index, False, apks, [])
+
+ return shard.ShardAndRunTests(TestRunnerFactory, attached_devices, tests,
+ options.build_type)
« no previous file with comments | « build/android/pylib/host_driven/run_python_tests.py ('k') | build/android/pylib/instrumentation/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698