| Index: build/android/pylib/remote/device/remote_device_uirobot_test_run.py
|
| diff --git a/build/android/pylib/remote/device/remote_device_uirobot_test_run.py b/build/android/pylib/remote/device/remote_device_uirobot_test_run.py
|
| index f99e685084b97b21a60a00ae5f298e54c7d3deb9..a2ef5588ef5e6d74d4060c26fc5dcb9eb52be470 100644
|
| --- a/build/android/pylib/remote/device/remote_device_uirobot_test_run.py
|
| +++ b/build/android/pylib/remote/device/remote_device_uirobot_test_run.py
|
| @@ -26,60 +26,59 @@ class RemoteDeviceUirobotTestRun(remote_device_test_run.RemoteDeviceTestRun):
|
| super(RemoteDeviceUirobotTestRun, self).__init__(env, test_instance)
|
|
|
| #override
|
| - def TestPackage(self):
|
| - return self._test_instance.package_name
|
| + def _GetAppPath(self):
|
| + return self._test_instance.app_under_test
|
|
|
| #override
|
| - def _TriggerSetUp(self):
|
| - """Set up the triggering of a test run."""
|
| - logging.info('Triggering test run.')
|
| -
|
| - if self._env.device_type == 'Android':
|
| - default_runner_type = 'android_robot'
|
| + def _GetTestFramework(self):
|
| + if self._env.test_framework:
|
| + return self._env.test_framework
|
| + elif self._env.device_type == 'Android':
|
| + return 'android_robot'
|
| elif self._env.device_type == 'iOS':
|
| - default_runner_type = 'ios_robot'
|
| + return 'ios_robot'
|
| else:
|
| raise remote_device_helper.RemoteDeviceError(
|
| 'Unknown device type: %s' % self._env.device_type)
|
|
|
| - self._app_id = self._UploadAppToDevice(self._test_instance.app_under_test)
|
| - if not self._env.runner_type:
|
| - runner_type = default_runner_type
|
| - logging.info('Using default runner type: %s', default_runner_type)
|
| - else:
|
| - runner_type = self._env.runner_type
|
| + #override
|
| + def _SetupTestShards(self, num_shards):
|
| + framework_configs = {'duration': self._test_instance.minutes}
|
|
|
| - self._test_id = self._UploadTestToDevice(
|
| - 'android_robot', None, app_id=self._app_id)
|
| - config_body = {'duration': self._test_instance.minutes}
|
| - self._SetTestConfig(runner_type, config_body)
|
| + test_id = self._UploadTestToDevice(None)
|
| + self._UploadTestConfigToDevice(
|
| + test_id, framework_configs, self._appurify_configs)
|
| + return [test_id]
|
|
|
| + #override
|
| + def TestPackage(self):
|
| + return self._test_instance.package_name
|
|
|
| # TODO(rnephew): Switch to base class implementation when supported.
|
| #override
|
| - def _UploadTestToDevice(self, test_type, test_path, app_id=None):
|
| - if test_path:
|
| - logging.info("Ignoring test path.")
|
| + def _UploadTestToDevice(self, test_path):
|
| data = {
|
| - 'access_token':self._env.token,
|
| - 'test_type':test_type,
|
| - 'app_id':app_id,
|
| + 'access_token': self._env.token,
|
| + 'test_type': self._GetTestFramework(),
|
| + 'app_id': self._app_id,
|
| }
|
| with appurify_sanitized.SanitizeLogging(self._env.verbose_count,
|
| logging.WARNING):
|
| - test_upload_res = appurify_sanitized.utils.post('tests/upload',
|
| - data, None)
|
| - remote_device_helper.TestHttpResponse(
|
| - test_upload_res, 'Unable to get UiRobot test id.')
|
| - return test_upload_res.json()['response']['test_id']
|
| + test_upload_response = appurify_sanitized.utils.post(
|
| + resource='tests/upload', data=data, files=None)
|
| + remote_device_helper.TestHttpResponse(test_upload_response,
|
| + 'Unable to get UiRobot test id.')
|
| + return test_upload_response.json()['response']['test_id']
|
|
|
| #override
|
| - def _ParseTestResults(self):
|
| + def _ParseTestResults(self, test_output, results_zip):
|
| logging.info('Parsing results from remote service.')
|
| results = base_test_result.TestRunResults()
|
| - if self._results['results']['pass']:
|
| + if test_output['results']['pass']:
|
| result_type = base_test_result.ResultType.PASS
|
| else:
|
| result_type = base_test_result.ResultType.FAIL
|
| results.AddResult(base_test_result.BaseTestResult('uirobot', result_type))
|
| + remote_device_test_run.DetectPlatformErrors(
|
| + results, test_output, results_zip)
|
| return results
|
|
|