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

Unified Diff: recipe_engine/test.py

Issue 2797023002: Always identify test names that lead to failures (Closed)
Patch Set: proto Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | recipe_engine/test_result.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_engine/test.py
diff --git a/recipe_engine/test.py b/recipe_engine/test.py
index 4bce4c799aa4a3caa1e9a6bbf28c486b14ea7c2d..501e9d50db602340340437c505618b4a9c90d380 100644
--- a/recipe_engine/test.py
+++ b/recipe_engine/test.py
@@ -543,13 +543,13 @@ def worker(f):
- they can hang on uncaught exceptions
- we need explicit kill switch to clearly terminate parent"""
@functools.wraps(f)
- def wrapper(*args, **kwargs):
+ def wrapper(test, *args, **kwargs):
try:
if _KILL_SWITCH.is_set():
- return (False, 'kill switch')
- return (True, f(*args, **kwargs))
+ return (False, test, 'kill switch')
+ return (True, test, f(test, *args, **kwargs))
except Exception:
- return (False, traceback.format_exc())
+ return (False, test, traceback.format_exc())
return wrapper
@@ -617,7 +617,7 @@ def run_run(test_filter, jobs=None, debug=False, train=False, json_file=None):
used_expectations = set()
- for success, details in results:
+ for success, test_description, details in results:
if success:
assert isinstance(details, TestResult)
if details.failures:
@@ -635,7 +635,12 @@ def run_run(test_filter, jobs=None, debug=False, train=False, json_file=None):
else:
rc = 1
results_proto.valid = False
- print('Internal failure:')
+ failure_proto = test_result_pb2.TestResult.TestFailure()
+ failure_proto.internal_failure.MergeFrom(
+ test_result_pb2.TestResult.InternalFailure())
+ results_proto.test_failures[test_description.full_name].failures.extend([
+ failure_proto])
+ print('%s failed:' % test_description.full_name)
print(details)
if test_filter:
« no previous file with comments | « no previous file | recipe_engine/test_result.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698