def PrintTestResults(results): """Prints the given results in a format recognized by the buildbot.""" # If no results that means something went wrong and # we should return non zero value if len(results) == 0: print 'No tests were run' return 1 failures = [] failure_names = [] for result in results: if not result.IsPass(): failures += [result] failure_names += ['.'.join(result.GetName().split('.')[-2:])] print 'Ran %s tests' % len(results) print 'Failed %s:' % len(failures) util.AddBuildStepText('failed %s/%s' % (len(failures), len(results))) for result in failures: print '=' * 80 print '=' * 10, result.GetName(), '(%ss)' % result.GetTime() print result.GetFailureMessage() if len(failures) < 10: util.AddBuildStepText('.'.join(result.GetName().split('.')[-2:])) print 'Rerun failing tests with filter:', ':'.join(failure_names) return len(failures)
def PrintResult(build, result): mean = sum(result) / len(result) avg_dev = sum([abs(sample - mean) for sample in result]) / len(result) print 'perf result', build, name, mean, avg_dev, result util.AddBuildStepText('%s %s: %.3f+-%.3f' % (build, name, mean, avg_dev))
def DownloadChrome(version_name, revision, download_site): util.MarkBuildStepStart('download %s' % version_name) try: temp_dir = util.MakeTempDir() return (temp_dir, archive.DownloadChrome(revision, temp_dir, download_site)) except Exception: traceback.print_exc() util.AddBuildStepText('Skip Java and Python tests') util.MarkBuildStepError() return (None, None)