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

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

Issue 18444004: Makes host driven tests use the common sharder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes calls to Dispatch and the RunTests functions Created 7 years, 5 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/host_driven/tests_annotations.py ('k') | build/android/pylib/uiautomator/dispatch.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/instrumentation/dispatch.py
diff --git a/build/android/pylib/instrumentation/dispatch.py b/build/android/pylib/instrumentation/dispatch.py
index e4ca2805243c6edb7f02830ae28bd808256ef6df..55b4b93033968f97480d27388fa58b2549c460e6 100644
--- a/build/android/pylib/instrumentation/dispatch.py
+++ b/build/android/pylib/instrumentation/dispatch.py
@@ -2,13 +2,14 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""Dispatches the instrumentation tests."""
+"""Runs the instrumentation tests."""
import logging
import os
from pylib import android_commands
from pylib import constants
+from pylib import dispatch
from pylib.base import base_test_result
from pylib.base import shard
from pylib.utils import report_results
@@ -17,8 +18,8 @@ import test_package
import test_runner
-def Dispatch(options):
- """Dispatches instrumentation tests onto connected device(s).
+def RunInstrumentationTests(options):
+ """Runs instrumentation tests on connected device(s).
If possible, this method will attempt to shard the tests to
all connected devices. Otherwise, dispatch and run tests on one device.
@@ -40,23 +41,10 @@ def Dispatch(options):
logging.error('No instrumentation tests to run with current args.')
return (base_test_result.TestRunResults(), constants.ERROR_EXIT_CODE)
- attached_devices = android_commands.GetAttachedDevices()
- if not attached_devices:
- raise Exception('There are no devices online.')
-
- if options.test_device:
- assert options.test_device in attached_devices
- attached_devices = [options.test_device]
-
- if len(attached_devices) > 1 and options.wait_for_debugger:
- logging.warning('Debugger can not be sharded, using first available device')
- attached_devices = attached_devices[:1]
def TestRunnerFactory(device, shard_index):
return test_runner.TestRunner(
options, device, shard_index, test_pkg, [])
- return shard.ShardAndRunTests(TestRunnerFactory, attached_devices, tests,
- options.build_type,
- test_timeout=None,
- num_retries=options.num_retries)
+ return dispatch.Dispatch(options, tests, TestRunnerFactory,
+ distribution='shard')
« no previous file with comments | « build/android/pylib/host_driven/tests_annotations.py ('k') | build/android/pylib/uiautomator/dispatch.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698