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

Unified Diff: build/android/pylib/uiautomator/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: 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
Index: build/android/pylib/uiautomator/dispatch.py
diff --git a/build/android/pylib/uiautomator/dispatch.py b/build/android/pylib/uiautomator/dispatch.py
index fafb2ac7ccf8360292effe1d1200f9d8a58a2645..05e8c35378f8bd1adfac7f56523a84dc843fa636 100644
--- a/build/android/pylib/uiautomator/dispatch.py
+++ b/build/android/pylib/uiautomator/dispatch.py
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""Dispatches the uiautomator tests."""
+"""Runs the uiautomator tests."""
import logging
import os
@@ -17,8 +17,8 @@ import test_package
import test_runner
-def Dispatch(options):
- """Dispatches uiautomator tests onto connected device(s).
+def RunUIAutomatorTests(options):
+ """Runs uiautomator 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,18 +40,9 @@ def Dispatch(options):
logging.error('No uiautomator 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]
-
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,
- num_retries=options.num_retries)
+ return dispatch.Dispatch(options, tests, TestRunnerFactory,
+ dispatch='distribute')

Powered by Google App Engine
This is Rietveld 408576698