Commit 8574eab9 authored by mikecase's avatar mikecase Committed by Commit bot

Remove the unused push_deps option from the test runners.

BUG=

Review URL: https://codereview.chromium.org/696923002

Cr-Commit-Position: refs/heads/master@{#302494}
parent b54cf398
...@@ -24,13 +24,11 @@ NET_TEST_SERVER_PORT_INFO_FILE = 'net-test-server-ports' ...@@ -24,13 +24,11 @@ NET_TEST_SERVER_PORT_INFO_FILE = 'net-test-server-ports'
class BaseTestRunner(object): class BaseTestRunner(object):
"""Base class for running tests on a single device.""" """Base class for running tests on a single device."""
def __init__(self, device_serial, tool, push_deps=True, def __init__(self, device_serial, tool, cleanup_test_files=False):
cleanup_test_files=False):
""" """
Args: Args:
device: Tests will run on the device of this ID. device: Tests will run on the device of this ID.
tool: Name of the Valgrind tool. tool: Name of the Valgrind tool.
push_deps: If True, push all dependencies to the device.
cleanup_test_files: Whether or not to cleanup test files on device. cleanup_test_files: Whether or not to cleanup test files on device.
""" """
self.device_serial = device_serial self.device_serial = device_serial
...@@ -46,7 +44,6 @@ class BaseTestRunner(object): ...@@ -46,7 +44,6 @@ class BaseTestRunner(object):
# starting it in TestServerThread. # starting it in TestServerThread.
self.test_server_spawner_port = 0 self.test_server_spawner_port = 0
self.test_server_port = 0 self.test_server_port = 0
self._push_deps = push_deps
self._cleanup_test_files = cleanup_test_files self._cleanup_test_files = cleanup_test_files
def _PushTestServerPortInfoToDevice(self): def _PushTestServerPortInfoToDevice(self):
...@@ -79,19 +76,7 @@ class BaseTestRunner(object): ...@@ -79,19 +76,7 @@ class BaseTestRunner(object):
def SetUp(self): def SetUp(self):
"""Run once before all tests are run.""" """Run once before all tests are run."""
self.InstallTestPackage() self.InstallTestPackage()
push_size_before = self.device.old_interface.GetPushSizeInfo() self.PushDataDeps()
if self._push_deps:
logging.warning('Pushing data files to device.')
self.PushDataDeps()
push_size_after = self.device.old_interface.GetPushSizeInfo()
logging.warning(
'Total data: %0.3fMB' %
((push_size_after[0] - push_size_before[0]) / float(2 ** 20)))
logging.warning(
'Total data transferred: %0.3fMB' %
((push_size_after[1] - push_size_before[1]) / float(2 ** 20)))
else:
logging.warning('Skipping pushing data to device.')
def TearDown(self): def TearDown(self):
"""Run once after all tests are run.""" """Run once after all tests are run."""
......
...@@ -9,7 +9,6 @@ import collections ...@@ -9,7 +9,6 @@ import collections
GTestOptions = collections.namedtuple('GTestOptions', [ GTestOptions = collections.namedtuple('GTestOptions', [
'tool', 'tool',
'cleanup_test_files', 'cleanup_test_files',
'push_deps',
'gtest_filter', 'gtest_filter',
'run_disabled', 'run_disabled',
'test_arguments', 'test_arguments',
......
...@@ -36,7 +36,6 @@ class TestRunner(base_test_runner.BaseTestRunner): ...@@ -36,7 +36,6 @@ class TestRunner(base_test_runner.BaseTestRunner):
""" """
super(TestRunner, self).__init__(device, test_options.tool, super(TestRunner, self).__init__(device, test_options.tool,
test_options.push_deps,
test_options.cleanup_test_files) test_options.cleanup_test_files)
self.test_package = test_package self.test_package = test_package
......
...@@ -196,7 +196,6 @@ def InstrumentationSetup(host_driven_test_root, official_build, ...@@ -196,7 +196,6 @@ def InstrumentationSetup(host_driven_test_root, official_build,
return test_runner.HostDrivenTestRunner( return test_runner.HostDrivenTestRunner(
device, shard_index, device, shard_index,
instrumentation_options.tool, instrumentation_options.tool,
instrumentation_options.push_deps,
instrumentation_options.cleanup_test_files) instrumentation_options.cleanup_test_files)
return (TestRunnerFactory, available_tests) return (TestRunnerFactory, available_tests)
...@@ -57,7 +57,6 @@ class HostDrivenTestCase(object): ...@@ -57,7 +57,6 @@ class HostDrivenTestCase(object):
self.has_forwarded_ports = False self.has_forwarded_ports = False
self.instrumentation_options = instrumentation_options self.instrumentation_options = instrumentation_options
self.ports_to_forward = [] self.ports_to_forward = []
self.push_deps = False
self.shard_index = 0 self.shard_index = 0
# Use tagged_name when creating results, so that we can identify host-driven # Use tagged_name when creating results, so that we can identify host-driven
...@@ -68,7 +67,7 @@ class HostDrivenTestCase(object): ...@@ -68,7 +67,7 @@ class HostDrivenTestCase(object):
# TODO(bulach): make ports_to_forward not optional and move the Forwarder # TODO(bulach): make ports_to_forward not optional and move the Forwarder
# mapping here. # mapping here.
def SetUp(self, device, shard_index, push_deps, def SetUp(self, device, shard_index,
cleanup_test_files, ports_to_forward=None): cleanup_test_files, ports_to_forward=None):
if not ports_to_forward: if not ports_to_forward:
ports_to_forward = [] ports_to_forward = []
...@@ -76,7 +75,6 @@ class HostDrivenTestCase(object): ...@@ -76,7 +75,6 @@ class HostDrivenTestCase(object):
self.shard_index = shard_index self.shard_index = shard_index
self.device = device_utils.DeviceUtils(self.device_id) self.device = device_utils.DeviceUtils(self.device_id)
self.adb = self.device.old_interface self.adb = self.device.old_interface
self.push_deps = push_deps
self.cleanup_test_files = cleanup_test_files self.cleanup_test_files = cleanup_test_files
if ports_to_forward: if ports_to_forward:
self.ports_to_forward = ports_to_forward self.ports_to_forward = ports_to_forward
......
...@@ -48,20 +48,17 @@ class HostDrivenTestRunner(base_test_runner.BaseTestRunner): ...@@ -48,20 +48,17 @@ class HostDrivenTestRunner(base_test_runner.BaseTestRunner):
""" """
#override #override
def __init__(self, device, shard_index, tool, push_deps, def __init__(self, device, shard_index, tool, cleanup_test_files):
cleanup_test_files):
"""Creates a new HostDrivenTestRunner. """Creates a new HostDrivenTestRunner.
Args: Args:
device: Attached android device. device: Attached android device.
shard_index: Shard index. shard_index: Shard index.
tool: Name of the Valgrind tool. tool: Name of the Valgrind tool.
push_deps: If True, push all dependencies to the device.
cleanup_test_files: Whether or not to cleanup test files on device. cleanup_test_files: Whether or not to cleanup test files on device.
""" """
super(HostDrivenTestRunner, self).__init__(device, tool, push_deps, super(HostDrivenTestRunner, self).__init__(device, tool, cleanup_test_files)
cleanup_test_files)
# The shard index affords the ability to create unique port numbers (e.g. # The shard index affords the ability to create unique port numbers (e.g.
# DEFAULT_PORT + shard_index) if the test so wishes. # DEFAULT_PORT + shard_index) if the test so wishes.
...@@ -85,8 +82,7 @@ class HostDrivenTestRunner(base_test_runner.BaseTestRunner): ...@@ -85,8 +82,7 @@ class HostDrivenTestRunner(base_test_runner.BaseTestRunner):
exception_raised = False exception_raised = False
try: try:
test.SetUp(str(self.device), self.shard_index, test.SetUp(str(self.device), self.shard_index, self._cleanup_test_files)
self._push_deps, self._cleanup_test_files)
except Exception: except Exception:
logging.exception( logging.exception(
'Caught exception while trying to run SetUp() for test: ' + 'Caught exception while trying to run SetUp() for test: ' +
......
...@@ -9,7 +9,6 @@ import collections ...@@ -9,7 +9,6 @@ import collections
InstrumentationOptions = collections.namedtuple('InstrumentationOptions', [ InstrumentationOptions = collections.namedtuple('InstrumentationOptions', [
'tool', 'tool',
'cleanup_test_files', 'cleanup_test_files',
'push_deps',
'annotations', 'annotations',
'exclude_annotations', 'exclude_annotations',
'test_filter', 'test_filter',
......
...@@ -66,7 +66,6 @@ class TestRunner(base_test_runner.BaseTestRunner): ...@@ -66,7 +66,6 @@ class TestRunner(base_test_runner.BaseTestRunner):
additional_flags: A list of additional flags to add to the command line. additional_flags: A list of additional flags to add to the command line.
""" """
super(TestRunner, self).__init__(device, test_options.tool, super(TestRunner, self).__init__(device, test_options.tool,
test_options.push_deps,
test_options.cleanup_test_files) test_options.cleanup_test_files)
self._lighttp_port = constants.LIGHTTPD_RANDOM_PORT_FIRST + shard_index self._lighttp_port = constants.LIGHTTPD_RANDOM_PORT_FIRST + shard_index
......
...@@ -39,7 +39,6 @@ def Setup(options, _devices): ...@@ -39,7 +39,6 @@ def Setup(options, _devices):
def TestRunnerFactory(device, _shard_index): def TestRunnerFactory(device, _shard_index):
return test_runner.LinkerTestRunner( return test_runner.LinkerTestRunner(
device, options.tool, options.push_deps, device, options.tool, options.cleanup_test_files)
options.cleanup_test_files)
return (TestRunnerFactory, all_tests) return (TestRunnerFactory, all_tests)
...@@ -49,18 +49,16 @@ class LinkerTestRunner(base_test_runner.BaseTestRunner): ...@@ -49,18 +49,16 @@ class LinkerTestRunner(base_test_runner.BaseTestRunner):
""" """
#override #override
def __init__(self, device, tool, push_deps, cleanup_test_files): def __init__(self, device, tool, cleanup_test_files):
"""Creates a new LinkerTestRunner. """Creates a new LinkerTestRunner.
Args: Args:
device: Attached android device. device: Attached android device.
tool: Name of the Valgrind tool. tool: Name of the Valgrind tool.
push_deps: If True, push all dependencies to the device.
cleanup_test_files: Whether or not to cleanup test files on device. cleanup_test_files: Whether or not to cleanup test files on device.
""" """
super(LinkerTestRunner, self).__init__(device, tool, push_deps, super(LinkerTestRunner, self).__init__(device, tool, cleanup_test_files)
cleanup_test_files)
#override #override
def InstallTestPackage(self): def InstallTestPackage(self):
......
...@@ -9,7 +9,6 @@ import collections ...@@ -9,7 +9,6 @@ import collections
UIAutomatorOptions = collections.namedtuple('UIAutomatorOptions', [ UIAutomatorOptions = collections.namedtuple('UIAutomatorOptions', [
'tool', 'tool',
'cleanup_test_files', 'cleanup_test_files',
'push_deps',
'annotations', 'annotations',
'exclude_annotations', 'exclude_annotations',
'test_filter', 'test_filter',
......
...@@ -27,7 +27,6 @@ class TestRunner(instr_test_runner.TestRunner): ...@@ -27,7 +27,6 @@ class TestRunner(instr_test_runner.TestRunner):
instrumentation_options = instr_test_options.InstrumentationOptions( instrumentation_options = instr_test_options.InstrumentationOptions(
test_options.tool, test_options.tool,
test_options.cleanup_test_files, test_options.cleanup_test_files,
test_options.push_deps,
test_options.annotations, test_options.annotations,
test_options.exclude_annotations, test_options.exclude_annotations,
test_options.test_filter, test_options.test_filter,
......
...@@ -98,11 +98,6 @@ def AddDeviceOptions(option_parser): ...@@ -98,11 +98,6 @@ def AddDeviceOptions(option_parser):
dest='tool', dest='tool',
help=('Run the test under a tool ' help=('Run the test under a tool '
'(use --tool help to list them)')) '(use --tool help to list them)'))
group.add_option('--skip-deps-push', dest='push_deps',
action='store_false', default=True,
help=('Do not push dependencies to the device. '
'Use this at own risk for speeding up test '
'execution on local machine.'))
group.add_option('-d', '--device', dest='test_device', group.add_option('-d', '--device', dest='test_device',
help=('Target device for the test suite ' help=('Target device for the test suite '
'to run on.')) 'to run on.'))
...@@ -308,7 +303,6 @@ def ProcessInstrumentationOptions(options, error_func): ...@@ -308,7 +303,6 @@ def ProcessInstrumentationOptions(options, error_func):
return instrumentation_test_options.InstrumentationOptions( return instrumentation_test_options.InstrumentationOptions(
options.tool, options.tool,
options.cleanup_test_files, options.cleanup_test_files,
options.push_deps,
options.annotations, options.annotations,
options.exclude_annotations, options.exclude_annotations,
options.test_filter, options.test_filter,
...@@ -387,7 +381,6 @@ def ProcessUIAutomatorOptions(options, error_func): ...@@ -387,7 +381,6 @@ def ProcessUIAutomatorOptions(options, error_func):
return uiautomator_test_options.UIAutomatorOptions( return uiautomator_test_options.UIAutomatorOptions(
options.tool, options.tool,
options.cleanup_test_files, options.cleanup_test_files,
options.push_deps,
options.annotations, options.annotations,
options.exclude_annotations, options.exclude_annotations,
options.test_filter, options.test_filter,
...@@ -591,7 +584,6 @@ def _RunGTests(options, devices): ...@@ -591,7 +584,6 @@ def _RunGTests(options, devices):
gtest_options = gtest_test_options.GTestOptions( gtest_options = gtest_test_options.GTestOptions(
options.tool, options.tool,
options.cleanup_test_files, options.cleanup_test_files,
options.push_deps,
options.test_filter, options.test_filter,
options.run_disabled, options.run_disabled,
options.test_arguments, options.test_arguments,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment