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

Unified Diff: build/android/pylib/test_result.py

Issue 11363088: Android: Report step failure when tests time out. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/pylib/test_result.py
diff --git a/build/android/pylib/test_result.py b/build/android/pylib/test_result.py
index 00d139caf8e3592815adfdca218d0e2cad809a02..f8370725cd0b0cc3ce370065614980c18e1be5cb 100644
--- a/build/android/pylib/test_result.py
+++ b/build/android/pylib/test_result.py
@@ -125,7 +125,7 @@ class TestResults(object):
"""Returns the all broken tests including failed, crashed, unknown."""
return self.failed + self.crashed + self.unknown
- def LogFull(self, test_group, test_suite, build_type):
+ def LogFull(self, test_group, test_suite, build_type, tests_to_run):
"""Output broken test logs, summarize in a log file and the test output."""
# Output all broken tests or 'passed' if none broken.
logging.critical('*' * 80)
@@ -177,23 +177,31 @@ class TestResults(object):
# Summarize in the test output.
summary_string = 'Summary:\n'
- summary_string += 'RAN=%d\n' % (len(self.ok) + len(self.failed) +
- len(self.crashed) + len(self.unknown))
- summary_string += 'PASSED=%d\n' % (len(self.ok))
- summary_string += 'FAILED=%d %s\n' % (len(self.failed),
- [t.name for t in self.failed])
- summary_string += 'CRASHED=%d %s\n' % (len(self.crashed),
- [t.name for t in self.crashed])
- summary_string += 'UNKNOWN=%d %s\n' % (len(self.unknown),
- [t.name for t in self.unknown])
+ summary_string += 'TESTS_TO_RUN=%d\n' % (len(tests_to_run))
+ num_tests_ran = len(self.ok) + len(self.failed) + \
Yaron 2012/11/05 22:52:13 nit: prefer wrapping expression in parens instead
nilesh 2012/11/05 23:08:01 Done.
+ len(self.crashed) + len(self.unknown)
+ tests_passed = [t.name for t in self.ok]
+ tests_failed = [t.name for t in self.failed]
+ tests_crashed = [t.name for t in self.crashed]
+ tests_unknown = [t.name for t in self.unknown]
+ summary_string += 'RAN=%d\n' % (num_tests_ran)
+ summary_string += 'PASSED=%d\n' % len(tests_passed)
+ summary_string += 'FAILED=%d %s\n' % (len(tests_failed), tests_failed)
+ summary_string += 'CRASHED=%d %s\n' % (len(tests_crashed), tests_crashed)
+ summary_string += 'UNKNOWN=%d %s\n' % (len(tests_unknown), tests_unknown)
+ if (num_tests_ran != len(tests_to_run)):
Yaron 2012/11/05 22:52:13 nit: remove parens
nilesh 2012/11/05 23:08:01 Done.
+ # Add the list of tests we failed to run.
+ tests_failed_to_run = list(set(tests_to_run) - set(tests_passed) -
+ set(tests_failed) - set(tests_crashed) -
+ set(tests_unknown))
+ summary_string += 'FAILED_TO_RUN=%d %s\n' % (len(tests_failed_to_run),
+ tests_failed_to_run)
logging.critical(summary_string)
return summary_string
def PrintAnnotation(self):
"""Print buildbot annotations for test results."""
- if self.timed_out:
- buildbot_report.PrintWarning()
- elif self.failed or self.crashed or self.overall_fail:
+ if self.failed or self.crashed or self.overall_fail or self.timed_out:
buildbot_report.PrintError()
else:
print 'Step success!' # No annotation needed

Powered by Google App Engine
This is Rietveld 408576698