Push uiautomator test jar to its own folder in tmp
When running uiautomator tests through test_runner the contents of /data/local/tmp is hashed using md5sum_bin to see if a push is needed. This is inefficient when tmp contains unrelated large files, and it relies on md5sum.cc to be able to handle a wide range of filetypes including named pipes. By transferring chrome_shell_uiautomator.dex.jar to /data/local/tmp/uiautomator we hash fewer files, and can be confident that the files are only files we care about (of type .jar or .dex.jar). Tested on a Nexus: ./build/android/test_runner.py uiautomator -v -v --test-jar=chrome_shell_uiautomator_tests --package=chrome_shell BUG=432341 Review URL: https://codereview.chromium.org/715153002 Cr-Commit-Position: refs/heads/master@{#303872}
This commit is contained in:
1
AUTHORS
1
AUTHORS
@ -110,6 +110,7 @@ Darshini KN <kn.darshini@samsung.com>
|
||||
David Benjamin <davidben@mit.edu>
|
||||
David Erceg <erceg.david@gmail.com>
|
||||
David Futcher <david.mike.futcher@gmail.com>
|
||||
David Leen <davileen@amazon.com>
|
||||
David McAllister <mcdavid@amazon.com>
|
||||
Deepak Dilip Borade <deepak.db@samsung.com>
|
||||
Deepak Mittal <deepak.m1@samsung.com>
|
||||
|
@ -11,6 +11,11 @@ from pylib.instrumentation import test_jar
|
||||
|
||||
|
||||
class TestPackage(test_jar.TestJar):
|
||||
|
||||
UIAUTOMATOR_PATH = 'uiautomator/'
|
||||
UIAUTOMATOR_DEVICE_DIR = os.path.join(constants.TEST_EXECUTABLE_DIR,
|
||||
UIAUTOMATOR_PATH)
|
||||
|
||||
def __init__(self, jar_path, jar_info_path):
|
||||
test_jar.TestJar.__init__(self, jar_info_path)
|
||||
|
||||
@ -24,4 +29,5 @@ class TestPackage(test_jar.TestJar):
|
||||
|
||||
# Override.
|
||||
def Install(self, device):
|
||||
device.PushChangedFiles([(self._jar_path, constants.TEST_EXECUTABLE_DIR)])
|
||||
device.PushChangedFiles([(self._jar_path, self.UIAUTOMATOR_DEVICE_DIR +
|
||||
self.GetPackageName())])
|
||||
|
@ -73,7 +73,8 @@ class TestRunner(instr_test_runner.TestRunner):
|
||||
package=self._package),
|
||||
blocking=True,
|
||||
force_stop=True)
|
||||
cmd = ['uiautomator', 'runtest', self.test_pkg.GetPackageName(),
|
||||
cmd = ['uiautomator', 'runtest',
|
||||
self.test_pkg.UIAUTOMATOR_PATH + self.test_pkg.GetPackageName(),
|
||||
'-e', 'class', test]
|
||||
return self.device.RunShellCommand(cmd, timeout=timeout, retries=0)
|
||||
|
||||
|
Reference in New Issue
Block a user