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

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

Issue 832493005: Add Instrumentation test support to remote device (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
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
jbudorick 2015/01/20 15:39:04 2015
rnephew (Wrong account) 2015/01/20 16:45:46 Done.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """Run specific test on specific environment."""
6
7 import logging
8 import os
9 import tempfile
10
11 from pylib.base import base_test_result
12
jbudorick 2015/01/20 15:39:04 nit: no empty line here
rnephew (Wrong account) 2015/01/20 16:45:46 Done.
13 from pylib.remote.device import remote_device_test_run
14 from pylib.utils import apk_helper
15
16
17 class RemoteDeviceInstrumentationRun(
jbudorick 2015/01/20 15:39:04 nit: RemoteDeviceInstrumentationRun -> RemoteDevic
rnephew (Wrong account) 2015/01/20 16:45:46 Done.
18 remote_device_test_run.RemoteDeviceTestRun):
19 """Run instrumentation tests on a remote device."""
20
21 #override
22 def TestPackage(self):
23 return self._test_instance.test_package
24
25 #override
26 def _TriggerSetUp(self):
27 """Set up the triggering of a test run."""
28 logging.info('Triggering test run.')
29 self._AmInstrumentTestSetup(
30 self._test_instance._apk_under_test, self._test_instance.test_apk,
31 self._test_instance.runner_runner, environment_variables={})
jbudorick 2015/01/20 15:39:03 runner_runner...?
rnephew (Wrong account) 2015/01/20 16:45:46 Done.
32
33 #override
34 def _ParseTestResults(self):
35 logging.info('Parsing results from stdout.')
36 r = base_test_result.TestRunResults()
37
38 if self._results['results']['exception']:
39 r.AddResult(base_test_result.BaseTestResult(
40 self._results['results']['exception'],
41 base_test_result.ResultType.FAIL))
42 return r
43
44 _, errors, parsed_output = self._test_instance.ParseAmInstrumentRawOutput(
45 self._results['results']['output'].splitlines())
46 logging.info(errors)
jbudorick 2015/01/20 15:39:04 This should either be: - removed - logged at deb
rnephew (Wrong account) 2015/01/20 16:45:46 Done.
47 result = self._test_instance.GenerateMultiTestResult(errors, parsed_output)
48
49 if isinstance(result, base_test_result.BaseTestResult):
50 r.AddResult(result)
51 elif isinstance(result, list):
52 r.AddResults(result)
53 else:
54 raise Exception('Unexpected result type: %s' % type(result).__name__)
55
56 return r
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698