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

Unified Diff: scripts/slave/recipe_modules/test_utils/api.py

Issue 1366353002: Change test_util summarize_retried_test not to use inline python (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 5 years, 3 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 | scripts/slave/recipes/blink_downstream.expected/full_client_v8_fyi_V8_Blink_Linux_32_fail.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/test_utils/api.py
diff --git a/scripts/slave/recipe_modules/test_utils/api.py b/scripts/slave/recipe_modules/test_utils/api.py
index 6629762ea363ce638f33164b5ecd716e8d4d319d..a854c26e7a80342343d0c270d685130833614001 100644
--- a/scripts/slave/recipe_modules/test_utils/api.py
+++ b/scripts/slave/recipe_modules/test_utils/api.py
@@ -128,6 +128,8 @@ class TestUtilsApi(recipe_api.RecipeApi):
self.m.python.failing_step(test.name, 'TEST RESULTS WERE INVALID')
def _summarize_retried_test(self, caller_api, test):
+ """Summarizes test results and exits with a failing status if there were new
+ failures."""
if not test.has_valid_results(caller_api, 'without patch'):
self._invalid_test_results(test)
@@ -140,48 +142,20 @@ class TestUtilsApi(recipe_api.RecipeApi):
'new_failures': sorted(new_failures),
})
+ step_text = self.format_step_text([
+ ['failures:', new_failures],
+ ['ignored:', ignored_failures]
+ ])
try:
- self.m.python.inline(
- test.name,
- r"""
- import sys, json
- failures = json.load(open(sys.argv[1], 'rb'))
-
- success = True
-
- if failures['new']:
- success = False
- print 'New failures:'
- for f in failures['new']:
- print f
-
- if failures['ignored']:
- print 'Ignored failures:'
- for f in failures['ignored']:
- print f
-
- sys.exit(0 if success else 1)
- """,
- args=[
- self.m.json.input({
- 'new': list(new_failures),
- 'ignored': list(ignored_failures),
- })
- ],
- )
+ if new_failures:
+ self.m.python.failing_step(test.name, step_text)
+ else:
+ self.m.python.succeeding_step(test.name, step_text)
finally:
- p = self.m.step.active_result.presentation
-
- p.step_text += self.format_step_text([
- ['failures:', new_failures],
- ['ignored:', ignored_failures]
- ])
-
if new_failures:
- p.status = self.m.step.FAILURE
self.m.tryserver.set_test_failure_tryjob_result()
elif ignored_failures:
- p.status = self.m.step.WARNING
+ self.m.step.active_result.presentation.status = self.m.step.WARNING
@recipe_util.returns_placeholder
def test_results(self, add_json_log=True):
« no previous file with comments | « no previous file | scripts/slave/recipes/blink_downstream.expected/full_client_v8_fyi_V8_Blink_Linux_32_fail.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698