| Index: build/android/pylib/base/test_result.py
|
| diff --git a/build/android/pylib/base/test_result.py b/build/android/pylib/base/test_result.py
|
| index 0c78d221779fea4e3511af5b31543a62a1113fea..772d3d5dec51a988da55f5433f3820870536d277 100644
|
| --- a/build/android/pylib/base/test_result.py
|
| +++ b/build/android/pylib/base/test_result.py
|
| @@ -57,18 +57,21 @@ class TestResults(object):
|
| self.failed = []
|
| self.crashed = []
|
| self.unknown = []
|
| - self.timed_out = False
|
| + self.timed_out = []
|
| + self.overall_timed_out = False
|
| self.overall_fail = False
|
| self.device_exception = None
|
|
|
| @staticmethod
|
| - def FromRun(ok=None, failed=None, crashed=None, timed_out=False,
|
| - overall_fail=False, device_exception=None):
|
| + def FromRun(ok=None, failed=None, crashed=None, timed_out=None,
|
| + overall_timed_out=False, overall_fail=False,
|
| + device_exception=None):
|
| ret = TestResults()
|
| ret.ok = ok or []
|
| ret.failed = failed or []
|
| ret.crashed = crashed or []
|
| - ret.timed_out = timed_out
|
| + ret.timed_out = timed_out or []
|
| + ret.overall_timed_out = overall_timed_out
|
| ret.overall_fail = overall_fail
|
| ret.device_exception = device_exception
|
| return ret
|
| @@ -82,8 +85,9 @@ class TestResults(object):
|
| ret.failed += t.failed
|
| ret.crashed += t.crashed
|
| ret.unknown += t.unknown
|
| - if t.timed_out:
|
| - ret.timed_out = True
|
| + ret.timed_out += t.timed_out
|
| + if t.overall_timed_out:
|
| + ret.overall_timed_out = True
|
| if t.overall_fail:
|
| ret.overall_fail = True
|
| return ret
|
| @@ -127,8 +131,8 @@ class TestResults(object):
|
| logging.critical(t.log)
|
|
|
| def GetAllBroken(self):
|
| - """Returns the all broken tests including failed, crashed, unknown."""
|
| - return self.failed + self.crashed + self.unknown
|
| + """Returns the all broken tests."""
|
| + return self.failed + self.crashed + self.unknown + self.timed_out
|
|
|
| def _LogToFile(self, test_type, test_suite, build_type):
|
| """Log results to local files which can be used for aggregation later."""
|
| @@ -149,9 +153,13 @@ class TestResults(object):
|
| len(self.ok) +
|
| len(self.failed) +
|
| len(self.crashed) +
|
| + len(self.timed_out) +
|
| len(self.unknown))]
|
| - content_pairs = [('passed', len(self.ok)), ('failed', len(self.failed)),
|
| - ('crashed', len(self.crashed))]
|
| + content_pairs = [('passed', len(self.ok)),
|
| + ('failed', len(self.failed)),
|
| + ('crashed', len(self.crashed)),
|
| + ('timed_out', len(self.timed_out)),
|
| + ('unknown', len(self.unknown))]
|
| for (result, count) in content_pairs:
|
| if count:
|
| log_contents.append(', %d tests %s' % (count, result))
|
| @@ -162,6 +170,7 @@ class TestResults(object):
|
| 'ok': [t.name for t in self.ok],
|
| 'failed': [t.name for t in self.failed],
|
| 'crashed': [t.name for t in self.failed],
|
| + 'timed_out': [t.name for t in self.timed_out],
|
| 'unknown': [t.name for t in self.unknown],}
|
| json_file_path = os.path.join(log_file_path, 'results.json')
|
| with open(json_file_path, 'a') as json_file:
|
| @@ -228,6 +237,9 @@ class TestResults(object):
|
| if self.crashed:
|
| logging.critical('Crashed:')
|
| self._Log(sorted(self.crashed))
|
| + if self.timed_out:
|
| + logging.critical('Timed out:')
|
| + self._Log(sorted(self.timed_out))
|
| if self.unknown:
|
| logging.critical('Unknown:')
|
| self._Log(sorted(self.unknown))
|
| @@ -240,21 +252,24 @@ class TestResults(object):
|
| if all_tests:
|
| summary += ['TESTS_TO_RUN=%d\n' % len(all_tests)]
|
| num_tests_ran = (len(self.ok) + len(self.failed) +
|
| - len(self.crashed) + len(self.unknown))
|
| + len(self.crashed) + len(self.unknown) +
|
| + len(self.timed_out))
|
| 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]
|
| + tests_timed_out = [t.name for t in self.timed_out]
|
| summary += ['RAN=%d\n' % (num_tests_ran),
|
| 'PASSED=%d\n' % len(tests_passed),
|
| 'FAILED=%d %s\n' % (len(tests_failed), tests_failed),
|
| 'CRASHED=%d %s\n' % (len(tests_crashed), tests_crashed),
|
| + 'TIMEDOUT=%d %s\n' % (len(tests_timed_out), tests_timed_out),
|
| 'UNKNOWN=%d %s\n' % (len(tests_unknown), tests_unknown)]
|
| if all_tests and num_tests_ran != len(all_tests):
|
| # Add the list of tests we failed to run.
|
| tests_failed_to_run = list(set(all_tests) - set(tests_passed) -
|
| set(tests_failed) - set(tests_crashed) -
|
| - set(tests_unknown))
|
| + set(tests_unknown) - set(tests_timed_out))
|
| summary += ['FAILED_TO_RUN=%d %s\n' % (len(tests_failed_to_run),
|
| tests_failed_to_run)]
|
| summary_string = ''.join(summary)
|
| @@ -275,7 +290,8 @@ class TestResults(object):
|
|
|
| def PrintAnnotation(self):
|
| """Print buildbot annotations for test results."""
|
| - if self.failed or self.crashed or self.overall_fail or self.timed_out:
|
| + if (self.failed or self.crashed or self.overall_fail or
|
| + self.overall_timed_out):
|
| buildbot_report.PrintError()
|
| else:
|
| print 'Step success!' # No annotation needed
|
|
|