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

Unified Diff: build/android/pylib/local/device/local_device_gtest_run.py

Issue 1716863002: Raise exception when all devices fail to list tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: simplify and changed exception to be thrown Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/local/device/local_device_gtest_run.py
diff --git a/build/android/pylib/local/device/local_device_gtest_run.py b/build/android/pylib/local/device/local_device_gtest_run.py
index e740f564a23cdb8cb8c52aac216b99421a1d977d..5f8dd59542fa3f89236df239ead36585328d44c0 100644
--- a/build/android/pylib/local/device/local_device_gtest_run.py
+++ b/build/android/pylib/local/device/local_device_gtest_run.py
@@ -315,8 +315,12 @@ class LocalDeviceGtestRun(local_device_test_run.LocalDeviceTestRun):
# Query all devices in case one fails.
test_lists = self._env.parallel_devices.pMap(list_tests).pGet(None)
- # TODO(agrieve): Make this fail rather than return an empty list when
- # all devices fail.
+
+ # If all devices failed to list_tests, raise an exception.
mikecase (-- gone --) 2016/02/19 23:41:53 super nit: s/list_tests/list tests
BigBossZhiling 2016/02/24 22:51:14 Done.
+ if all([tests == None for tests in test_lists]):
mikecase (-- gone --) 2016/02/19 23:41:54 super nit: To match the variable naming below... s
+ # Now we know that all devices failed to do list_tests.
mikecase (-- gone --) 2016/02/19 23:41:53 super nit: Comment is probably unnecessary given y
+ raise device_errors.CommandFailedError(
+ "Failed to list_tests on all devices")
mikecase (-- gone --) 2016/02/19 23:41:53 super nit: s/list_tests/list tests super nit: sing
return list(sorted(set().union(*[set(tl) for tl in test_lists if tl])))
#override
« 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