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

Unified Diff: build/android/test_runner.py

Issue 950893004: Add exit code for infra failures to testrunner script. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made CL more general. BaseError now has is_infra_error property. Created 5 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
Index: build/android/test_runner.py
diff --git a/build/android/test_runner.py b/build/android/test_runner.py
index f79e13e9786f81d71eb4aa2db9d9b1553ceeca12..6148d9984edc21327aaf1a069685f9cc6f92c188 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -20,6 +20,7 @@ from pylib import android_commands
from pylib import constants
from pylib import forwarder
from pylib import ports
+from pylib.base import base_error
from pylib.base import base_test_result
from pylib.base import environment_factory
from pylib.base import test_dispatcher
@@ -957,7 +958,7 @@ def RunTestsInPlatformMode(args, parser):
json_results.GenerateJsonResultsFile(
results, args.json_results_file)
- return 0 if results.DidRunPass() else 1
+ return 0 if results.DidRunPass() else constants.ERROR_EXIT_CODE
CommandConfigTuple = collections.namedtuple(
@@ -1013,7 +1014,14 @@ def main():
config.add_options_func(subparser)
args = parser.parse_args()
- return RunTestsCommand(args, parser)
+
+ try:
+ return RunTestsCommand(args, parser)
+ except base_error.BaseError as e:
+ if e.is_infra_error:
+ logging.exception('An infra error occured.')
+ return constants.INFRA_EXIT_CODE
+ raise
jbudorick 2015/02/23 22:13:00 What's your reasoning behind reraising non-infra e
mikecase (-- gone --) 2015/02/23 22:29:27 You're right. Its a lot clearer if I just handle b
if __name__ == '__main__':

Powered by Google App Engine
This is Rietveld 408576698