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

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

Issue 1923053002: Revert of Raise exception when devices fail to list tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 collections 5 import collections
6 import itertools 6 import itertools
7 import os 7 import os
8 import posixpath 8 import posixpath
9 9
10 from devil.android import device_errors 10 from devil.android import device_errors
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 tests = self._delegate.Run( 314 tests = self._delegate.Run(
315 None, dev, flags='--gtest_list_tests', timeout=20) 315 None, dev, flags='--gtest_list_tests', timeout=20)
316 tests = gtest_test_instance.ParseGTestListTests(tests) 316 tests = gtest_test_instance.ParseGTestListTests(tests)
317 tests = self._test_instance.FilterTests(tests) 317 tests = self._test_instance.FilterTests(tests)
318 return tests 318 return tests
319 319
320 # Query all devices in case one fails. 320 # Query all devices in case one fails.
321 test_lists = self._env.parallel_devices.pMap(list_tests).pGet(None) 321 test_lists = self._env.parallel_devices.pMap(list_tests).pGet(None)
322 322
323 # If all devices failed to list tests, raise an exception. 323 # If all devices failed to list tests, raise an exception.
324 # Check that tl is not None and is not empty. 324 if all([tl is None for tl in test_lists]):
325 if all(not tl for tl in test_lists):
326 raise device_errors.CommandFailedError( 325 raise device_errors.CommandFailedError(
327 'Failed to list tests on any device') 326 'Failed to list tests on any device')
328 return list(sorted(set().union(*[set(tl) for tl in test_lists if tl]))) 327 return list(sorted(set().union(*[set(tl) for tl in test_lists if tl])))
329 328
330 #override 329 #override
331 def _RunTest(self, device, test): 330 def _RunTest(self, device, test):
332 # Run the test. 331 # Run the test.
333 timeout = (self._test_instance.shard_timeout 332 timeout = (self._test_instance.shard_timeout
334 * self.GetTool(device).GetTimeoutScale()) 333 * self.GetTool(device).GetTimeoutScale())
335 output = self._delegate.Run( 334 output = self._delegate.Run(
(...skipping 20 matching lines...) Expand all
356 def TearDown(self): 355 def TearDown(self):
357 @local_device_test_run.handle_shard_failures 356 @local_device_test_run.handle_shard_failures
358 def individual_device_tear_down(dev): 357 def individual_device_tear_down(dev):
359 for s in self._servers.get(str(dev), []): 358 for s in self._servers.get(str(dev), []):
360 s.TearDown() 359 s.TearDown()
361 360
362 tool = self.GetTool(dev) 361 tool = self.GetTool(dev)
363 tool.CleanUpEnvironment() 362 tool.CleanUpEnvironment()
364 363
365 self._env.parallel_devices.pMap(individual_device_tear_down) 364 self._env.parallel_devices.pMap(individual_device_tear_down)
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