diff options
author | frankf@chromium.org <frankf@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-10 21:50:48 +0000 |
---|---|---|
committer | frankf@chromium.org <frankf@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-10 21:50:48 +0000 |
commit | 9aea4e59c49a988a3f7f5eb109fa23d678817581 (patch) | |
tree | fc9aca4a357dd6c2adf42a25e59467b14de29e1b /build | |
parent | 8da8671f9673efcbd01c8c5108ad40c2d716cac8 (diff) | |
download | chromium_src-9aea4e59c49a988a3f7f5eb109fa23d678817581.zip chromium_src-9aea4e59c49a988a3f7f5eb109fa23d678817581.tar.gz chromium_src-9aea4e59c49a988a3f7f5eb109fa23d678817581.tar.bz2 |
[Android] Add --skip-deps-push to test scripts.
This bypasses syncing any deps to the device to speed up
the developer workflow.
BUG=243447
NOTRY=True
Review URL: https://chromiumcodereview.appspot.com/16627004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205317 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r-- | build/android/pylib/base/base_test_runner.py | 10 | ||||
-rw-r--r-- | build/android/pylib/browsertests/dispatch.py | 1 | ||||
-rw-r--r-- | build/android/pylib/gtest/dispatch.py | 1 | ||||
-rw-r--r-- | build/android/pylib/gtest/test_runner.py | 5 | ||||
-rw-r--r-- | build/android/pylib/instrumentation/test_runner.py | 4 | ||||
-rw-r--r-- | build/android/pylib/utils/test_options_parser.py | 5 |
6 files changed, 21 insertions, 5 deletions
diff --git a/build/android/pylib/base/base_test_runner.py b/build/android/pylib/base/base_test_runner.py index 662cb34..0af5f50 100644 --- a/build/android/pylib/base/base_test_runner.py +++ b/build/android/pylib/base/base_test_runner.py @@ -34,12 +34,13 @@ class BaseTestRunner(object): the Run() method will set up tests, run them and tear them down. """ - def __init__(self, device, tool, build_type): + def __init__(self, device, tool, build_type, push_deps): """ Args: device: Tests will run on the device of this ID. shard_index: Index number of the shard on which the test suite will run. build_type: 'Release' or 'Debug'. + push_deps: If True, push all dependencies to the device. """ self.device = device self.adb = android_commands.AndroidCommands(device=device) @@ -59,6 +60,7 @@ class BaseTestRunner(object): self.test_server_spawner_port = 0 self.test_server_port = 0 self.build_type = build_type + self._push_deps = push_deps def _PushTestServerPortInfoToDevice(self): """Pushes the latest port information to device.""" @@ -86,7 +88,11 @@ class BaseTestRunner(object): def SetUp(self): """Run once before all tests are run.""" Forwarder.KillDevice(self.adb, self.tool) - self.PushDependencies() + if self._push_deps: + logging.info('Pushing deps to device.') + self.PushDependencies() + else: + logging.warning('Skipping pushing deps to device.') def TearDown(self): """Run once after all tests are run.""" diff --git a/build/android/pylib/browsertests/dispatch.py b/build/android/pylib/browsertests/dispatch.py index 06daf4d..ce1bc5a 100644 --- a/build/android/pylib/browsertests/dispatch.py +++ b/build/android/pylib/browsertests/dispatch.py @@ -53,6 +53,7 @@ def Dispatch(options): options.tool, options.build_type, options.webkit, + options.push_deps, constants.BROWSERTEST_TEST_PACKAGE_NAME, constants.BROWSERTEST_TEST_ACTIVITY_NAME, constants.BROWSERTEST_COMMAND_LINE_FILE) diff --git a/build/android/pylib/gtest/dispatch.py b/build/android/pylib/gtest/dispatch.py index a2598cfcb..2d9ab77 100644 --- a/build/android/pylib/gtest/dispatch.py +++ b/build/android/pylib/gtest/dispatch.py @@ -149,6 +149,7 @@ def _RunATestSuite(options, suite_name): options.tool, options.build_type, options.webkit, + options.push_deps, constants.GTEST_TEST_PACKAGE_NAME, constants.GTEST_TEST_ACTIVITY_NAME, constants.GTEST_COMMAND_LINE_FILE) diff --git a/build/android/pylib/gtest/test_runner.py b/build/android/pylib/gtest/test_runner.py index 4c14762..de3e6c3 100644 --- a/build/android/pylib/gtest/test_runner.py +++ b/build/android/pylib/gtest/test_runner.py @@ -246,6 +246,7 @@ class TestRunner(base_test_runner.BaseTestRunner): tool_name: Name of the Valgrind tool. build_type: 'Release' or 'Debug'. in_webkit_checkout: Whether the suite is being run from a WebKit checkout. + push_deps: If True, push all dependencies to the device. test_apk_package_name: Apk package name for tests running in APKs. test_activity_name: Test activity to invoke for APK tests. command_line_file: Filename to use to pass arguments to tests. @@ -253,9 +254,9 @@ class TestRunner(base_test_runner.BaseTestRunner): def __init__(self, device, test_suite, test_arguments, timeout, cleanup_test_files, tool_name, build_type, - in_webkit_checkout, test_apk_package_name=None, + in_webkit_checkout, push_deps, test_apk_package_name=None, test_activity_name=None, command_line_file=None): - super(TestRunner, self).__init__(device, tool_name, build_type) + super(TestRunner, self).__init__(device, tool_name, build_type, push_deps) self._running_on_emulator = self.device.startswith('emulator') self._test_arguments = test_arguments self.in_webkit_checkout = in_webkit_checkout diff --git a/build/android/pylib/instrumentation/test_runner.py b/build/android/pylib/instrumentation/test_runner.py index 9e6e62e..c134326 100644 --- a/build/android/pylib/instrumentation/test_runner.py +++ b/build/android/pylib/instrumentation/test_runner.py @@ -66,13 +66,15 @@ class TestRunner(base_test_runner.BaseTestRunner): - tool: Name of the Valgrind tool. - wait_for_debugger: blocks until the debugger is connected. - disable_assertions: Whether to disable java assertions on the device. + - push_deps: If True, push all dependencies to the device. device: Attached android device. shard_index: Shard index. test_pkg: A TestPackage object. ports_to_forward: A list of port numbers for which to set up forwarders. Can be optionally requested by a test case. """ - super(TestRunner, self).__init__(device, options.tool, options.build_type) + super(TestRunner, self).__init__(device, options.tool, options.build_type, + options.push_deps) self._lighttp_port = constants.LIGHTTPD_RANDOM_PORT_FIRST + shard_index self.build_type = options.build_type diff --git a/build/android/pylib/utils/test_options_parser.py b/build/android/pylib/utils/test_options_parser.py index eecfb71..16a440b 100644 --- a/build/android/pylib/utils/test_options_parser.py +++ b/build/android/pylib/utils/test_options_parser.py @@ -89,6 +89,11 @@ def AddTestRunnerOptions(option_parser, default_timeout=60): dest='flakiness_dashboard_server', help=('Address of the server that is hosting the ' 'Chrome for Android flakiness dashboard.')) + option_parser.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.') AddBuildTypeOption(option_parser) |