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'
class BaseTestRunner(object):
"""Base class for running tests on a single device."""
def __init__(self, device_serial, tool, push_deps=True,
cleanup_test_files=False):
def __init__(self, device_serial, tool, cleanup_test_files=False):
"""
Args:
device: Tests will run on the device of this ID.
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.
"""
self.device_serial = device_serial
......@@ -46,7 +44,6 @@ class BaseTestRunner(object):
# starting it in TestServerThread.
self.test_server_spawner_port = 0
self.test_server_port = 0
self._push_deps = push_deps
self._cleanup_test_files = cleanup_test_files
def _PushTestServerPortInfoToDevice(self):
......@@ -79,19 +76,7 @@ class BaseTestRunner(object):
def SetUp(self):
"""Run once before all tests are run."""
self.InstallTestPackage()
push_size_before = self.device.old_interface.GetPushSizeInfo()
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.')
self.PushDataDeps()
def TearDown(self):
"""Run once after all tests are run."""
......
......@@ -9,7 +9,6 @@ import collections
GTestOptions = collections.namedtuple('GTestOptions', [
'tool',
'cleanup_test_files',
'push_deps',
'gtest_filter',
'run_disabled',
'test_arguments',
......
......@@ -36,7 +36,6 @@ class TestRunner(base_test_runner.BaseTestRunner):
"""
super(TestRunner, self).__init__(device, test_options.tool,
test_options.push_deps,
test_options.cleanup_test_files)
self.test_package = test_package
......
......@@ -196,7 +196,6 @@ def InstrumentationSetup(host_driven_test_root, official_build,
return test_runner.HostDrivenTestRunner(
device, shard_index,
instrumentation_options.tool,
instrumentation_options.push_deps,
instrumentation_options.cleanup_test_files)
return (TestRunnerFactory, available_tests)
......@@ -57,7 +57,6 @@ class HostDrivenTestCase(object):
self.has_forwarded_ports = False
self.instrumentation_options = instrumentation_options
self.ports_to_forward = []
self.push_deps = False
self.shard_index = 0
# Use tagged_name when creating results, so that we can identify host-driven
......@@ -68,7 +67,7 @@ class HostDrivenTestCase(object):
# TODO(bulach): make ports_to_forward not optional and move the Forwarder
# mapping here.
def SetUp(self, device, shard_index, push_deps,
def SetUp(self, device, shard_index,
cleanup_test_files, ports_to_forward=None):
if not ports_to_forward:
ports_to_forward = []
......@@ -76,7 +75,6 @@ class HostDrivenTestCase(object):
self.shard_index = shard_index
self.device = device_utils.DeviceUtils(self.device_id)
self.adb = self.device.old_interface
self.push_deps = push_deps
self.cleanup_test_files = cleanup_test_files
if ports_to_forward:
self.ports_to_forward = ports_to_forward
......
......@@ -48,20 +48,17 @@ class HostDrivenTestRunner(base_test_runner.BaseTestRunner):
"""
#override
def __init__(self, device, shard_index, tool, push_deps,
cleanup_test_files):
def __init__(self, device, shard_index, tool, cleanup_test_files):
"""Creates a new HostDrivenTestRunner.
Args:
device: Attached android device.
shard_index: Shard index.
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.
"""
super(HostDrivenTestRunner, self).__init__(device, tool, push_deps,
cleanup_test_files)
super(HostDrivenTestRunner, self).__init__(device, tool, cleanup_test_files)
# The shard index affords the ability to create unique port numbers (e.g.
# DEFAULT_PORT + shard_index) if the test so wishes.
......@@ -85,8 +82,7 @@ class HostDrivenTestRunner(base_test_runner.BaseTestRunner):
exception_raised = False
try:
test.SetUp(str(self.device), self.shard_index,
self._push_deps, self._cleanup_test_files)
test.SetUp(str(self.device), self.shard_index, self._cleanup_test_files)
except Exception:
logging.exception(
'Caught exception while trying to run SetUp() for test: ' +
......
......@@ -9,7 +9,6 @@ import collections
InstrumentationOptions = collections.namedtuple('InstrumentationOptions', [
'tool',
'cleanup_test_files',
'push_deps',
'annotations',
'exclude_annotations',
'test_filter',
......
......@@ -66,7 +66,6 @@ class TestRunner(base_test_runner.BaseTestRunner):
additional_flags: A list of additional flags to add to the command line.
"""
super(TestRunner, self).__init__(device, test_options.tool,
test_options.push_deps,
test_options.cleanup_test_files)
self._lighttp_port = constants.LIGHTTPD_RANDOM_PORT_FIRST + shard_index
......
......@@ -39,7 +39,6 @@ def Setup(options, _devices):
def TestRunnerFactory(device, _shard_index):
return test_runner.LinkerTestRunner(
device, options.tool, options.push_deps,
options.cleanup_test_files)
device, options.tool, options.cleanup_test_files)
return (TestRunnerFactory, all_tests)
......@@ -49,18 +49,16 @@ class LinkerTestRunner(base_test_runner.BaseTestRunner):
"""
#override
def __init__(self, device, tool, push_deps, cleanup_test_files):
def __init__(self, device, tool, cleanup_test_files):
"""Creates a new LinkerTestRunner.
Args:
device: Attached android device.
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.
"""
super(LinkerTestRunner, self).__init__(device, tool, push_deps,
cleanup_test_files)
super(LinkerTestRunner, self).__init__(device, tool, cleanup_test_files)
#override
def InstallTestPackage(self):
......
......@@ -9,7 +9,6 @@ import collections
UIAutomatorOptions = collections.namedtuple('UIAutomatorOptions', [
'tool',
'cleanup_test_files',
'push_deps',
'annotations',
'exclude_annotations',
'test_filter',
......
......@@ -27,7 +27,6 @@ class TestRunner(instr_test_runner.TestRunner):
instrumentation_options = instr_test_options.InstrumentationOptions(
test_options.tool,
test_options.cleanup_test_files,
test_options.push_deps,
test_options.annotations,
test_options.exclude_annotations,
test_options.test_filter,
......
......@@ -98,11 +98,6 @@ def AddDeviceOptions(option_parser):
dest='tool',
help=('Run the test under a tool '
'(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',
help=('Target device for the test suite '
'to run on.'))
......@@ -308,7 +303,6 @@ def ProcessInstrumentationOptions(options, error_func):
return instrumentation_test_options.InstrumentationOptions(
options.tool,
options.cleanup_test_files,
options.push_deps,
options.annotations,
options.exclude_annotations,
options.test_filter,
......@@ -387,7 +381,6 @@ def ProcessUIAutomatorOptions(options, error_func):
return uiautomator_test_options.UIAutomatorOptions(
options.tool,
options.cleanup_test_files,
options.push_deps,
options.annotations,
options.exclude_annotations,
options.test_filter,
......@@ -591,7 +584,6 @@ def _RunGTests(options, devices):
gtest_options = gtest_test_options.GTestOptions(
options.tool,
options.cleanup_test_files,
options.push_deps,
options.test_filter,
options.run_disabled,
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