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

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

Issue 696923002: Remove the unused push_deps option from the test runners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 30 matching lines...) Expand all
41 41
42 42
43 class HostDrivenTestRunner(base_test_runner.BaseTestRunner): 43 class HostDrivenTestRunner(base_test_runner.BaseTestRunner):
44 """Orchestrates running a set of host-driven tests. 44 """Orchestrates running a set of host-driven tests.
45 45
46 Any Python exceptions in the tests are caught and translated into a failed 46 Any Python exceptions in the tests are caught and translated into a failed
47 result, rather than being re-raised on the main thread. 47 result, rather than being re-raised on the main thread.
48 """ 48 """
49 49
50 #override 50 #override
51 def __init__(self, device, shard_index, tool, push_deps, 51 def __init__(self, device, shard_index, tool, cleanup_test_files):
52 cleanup_test_files):
53 """Creates a new HostDrivenTestRunner. 52 """Creates a new HostDrivenTestRunner.
54 53
55 Args: 54 Args:
56 device: Attached android device. 55 device: Attached android device.
57 shard_index: Shard index. 56 shard_index: Shard index.
58 tool: Name of the Valgrind tool. 57 tool: Name of the Valgrind tool.
59 push_deps: If True, push all dependencies to the device.
60 cleanup_test_files: Whether or not to cleanup test files on device. 58 cleanup_test_files: Whether or not to cleanup test files on device.
61 """ 59 """
62 60
63 super(HostDrivenTestRunner, self).__init__(device, tool, push_deps, 61 super(HostDrivenTestRunner, self).__init__(device, tool, cleanup_test_files)
64 cleanup_test_files)
65 62
66 # The shard index affords the ability to create unique port numbers (e.g. 63 # The shard index affords the ability to create unique port numbers (e.g.
67 # DEFAULT_PORT + shard_index) if the test so wishes. 64 # DEFAULT_PORT + shard_index) if the test so wishes.
68 self.shard_index = shard_index 65 self.shard_index = shard_index
69 66
70 #override 67 #override
71 def RunTest(self, test): 68 def RunTest(self, test):
72 """Sets up and runs a test case. 69 """Sets up and runs a test case.
73 70
74 Args: 71 Args:
75 test: An object which is ostensibly a subclass of HostDrivenTestCase. 72 test: An object which is ostensibly a subclass of HostDrivenTestCase.
76 73
77 Returns: 74 Returns:
78 A TestRunResults object which contains the result produced by the test 75 A TestRunResults object which contains the result produced by the test
79 and, in the case of a failure, the test that should be retried. 76 and, in the case of a failure, the test that should be retried.
80 """ 77 """
81 78
82 assert isinstance(test, test_case.HostDrivenTestCase) 79 assert isinstance(test, test_case.HostDrivenTestCase)
83 80
84 start_date_ms = int(time.time()) * 1000 81 start_date_ms = int(time.time()) * 1000
85 exception_raised = False 82 exception_raised = False
86 83
87 try: 84 try:
88 test.SetUp(str(self.device), self.shard_index, 85 test.SetUp(str(self.device), self.shard_index, self._cleanup_test_files)
89 self._push_deps, self._cleanup_test_files)
90 except Exception: 86 except Exception:
91 logging.exception( 87 logging.exception(
92 'Caught exception while trying to run SetUp() for test: ' + 88 'Caught exception while trying to run SetUp() for test: ' +
93 test.tagged_name) 89 test.tagged_name)
94 # Tests whose SetUp() method has failed are likely to fail, or at least 90 # Tests whose SetUp() method has failed are likely to fail, or at least
95 # yield invalid results. 91 # yield invalid results.
96 exc_info = sys.exc_info() 92 exc_info = sys.exc_info()
97 results = base_test_result.TestRunResults() 93 results = base_test_result.TestRunResults()
98 results.AddResult(HostDrivenExceptionTestResult( 94 results.AddResult(HostDrivenExceptionTestResult(
99 test.tagged_name, start_date_ms, exc_info)) 95 test.tagged_name, start_date_ms, exc_info))
(...skipping 24 matching lines...) Expand all
124 # until the test is fixed. 120 # until the test is fixed.
125 exc_info = sys.exc_info() 121 exc_info = sys.exc_info()
126 results = base_test_result.TestRunResults() 122 results = base_test_result.TestRunResults()
127 results.AddResult(HostDrivenExceptionTestResult( 123 results.AddResult(HostDrivenExceptionTestResult(
128 test.tagged_name, start_date_ms, exc_info)) 124 test.tagged_name, start_date_ms, exc_info))
129 125
130 if not results.DidRunPass(): 126 if not results.DidRunPass():
131 return results, test 127 return results, test
132 else: 128 else:
133 return results, None 129 return results, None
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698