| Index: build/android/pylib/instrumentation/dispatch.py
|
| diff --git a/build/android/pylib/instrumentation/dispatch.py b/build/android/pylib/instrumentation/dispatch.py
|
| index 3f1e37ffac03c81b4cc61725ed1d28c62998b151..d5d69f4841324c5882c576737dbf31a8547fde51 100644
|
| --- a/build/android/pylib/instrumentation/dispatch.py
|
| +++ b/build/android/pylib/instrumentation/dispatch.py
|
| @@ -10,6 +10,7 @@ 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
|
| @@ -25,7 +26,7 @@ def Dispatch(options):
|
| options: Command line options.
|
|
|
| Returns:
|
| - A TestRunResults object holding the results of the Java tests.
|
| + The number of failed tests.
|
|
|
| Raises:
|
| Exception: when there are no attached devices.
|
| @@ -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]
|
|
|
| if len(attached_devices) > 1 and options.wait_for_debugger:
|
| logging.warning('Debugger can not be sharded, using first available device')
|
| @@ -54,7 +55,16 @@ def Dispatch(options):
|
| 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)
|
| + results = shard.ShardAndRunTests(TestRunnerFactory, attached_devices, tests,
|
| + options.build_type,
|
| + test_timeout=None,
|
| + num_retries=options.num_retries)
|
| +
|
| + report_results.LogFull(
|
| + results=results,
|
| + test_type='Instrumentation',
|
| + test_package=os.path.basename(options.test_apk),
|
| + annotation=options.annotations,
|
| + build_type=options.build_type,
|
| + flakiness_server=options.flakiness_dashboard_server)
|
| + return len(results.GetNotPass())
|
|
|