Skip to content

Commit

Permalink
Push uiautomator test jar to its own folder in tmp
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
davileen authored and Commit bot committed Nov 12, 2014
1 parent 16bf9aa commit cc91e2f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
8 changes: 7 additions & 1 deletion build/android/pylib/uiautomator/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@


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)

Expand All @@ -24,4 +29,5 @@ def GetPackageName(self):

# 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())])
3 changes: 2 additions & 1 deletion build/android/pylib/uiautomator/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def _RunTest(self, test, timeout):
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)

Expand Down

0 comments on commit cc91e2f

Please sign in to comment.