Chromium Code Reviews| Index: build/android/pylib/local/device/local_device_test_run.py |
| diff --git a/build/android/pylib/local/device/local_device_test_run.py b/build/android/pylib/local/device/local_device_test_run.py |
| index 544fbf0e41107c40545c0875c8c99e30a963dbf5..5129473e51e58870976457c31306522af838415d 100644 |
| --- a/build/android/pylib/local/device/local_device_test_run.py |
| +++ b/build/android/pylib/local/device/local_device_test_run.py |
| @@ -160,7 +160,7 @@ class LocalDeviceTestRun(test_run.TestRun): |
| def _GetTestsToRetry(self, tests, try_results): |
| - def is_failure(test_result): |
| + def is_failure_result(test_result): |
| return ( |
| test_result is None |
| or test_result.GetType() not in ( |
| @@ -169,15 +169,17 @@ class LocalDeviceTestRun(test_run.TestRun): |
| all_test_results = {r.GetName(): r for r in try_results.GetAll()} |
| - def should_retry(name): |
| + def test_failed(name): |
| # When specifying a test filter, names can contain trailing wildcards. |
| # See local_device_gtest_run._ExtractTestsFromFilter() |
| if name.endswith('*'): |
|
mikecase (-- gone --)
2016/07/01 19:00:37
I dont think I understand this. I get that a * can
jbudorick
2016/07/11 16:32:51
Yeah, this is a bit complicated because of an opti
|
| - return any(fnmatch.fnmatch(n, name) and is_failure(t) |
| + return any(fnmatch.fnmatch(n, name) and is_failure_result(t) |
| for n, t in all_test_results.iteritems()) |
| - return is_failure(all_test_results.get(name)) |
| + return is_failure_result(all_test_results.get(name)) |
| - return [t for t in tests if should_retry(self._GetUniqueTestName(t))] |
| + failed_tests = (t for t in tests if test_failed(self._GetUniqueTestName(t))) |
| + |
| + return [t for t in failed_tests if self._ShouldRetry(t)] |
| def GetTool(self, device): |
| if not str(device) in self._tools: |
| @@ -188,10 +190,14 @@ class LocalDeviceTestRun(test_run.TestRun): |
| def _CreateShards(self, tests): |
| raise NotImplementedError |
| - # pylint: disable=no-self-use |
| def _GetUniqueTestName(self, test): |
| + # pylint: disable=no-self-use |
| return test |
| + def _ShouldRetry(self, test): |
| + # pylint: disable=no-self-use,unused-argument |
| + return True |
| + |
| def _GetTests(self): |
| raise NotImplementedError |