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

Side by Side Diff: build/android/pylib/local/device/local_device_test_run.py

Issue 1405853003: Android gtest runner: When skipping test list, don't treat *s as failed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix obvious bug Created 5 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 import fnmatch
5 import functools 6 import functools
6 import logging 7 import logging
7 8
8 from devil.android import device_errors 9 from devil.android import device_errors
9 from pylib import valgrind_tools 10 from pylib import valgrind_tools
10 from pylib.base import base_test_result 11 from pylib.base import base_test_result
11 from pylib.base import test_run 12 from pylib.base import test_run
12 from pylib.base import test_collection 13 from pylib.base import test_collection
13 14
14 15
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 run_tests_on_device, tests, try_results).pGet(None) 108 run_tests_on_device, tests, try_results).pGet(None)
108 109
109 for result in try_results.GetAll(): 110 for result in try_results.GetAll():
110 if result.GetType() in (base_test_result.ResultType.PASS, 111 if result.GetType() in (base_test_result.ResultType.PASS,
111 base_test_result.ResultType.SKIP): 112 base_test_result.ResultType.SKIP):
112 results.AddResult(result) 113 results.AddResult(result)
113 else: 114 else:
114 all_fail_results[result.GetName()] = result 115 all_fail_results[result.GetName()] = result
115 116
116 results_names = set(r.GetName() for r in results.GetAll()) 117 results_names = set(r.GetName() for r in results.GetAll())
117 tests = [t for t in tests if self._GetTestName(t) not in results_names] 118
119 def has_test_result(name):
120 # When specifying a test filter, names can contain trailing wildcards.
121 # See local_device_gtest_run._ExtractTestsFromFilter()
122 if name.endswith('*'):
123 return any(fnmatch.fnmatch(n, name) for n in results_names)
124 return name in results_names
125
126 tests = [t for t in tests if not has_test_result(self._GetTestName(t))]
118 tries += 1 127 tries += 1
119 logging.info('FINISHED TRY #%d/%d', tries, self._env.max_tries) 128 logging.info('FINISHED TRY #%d/%d', tries, self._env.max_tries)
120 if tests: 129 if tests:
121 logging.info('%d failed tests remain.', len(tests)) 130 logging.info('%d failed tests remain.', len(tests))
122 else: 131 else:
123 logging.info('All tests completed.') 132 logging.info('All tests completed.')
124 133
125 all_unknown_test_names = set(self._GetTestName(t) for t in tests) 134 all_unknown_test_names = set(self._GetTestName(t) for t in tests)
126 all_failed_test_names = set(all_fail_results.iterkeys()) 135 all_failed_test_names = set(all_fail_results.iterkeys())
127 136
(...skipping 24 matching lines...) Expand all
152 return test 161 return test
153 162
154 def _GetTests(self): 163 def _GetTests(self):
155 raise NotImplementedError 164 raise NotImplementedError
156 165
157 def _RunTest(self, device, test): 166 def _RunTest(self, device, test):
158 raise NotImplementedError 167 raise NotImplementedError
159 168
160 def _ShouldShard(self): 169 def _ShouldShard(self):
161 raise NotImplementedError 170 raise NotImplementedError
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698