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

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

Issue 1112843002: [Android] Remove more uses of android_commands from build/android/pylib. (RELAND) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@detriplicated
Patch Set: fixes for host-driven tests & specific device Created 5 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 """Runs host-driven tests on a particular device.""" 5 """Runs host-driven tests on a particular device."""
6 6
7 import logging 7 import logging
8 import sys 8 import sys
9 import time 9 import time
10 import traceback 10 import traceback
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 A TestRunResults object which contains the result produced by the test 79 A TestRunResults object which contains the result produced by the test
80 and, in the case of a failure, the test that should be retried. 80 and, in the case of a failure, the test that should be retried.
81 """ 81 """
82 82
83 assert isinstance(test, test_case.HostDrivenTestCase) 83 assert isinstance(test, test_case.HostDrivenTestCase)
84 84
85 start_date_ms = int(time.time()) * 1000 85 start_date_ms = int(time.time()) * 1000
86 exception_raised = False 86 exception_raised = False
87 87
88 try: 88 try:
89 test.SetUp(str(self.device), self.shard_index) 89 test.SetUp(self.device, self.shard_index)
90 except Exception: 90 except Exception:
91 logging.exception( 91 logging.exception(
92 'Caught exception while trying to run SetUp() for test: ' + 92 'Caught exception while trying to run SetUp() for test: ' +
93 test.tagged_name) 93 test.tagged_name)
94 # Tests whose SetUp() method has failed are likely to fail, or at least 94 # Tests whose SetUp() method has failed are likely to fail, or at least
95 # yield invalid results. 95 # yield invalid results.
96 exc_info = sys.exc_info() 96 exc_info = sys.exc_info()
97 results = base_test_result.TestRunResults() 97 results = base_test_result.TestRunResults()
98 results.AddResult(HostDrivenExceptionTestResult( 98 results.AddResult(HostDrivenExceptionTestResult(
99 test.tagged_name, start_date_ms, exc_info)) 99 test.tagged_name, start_date_ms, exc_info))
(...skipping 24 matching lines...) Expand all
124 # until the test is fixed. 124 # until the test is fixed.
125 exc_info = sys.exc_info() 125 exc_info = sys.exc_info()
126 results = base_test_result.TestRunResults() 126 results = base_test_result.TestRunResults()
127 results.AddResult(HostDrivenExceptionTestResult( 127 results.AddResult(HostDrivenExceptionTestResult(
128 test.tagged_name, start_date_ms, exc_info)) 128 test.tagged_name, start_date_ms, exc_info))
129 129
130 if not results.DidRunPass(): 130 if not results.DidRunPass():
131 return results, test 131 return results, test
132 else: 132 else:
133 return results, None 133 return results, None
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698