From: rniwa@webkit.org Date: Mon, 11 Sep 2017 19:26:00 +0000 (+0000) Subject: Analysis task page shows an empty results for an irrelevant top-level test X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=c832c46426588a442e890c45d55e2296c2be28f0 Analysis task page shows an empty results for an irrelevant top-level test https://bugs.webkit.org/show_bug.cgi?id=175252 Reviewed by Antti Koivisto. The bug was caused by TestGroupResultsViewer always listing every top-level test which has a result for the entire analysis task. Since a custom analysis task (perf try bots) allows multiple tests to be tested in each group, we have to only list the tests which contains results in a particular test group. * public/v3/components/test-group-results-viewer.js: (TestGroupResultsViewer.prototype.render): Find the tests that have results for the current test group instead of for any test group in this analysis task. any test * public/v3/models/analysis-results.js: (AnalysisResults): (AnalysisResults.prototype.topLevelTestsForTestGroup): Renamed from highestTests. Now takes a test group as an argument. (AnalysisResults.prototype._computedTopLevelTests): Renamed from _computeHighestTests. Filters the results with the specified test group. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221871 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Websites/perf.webkit.org/ChangeLog b/Websites/perf.webkit.org/ChangeLog index 72fc058..409ec28 100644 --- a/Websites/perf.webkit.org/ChangeLog +++ b/Websites/perf.webkit.org/ChangeLog @@ -1,3 +1,25 @@ +2017-09-11 Ryosuke Niwa + + Analysis task page shows an empty results for an irrelevant top-level test + https://bugs.webkit.org/show_bug.cgi?id=175252 + + Reviewed by Antti Koivisto. + + The bug was caused by TestGroupResultsViewer always listing every top-level test which has a result for the + entire analysis task. Since a custom analysis task (perf try bots) allows multiple tests to be tested in each + group, we have to only list the tests which contains results in a particular test group. + + * public/v3/components/test-group-results-viewer.js: + (TestGroupResultsViewer.prototype.render): Find the tests that have results for the current test group instead + of for any test group in this analysis task. + any test + * public/v3/models/analysis-results.js: + (AnalysisResults): + (AnalysisResults.prototype.topLevelTestsForTestGroup): Renamed from highestTests. Now takes a test group + as an argument. + (AnalysisResults.prototype._computedTopLevelTests): Renamed from _computeHighestTests. Filters the results + with the specified test group. + 2017-09-06 Aakash Jain Add initSyncers method in BuildbotTriggerable diff --git a/Websites/perf.webkit.org/public/v3/components/test-group-results-viewer.js b/Websites/perf.webkit.org/public/v3/components/test-group-results-viewer.js index 0d97db8..20c9607 100644 --- a/Websites/perf.webkit.org/public/v3/components/test-group-results-viewer.js +++ b/Websites/perf.webkit.org/public/v3/components/test-group-results-viewer.js @@ -38,8 +38,8 @@ class TestGroupResultsViewer extends ComponentBase { if (!this._testGroup || !this._analysisResults) return; - this._renderResultsTableLazily.evaluate(this._testGroup, this._expandedTests, ...this._analysisResults.highestTests()); - this._renderCurrentMetricsLazily.evaluate(this._currentMetric); + this._renderResultsTableLazily.evaluate(this._testGroup, this._expandedTests, + ...this._analysisResults.topLevelTestsForTestGroup(this._testGroup)); } _renderResultsTable(testGroup, expandedTests, ...tests) diff --git a/Websites/perf.webkit.org/public/v3/models/analysis-results.js b/Websites/perf.webkit.org/public/v3/models/analysis-results.js index 5104aa5..d048bee 100644 --- a/Websites/perf.webkit.org/public/v3/models/analysis-results.js +++ b/Websites/perf.webkit.org/public/v3/models/analysis-results.js @@ -4,7 +4,7 @@ class AnalysisResults { { this._metricToBuildMap = {}; this._metricIds = []; - this._lazilyComputedHighestTests = new LazilyEvaluatedFunction(this._computeHighestTests); + this._lazilyComputedTopLevelTests = new LazilyEvaluatedFunction(this._computedTopLevelTests.bind(this)); } findResult(buildId, metricId) @@ -15,7 +15,26 @@ class AnalysisResults { return map[buildId]; } - highestTests() { return this._lazilyComputedHighestTests.evaluate(this._metricIds); } + topLevelTestsForTestGroup(testGroup) + { + return this._lazilyComputedTopLevelTests.evaluate(testGroup, ...this._metricIds); + } + + _computedTopLevelTests(testGroup, ...metricIds) + { + const metrics = metricIds.map((metricId) => Metric.findById(metricId)); + const tests = new Set(metrics.map((metric) => metric.test())); + const topLevelMetrics = metrics.filter((metric) => !tests.has(metric.test().parentTest())); + + const topLevelTests = new Set; + for (const request of testGroup.buildRequests()) { + for (const metric of topLevelMetrics) { + if (this.findResult(request.buildId(), metric.id())) + topLevelTests.add(metric.test()); + } + } + return topLevelTests; + } containsTest(test) {