Index: build/android/pylib/uiautomator/dispatch.py |
diff --git a/build/android/pylib/uiautomator/dispatch.py b/build/android/pylib/uiautomator/dispatch.py |
index 0f68ce4965246c63302a24ab100311fb5a3cc47b..afe7190b8a0ed81371cca8f4d93003d8154a28a2 100644 |
--- a/build/android/pylib/uiautomator/dispatch.py |
+++ b/build/android/pylib/uiautomator/dispatch.py |
@@ -10,12 +10,13 @@ import os |
from pylib import android_commands |
from pylib.base import base_test_result |
from pylib.base import shard |
+from pylib.utils import report_results |
import test_package |
import test_runner |
-def Dispatch(options): |
+def DispatchCore(options): |
"""Dispatches uiautomator tests onto connected device(s). |
If possible, this method will attempt to shard the tests to |
@@ -42,9 +43,9 @@ def Dispatch(options): |
if not attached_devices: |
raise Exception('There are no devices online.') |
- if options.device: |
- assert options.device in attached_devices |
- attached_devices = [options.device] |
+ 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( |
@@ -52,3 +53,16 @@ def Dispatch(options): |
return shard.ShardAndRunTests(TestRunnerFactory, attached_devices, tests, |
options.build_type) |
+ |
+ |
+def Dispatch(options): |
frankf
2013/06/11 02:50:15
So currently the concept of dispatch is pretty ill
|
+ """Wraps DispatchCore to return number of failures, and log appropriately.""" |
+ results = DispatchCore(options) |
+ report_results.LogFull( |
+ results=results, |
+ test_type='UIAutomator', |
+ test_package=os.path.basename(options.test_jar), |
+ annotation=options.annotations, |
+ build_type=options.build_type, |
+ flakiness_server=options.flakiness_dashboard_server) |
+ return len(results.GetNotPass()) |