Revert of πŸ‘” Move side-loaded test data /sdcard -> /sdcard/gtestdata (patchset #17 id:320001 of https://codereview.chromium.org/1926793002/ )

Reason for revert:
Broke webview tests:
https://build.chromium.org/p/chromium.android/builders/Android%20Webview%20M%20%28dbg%29/builds/9501

Original issue's description:
> Move side-loaded test data /sdcard -> /sdcard/chromium_tests_root
>
> And use delete_device_stale=True when pushing. This will prevent tests
> mistakenly passing when they depend on stale data files from a previous test.
>
> BUG=607169
>
> Committed: https://crrev.com/0fe567512193cc8fbfcfd006ff1d504bd6346290
> Cr-Commit-Position: refs/heads/master@{#396169}

TBR=jbudorick@chromium.org,thakis@chromium.org,mef@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=607169

Review-Url: https://codereview.chromium.org/2011763007
Cr-Original-Commit-Position: refs/heads/master@{#396174}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5a7a6cd176bd3c1a9524893801b8d177ebe0f63a
This commit is contained in:
agrieve 2016-05-26 07:53:18 -07:00 ΠΊΠΎΠΌΠΌΠΈΡ‚ ΠΏΡ€ΠΎΠΈΠ·Π²Ρ‘Π» Commit bot
Π ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒ 827320c299
ΠšΠΎΠΌΠΌΠΈΡ‚ de866a2e5b
4 ΠΈΠ·ΠΌΠ΅Π½Ρ‘Π½Π½Ρ‹Ρ… Ρ„Π°ΠΉΠ»ΠΎΠ²: 10 Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠΉ ΠΈ 24 ΡƒΠ΄Π°Π»Π΅Π½ΠΈΠΉ

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -241,16 +241,12 @@ class LocalDeviceGtestRun(local_device_test_run.LocalDeviceTestRun):
def push_test_data():
# Push data dependencies.
device_root = posixpath.join(dev.GetExternalStoragePath(),
'chromium_tests_root')
external_storage = dev.GetExternalStoragePath()
data_deps = self._test_instance.GetDataDependencies()
host_device_tuples = [
(h, d if d is not None else device_root)
(h, d if d is not None else external_storage)
for h, d in data_deps]
dev.PushChangedFiles(host_device_tuples, delete_device_stale=True)
if not host_device_tuples:
dev.RunShellCommand(['rm', '-rf', device_root], check_return=True)
dev.RunShellCommand(['mkdir', '-p', device_root], check_return=True)
dev.PushChangedFiles(host_device_tuples)
def init_tool_and_start_servers():
tool = self.GetTool(dev)

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -4,7 +4,6 @@
import logging
import os
import posixpath
import re
import time
@ -59,11 +58,11 @@ class LocalDeviceInstrumentationTestRun(
return self._test_instance.suite
def SetUp(self):
def substitute_device_root(d, device_root):
def substitute_external_storage(d, external_storage):
if not d:
return device_root
return external_storage
elif isinstance(d, list):
return posixpath.join(p if p else device_root for p in d)
return '/'.join(p if p else external_storage for p in d)
else:
return d
@ -107,19 +106,14 @@ class LocalDeviceInstrumentationTestRun(
check_return=True)
def push_test_data():
device_root = posixpath.join(dev.GetExternalStoragePath(),
'chromium_tests_root')
external_storage = dev.GetExternalStoragePath()
host_device_tuples_substituted = [
(h, substitute_device_root(d, device_root))
(h, substitute_external_storage(d, external_storage))
for h, d in host_device_tuples]
logging.info('instrumentation data deps:')
for h, d in host_device_tuples_substituted:
logging.info('%r -> %r', h, d)
dev.PushChangedFiles(host_device_tuples_substituted,
delete_device_stale=True)
if not host_device_tuples_substituted:
dev.RunShellCommand(['rm', '-rf', device_root], check_return=True)
dev.RunShellCommand(['mkdir', '-p', device_root], check_return=True)
dev.PushChangedFiles(host_device_tuples_substituted)
def create_flag_changer():
if self._test_instance.flags:

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -230,8 +230,6 @@ class RemoteDeviceTestRun(test_run.TestRun):
self._app_id = self._UploadAppToDevice(app_path)
# TODO(agrieve): If AMP is ever ressurected, this needs to be changed to put
# test files under /sdcard/gtestdata. http://crbug.com/607169
data_deps = self._test_instance.GetDataDependencies()
if data_deps:
with tempfile.NamedTemporaryFile(suffix='.zip') as test_with_deps:

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -24,7 +24,6 @@
'<(DEPTH)/build/android/pylib/remote/device/dummy/dummy.gyp:require_remote_device_dummy_apk',
'<(DEPTH)/testing/android/appurify_support.gyp:appurify_support_java',
'<(DEPTH)/testing/android/on_device_instrumentation.gyp:reporter_java',
'<(DEPTH)/testing/android/native_test.gyp:native_test_java',
'<(DEPTH)/tools/android/android_tools.gyp:android_tools',
],
'conditions': [
@ -34,9 +33,8 @@
'test_type': 'gtest',
'apk_name': '<(test_suite_name)',
'intermediate_dir': '<(PRODUCT_DIR)/<(test_suite_name)_apk',
'java_in_dir': '<(DEPTH)/build/android/empty',
'android_manifest_path%': '<(DEPTH)/testing/android/native_test/java/AndroidManifest.xml',
'final_apk_path': '<(intermediate_dir)/<(test_suite_name)-debug.apk',
'java_in_dir': '<(DEPTH)/testing/android/native_test/java',
'native_lib_target': 'lib<(test_suite_name)',
# TODO(yfriedman, cjhopman): Support managed installs for gtests.
'gyp_managed_install': 0,