Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: build/android/pylib/instrumentation/test_runner.py

Issue 645093002: Revert of [Android] Add zip pushing and refine push mode selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Class for running instrumentation tests on a single device.""" 5 """Class for running instrumentation tests on a single device."""
6 6
7 import logging 7 import logging
8 import os 8 import os
9 import re 9 import re
10 import sys 10 import sys
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 #override 93 #override
94 def PushDataDeps(self): 94 def PushDataDeps(self):
95 # TODO(frankf): Implement a general approach for copying/installing 95 # TODO(frankf): Implement a general approach for copying/installing
96 # once across test runners. 96 # once across test runners.
97 if TestRunner._DEVICE_HAS_TEST_FILES.get(self.device, False): 97 if TestRunner._DEVICE_HAS_TEST_FILES.get(self.device, False):
98 logging.warning('Already copied test files to device %s, skipping.', 98 logging.warning('Already copied test files to device %s, skipping.',
99 str(self.device)) 99 str(self.device))
100 return 100 return
101 101
102 host_device_file_tuples = []
103 test_data = _GetDataFilesForTestSuite(self.test_pkg.GetApkName()) 102 test_data = _GetDataFilesForTestSuite(self.test_pkg.GetApkName())
104 if test_data: 103 if test_data:
105 # Make sure SD card is ready. 104 # Make sure SD card is ready.
106 self.device.WaitUntilFullyBooted(timeout=20) 105 self.device.WaitUntilFullyBooted(timeout=20)
107 host_device_file_tuples += [ 106 for p in test_data:
108 (os.path.join(constants.DIR_SOURCE_ROOT, p), 107 self.device.PushChangedFiles(
109 os.path.join(self.device.GetExternalStoragePath(), p)) 108 os.path.join(constants.DIR_SOURCE_ROOT, p),
110 for p in test_data] 109 os.path.join(self.device.GetExternalStoragePath(), p))
111 110
112 # TODO(frankf): Specify test data in this file as opposed to passing 111 # TODO(frankf): Specify test data in this file as opposed to passing
113 # as command-line. 112 # as command-line.
114 for dest_host_pair in self.options.test_data: 113 for dest_host_pair in self.options.test_data:
115 dst_src = dest_host_pair.split(':', 1) 114 dst_src = dest_host_pair.split(':', 1)
116 dst_layer = dst_src[0] 115 dst_layer = dst_src[0]
117 host_src = dst_src[1] 116 host_src = dst_src[1]
118 host_test_files_path = os.path.join(constants.DIR_SOURCE_ROOT, 117 host_test_files_path = os.path.join(constants.DIR_SOURCE_ROOT,
119 host_src) 118 host_src)
120 if os.path.exists(host_test_files_path): 119 if os.path.exists(host_test_files_path):
121 host_device_file_tuples += [( 120 self.device.PushChangedFiles(
122 host_test_files_path, 121 host_test_files_path,
123 '%s/%s/%s' % ( 122 '%s/%s/%s' % (
124 self.device.GetExternalStoragePath(), 123 self.device.GetExternalStoragePath(),
125 TestRunner._DEVICE_DATA_DIR, 124 TestRunner._DEVICE_DATA_DIR,
126 dst_layer))] 125 dst_layer))
127 if host_device_file_tuples:
128 self.device.PushChangedFiles(host_device_file_tuples)
129 self.tool.CopyFiles() 126 self.tool.CopyFiles()
130 TestRunner._DEVICE_HAS_TEST_FILES[str(self.device)] = True 127 TestRunner._DEVICE_HAS_TEST_FILES[str(self.device)] = True
131 128
132 def _GetInstrumentationArgs(self): 129 def _GetInstrumentationArgs(self):
133 ret = {} 130 ret = {}
134 if self.options.wait_for_debugger: 131 if self.options.wait_for_debugger:
135 ret['debug'] = 'true' 132 ret['debug'] = 'true'
136 if self.coverage_dir: 133 if self.coverage_dir:
137 ret['coverage'] = 'true' 134 ret['coverage'] = 'true'
138 ret['coverageFile'] = self.coverage_device_file 135 ret['coverageFile'] = self.coverage_device_file
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 except device_errors.CommandTimeoutError as e: 502 except device_errors.CommandTimeoutError as e:
506 results.AddResult(test_result.InstrumentationTestResult( 503 results.AddResult(test_result.InstrumentationTestResult(
507 test, base_test_result.ResultType.TIMEOUT, start_ms, duration_ms, 504 test, base_test_result.ResultType.TIMEOUT, start_ms, duration_ms,
508 log=str(e) or 'No information')) 505 log=str(e) or 'No information'))
509 except device_errors.DeviceUnreachableError as e: 506 except device_errors.DeviceUnreachableError as e:
510 results.AddResult(test_result.InstrumentationTestResult( 507 results.AddResult(test_result.InstrumentationTestResult(
511 test, base_test_result.ResultType.CRASH, start_ms, duration_ms, 508 test, base_test_result.ResultType.CRASH, start_ms, duration_ms,
512 log=str(e) or 'No information')) 509 log=str(e) or 'No information'))
513 self.TestTeardown(test, results) 510 self.TestTeardown(test, results)
514 return (results, None if results.DidRunPass() else test) 511 return (results, None if results.DidRunPass() else test)
OLDNEW
« no previous file with comments | « build/android/pylib/gtest/test_runner.py ('k') | build/android/pylib/uiautomator/test_package.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698