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

Unified Diff: tools/testrunner/local/progress.py

Issue 1070753003: [test-runner] Pass slowest test durations to buildbot. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testrunner/local/progress.py
diff --git a/tools/testrunner/local/progress.py b/tools/testrunner/local/progress.py
index f47fa3af84848d08cdf4c31be49cae3f2ac22d5d..421f9417a5646a803c2e4ce5593c4150398351d5 100644
--- a/tools/testrunner/local/progress.py
+++ b/tools/testrunner/local/progress.py
@@ -298,6 +298,7 @@ class JsonTestProgressIndicator(ProgressIndicator):
self.arch = arch
self.mode = mode
self.results = []
+ self.tests = []
def Starting(self):
self.progress_indicator.runner = self.runner
@@ -311,10 +312,24 @@ class JsonTestProgressIndicator(ProgressIndicator):
# Buildbot might start out with an empty file.
complete_results = json.loads(f.read() or "[]")
+ # Sort tests by duration.
+ timed_tests = [t for t in self.tests if t.duration is not None]
+ timed_tests.sort(lambda a, b: cmp(b.duration, a.duration))
+ slowest_tests = [
+ {
+ "name": test.GetLabel(),
+ "flags": test.flags,
+ "command": EscapeCommand(self.runner.GetCommand(test)).replace(
+ ABS_PATH_PREFIX, ""),
+ "duration": test.duration,
+ } for test in timed_tests[:20]
+ ]
+
complete_results.append({
"arch": self.arch,
"mode": self.mode,
"results": self.results,
+ "slowest_tests": slowest_tests,
})
with open(self.json_test_results, "w") as f:
@@ -325,6 +340,8 @@ class JsonTestProgressIndicator(ProgressIndicator):
def HasRun(self, test, has_unexpected_output):
self.progress_indicator.HasRun(test, has_unexpected_output)
+ # Buffer all tests for sorting the durations in the end.
+ self.tests.append(test)
if not has_unexpected_output:
# Omit tests that run as expected. Passing tests of reruns after failures
# will have unexpected_output to be reported here has well.
@@ -341,6 +358,7 @@ class JsonTestProgressIndicator(ProgressIndicator):
"exit_code": test.output.exit_code,
"result": test.suite.GetOutcome(test),
"expected": list(test.outcomes or ["PASS"]),
+ "duration": test.duration,
})
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698