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

Side by Side Diff: build/android/pylib/remote/device/remote_device_uirobot_test_run.py

Issue 872783003: Use upload test to get uirobot test id. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 """Run specific test on specific environment.""" 5 """Run specific test on specific environment."""
6 6
7 import logging 7 import logging
8 import os 8 import os
9 import sys 9 import sys
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 else: 44 else:
45 raise remote_device_helper.RemoteDeviceError( 45 raise remote_device_helper.RemoteDeviceError(
46 'Unkown device type: %s' % self._env.device_type) 46 'Unkown device type: %s' % self._env.device_type)
47 47
48 self._app_id = self._UploadAppToDevice(self._test_instance.app_under_test) 48 self._app_id = self._UploadAppToDevice(self._test_instance.app_under_test)
49 if not self._env.runner_type: 49 if not self._env.runner_type:
50 runner_type = default_runner_type 50 runner_type = default_runner_type
51 logging.info('Using default runner type: %s', default_runner_type) 51 logging.info('Using default runner type: %s', default_runner_type)
52 else: 52 else:
53 runner_type = self._env.runner_type 53 runner_type = self._env.runner_type
54 self._test_id = self._GetTestByName(runner_type) 54 # TODO(rnephew): Switch to UploadTestToDevice when supported.
55 data = {
56 'access_token':self._env.token,
57 'test_type':'android_robot',
58 'app_id':self._app_id,
59 }
60 with appurify_sanitized.SanitizeLogging(self._env.verbose_count,
61 logging.WARNING):
62 test_upload_res = appurify_sanitized.utils.post('tests/upload',
63 data, None)
64 remote_device_helper.TestHttpResponse(
65 test_upload_res, 'Unable to get UiRobot test id.')
jbudorick 2015/01/23 19:07:03 nit: move this to a separate function s.t. UploadT
rnephew (Wrong account) 2015/01/23 19:22:44 Done.
66 self._test_id = test_upload_res.json()['response']['test_id']
55 config_body = {'duration': self._test_instance.minutes} 67 config_body = {'duration': self._test_instance.minutes}
56 self._SetTestConfig(runner_type, config_body) 68 self._SetTestConfig(runner_type, config_body)
57 69
58 #override 70 #override
59 def _ParseTestResults(self): 71 def _ParseTestResults(self):
60 logging.info('Parsing results from remote service.') 72 logging.info('Parsing results from remote service.')
61 results = base_test_result.TestRunResults() 73 results = base_test_result.TestRunResults()
62 if self._results['results']['pass']: 74 if self._results['results']['pass']:
63 result_type = base_test_result.ResultType.PASS 75 result_type = base_test_result.ResultType.PASS
64 else: 76 else:
65 result_type = base_test_result.ResultType.FAIL 77 result_type = base_test_result.ResultType.FAIL
66 results.AddResult(base_test_result.BaseTestResult('uirobot', result_type)) 78 results.AddResult(base_test_result.BaseTestResult('uirobot', result_type))
67 return results 79 return results
OLDNEW
« no previous file with comments | « build/android/pylib/remote/device/remote_device_test_run.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698