Chromium Code Reviews| Index: build/android/pylib/remote/device/remote_device_instrumentation_test_run.py |
| diff --git a/build/android/pylib/remote/device/remote_device_instrumentation_test_run.py b/build/android/pylib/remote/device/remote_device_instrumentation_test_run.py |
| index fe173a40b6d310bf3d22a530e87076f5a926f0a1..fa67bd929649c06c1457ce4ef14462371c7e8e49 100644 |
| --- a/build/android/pylib/remote/device/remote_device_instrumentation_test_run.py |
| +++ b/build/android/pylib/remote/device/remote_device_instrumentation_test_run.py |
| @@ -8,6 +8,7 @@ import logging |
| import os |
| import tempfile |
| +from pylib import constants |
| from pylib.base import base_test_result |
| from pylib.remote.device import remote_device_test_run |
| from pylib.utils import apk_helper |
| @@ -25,9 +26,37 @@ class RemoteDeviceInstrumentationTestRun( |
| def _TriggerSetUp(self): |
| """Set up the triggering of a test run.""" |
| logging.info('Triggering test run.') |
| - self._AmInstrumentTestSetup( |
| - self._test_instance._apk_under_test, self._test_instance.test_apk, |
| - self._test_instance.test_runner, environment_variables={}) |
| + |
| + with tempfile.NamedTemporaryFile(suffix='.txt') as test_list_file: |
| + tests = self._test_instance.GetTests() |
| + logging.debug('preparing to run %d instrumentation tests remotely:', |
| + len(tests)) |
| + for t in tests: |
| + test_name = '%s#%s' % (t['class'], t['method']) |
| + logging.debug(' %s', test_name) |
| + test_list_file.write('%s\n' % test_name) |
| + test_list_file.flush() |
| + self._test_instance._data_deps.append( |
| + (os.path.abspath(test_list_file.name), None)) |
|
klundberg
2015/03/27 16:13:30
Do you really need the extra parentheses in "(os.p
jbudorick
2015/04/07 00:54:38
Yep. _data_deps is a list of (host path, device pa
|
| + |
| + env_vars = self._test_instance.GetOutstrumentationEnvironmentVars( |
| + test_list_file_path=test_list_file.name) |
| + env_vars.update(self._test_instance.GetHttpServerEnvironmentVars()) |
| + |
| + logging.debug('extras:') |
| + for k, v in env_vars.iteritems(): |
| + logging.debug(' %s: %s', k, v) |
| + |
| + outstrumentation_apk = os.path.join( |
| + constants.GetOutDirectory(), 'apks', 'Outstrumentation.apk') |
| + outstrumentation = apk_helper.GetInstrumentationName(outstrumentation_apk) |
| + |
| + self._AmInstrumentTestSetup( |
| + self._test_instance._apk_under_test, |
| + outstrumentation_apk, |
| + outstrumentation, |
| + environment_variables=env_vars, |
| + extra_apks=[self._test_instance.test_apk]) |
| #override |
| def _ParseTestResults(self): |