Show the test name in the dashboard if showChrome==false and we're showing multiple...
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 May 2012 22:34:55 +0000 (22:34 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 May 2012 22:34:55 +0000 (22:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=85243

Reviewed by Dirk Pranke.

This happens for cases where a test name matches multiple tests.
In practice, this only happens for virtual test suites (e.g. the canvas tests).

* TestResultServer/static-dashboards/flakiness_dashboard.js:
(htmlForIndividualTestOnAllBuildersWithChrome):
* TestResultServer/static-dashboards/flakiness_dashboard_unittests.js:
(testHtmlForIndividualTestOnAllBuildersWithChromeNonexistant):
(testHtmlForIndividualTestOnAllBuildersWithChrome):
(testHtmlForIndividualTestOnAllBuildersWithChromeWebkitMaster):
(testHtmlForIndividualTests):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@116026 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/TestResultServer/static-dashboards/flakiness_dashboard.js
Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js

index 9ac729a..b0f984f 100644 (file)
@@ -1,5 +1,23 @@
 2012-05-03  Ojan Vafai  <ojan@chromium.org>
 
+        Show the test name in the dashboard if showChrome==false and we're showing multiple tests
+        https://bugs.webkit.org/show_bug.cgi?id=85243
+
+        Reviewed by Dirk Pranke.
+
+        This happens for cases where a test name matches multiple tests.
+        In practice, this only happens for virtual test suites (e.g. the canvas tests).
+
+        * TestResultServer/static-dashboards/flakiness_dashboard.js:
+        (htmlForIndividualTestOnAllBuildersWithChrome):
+        * TestResultServer/static-dashboards/flakiness_dashboard_unittests.js:
+        (testHtmlForIndividualTestOnAllBuildersWithChromeNonexistant):
+        (testHtmlForIndividualTestOnAllBuildersWithChrome):
+        (testHtmlForIndividualTestOnAllBuildersWithChromeWebkitMaster):
+        (testHtmlForIndividualTests):
+
+2012-05-03  Ojan Vafai  <ojan@chromium.org>
+
         Port the flakiness dashboard unittests to qunit
         https://bugs.webkit.org/show_bug.cgi?id=85544
 
index 3e4abe9..0c566db 100644 (file)
@@ -1571,14 +1571,6 @@ function htmlForIndividualTestOnAllBuildersWithChrome(test)
 
     var testResults = g_testToResultsMap[test];
     var html = '';
-    if (isLayoutTestResults()) {
-        var suite = lookupVirtualTestSuite(test);
-        var base = suite ? baseTest(test, suite) : test;
-        var tracURL = TEST_URL_BASE_PATH_TRAC + base;
-        html += '<h2>' + linkHTMLToOpenWindow(tracURL, test) + '</h2>';
-    } else
-        html += '<h2>' + test + '</h2>';
-
     html += htmlForIndividualTestOnAllBuilders(test);
 
     html += '<div class=expectations test=' + test + '><div>' +
@@ -2135,8 +2127,21 @@ function htmlForIndividualTests(tests)
 {
     var testsHTML = [];
     var htmlForTestFunction = g_currentState.showChrome ? htmlForIndividualTestOnAllBuildersWithChrome : htmlForIndividualTestOnAllBuilders;
-    for (var i = 0; i < tests.length; i++)
-        testsHTML.push(htmlForTestFunction(tests[i]));
+    for (var i = 0; i < tests.length; i++) {
+        var test = tests[i];
+        var testNameHtml = '';
+        if (g_currentState.showChrome || tests.length > 1) {
+            if (isLayoutTestResults()) {
+                var suite = lookupVirtualTestSuite(test);
+                var base = suite ? baseTest(test, suite) : test;
+                var tracURL = TEST_URL_BASE_PATH_TRAC + base;
+                testNameHtml += '<h2>' + linkHTMLToOpenWindow(tracURL, test) + '</h2>';
+            } else
+                testNameHtml += '<h2>' + test + '</h2>';
+        }
+
+        testsHTML.push(testNameHtml + htmlForTestFunction(test));
+    }
     return testsHTML.join('<hr>');
 }
 
index 785a9ce..f7a9d46 100644 (file)
@@ -343,7 +343,6 @@ test('HtmlForIndividualTestOnAllBuilders', 1, function() {
 test('HtmlForIndividualTestOnAllBuildersWithChromeNonexistant', 1, function() {
     resetGlobals();
     equal(htmlForIndividualTestOnAllBuildersWithChrome('foo/nonexistant.html'),
-        '<h2><a href="http://trac.webkit.org/browser/trunk/LayoutTests/foo/nonexistant.html" target="_blank">foo/nonexistant.html</a></h2>' +
         '<div class="not-found">Test not found. Either it does not exist, is skipped or passes on all platforms.</div>' +
         '<div class=expectations test=foo/nonexistant.html>' +
             '<div>' +
@@ -361,7 +360,6 @@ test('HtmlForIndividualTestOnAllBuildersWithChrome', 1, function() {
     g_testToResultsMap[test] = [createResultsObjectForTest(test, builderName)];
 
     equal(htmlForIndividualTestOnAllBuildersWithChrome(test),
-        '<h2><a href="http://trac.webkit.org/browser/trunk/LayoutTests/dummytest.html" target="_blank">dummytest.html</a></h2>' +
         '<table class=test-table><thead><tr>' +
                 '<th sortValue=test><div class=table-header-content><span></span><span class=header-text>test</span></div></th>' +
                 '<th sortValue=bugs><div class=table-header-content><span></span><span class=header-text>bugs</span></div></th>' +
@@ -395,44 +393,62 @@ test('HtmlForIndividualTestOnAllBuildersWithChromeWebkitMaster', 1, function() {
     g_testToResultsMap[test] = [createResultsObjectForTest(test, builderName)];
 
     equal(htmlForIndividualTestOnAllBuildersWithChrome(test),
-        '<h2><a href="http://trac.webkit.org/browser/trunk/LayoutTests/dummytest.html" target="_blank">dummytest.html</a></h2>' +
-            '<table class=test-table><thead><tr>' +
-                    '<th sortValue=test><div class=table-header-content><span></span><span class=header-text>test</span></div></th>' +
-                    '<th sortValue=bugs><div class=table-header-content><span></span><span class=header-text>bugs</span></div></th>' +
-                    '<th sortValue=modifiers><div class=table-header-content><span></span><span class=header-text>modifiers</span></div></th>' +
-                    '<th sortValue=expectations><div class=table-header-content><span></span><span class=header-text>expectations</span></div></th>' +
-                    '<th sortValue=slowest><div class=table-header-content><span></span><span class=header-text>slowest run</span></div></th>' +
-                    '<th sortValue=%><div class=table-header-content><span></span><span class=header-text>% fail</span></div></th>' +
-                    '<th sortValue=flakiness colspan=10000><div class=table-header-content><span></span><span class=header-text>flakiness (numbers are runtimes in seconds)</span></div></th>' +
-                '</tr></thead>' +
-                '<tbody></tbody>' +
-            '</table>' +
-            '<div>The following builders either don\'t run this test (e.g. it\'s skipped) or all runs passed:</div>' +
-            '<div class=skipped-builder-list>' +
-                '<div class=skipped-builder>Webkit Linux</div>' +
-                '<div class=skipped-builder>Webkit Linux (dbg)</div>' +
-                '<div class=skipped-builder>Webkit Mac10.5</div>' +
-                '<div class=skipped-builder>Webkit Win</div>' +
-            '</div>' +
-            '<div class=expectations test=dummytest.html>' +
-                '<div><span class=link onclick="setQueryParameter(\'showExpectations\', true)">Show results</span> | ' +
-                '<span class=link onclick="setQueryParameter(\'showLargeExpectations\', true)">Show large thumbnails</span>' +
-                '<form onsubmit="setQueryParameter(\'revision\', revision.value);return false;">' +
-                    'Show results for WebKit revision: <input name=revision placeholder="e.g. 65540" value="" id=revision-input>' +
-                '</form></div>' +
-            '</div>');
+        '<table class=test-table><thead><tr>' +
+                '<th sortValue=test><div class=table-header-content><span></span><span class=header-text>test</span></div></th>' +
+                '<th sortValue=bugs><div class=table-header-content><span></span><span class=header-text>bugs</span></div></th>' +
+                '<th sortValue=modifiers><div class=table-header-content><span></span><span class=header-text>modifiers</span></div></th>' +
+                '<th sortValue=expectations><div class=table-header-content><span></span><span class=header-text>expectations</span></div></th>' +
+                '<th sortValue=slowest><div class=table-header-content><span></span><span class=header-text>slowest run</span></div></th>' +
+                '<th sortValue=%><div class=table-header-content><span></span><span class=header-text>% fail</span></div></th>' +
+                '<th sortValue=flakiness colspan=10000><div class=table-header-content><span></span><span class=header-text>flakiness (numbers are runtimes in seconds)</span></div></th>' +
+            '</tr></thead>' +
+            '<tbody></tbody>' +
+        '</table>' +
+        '<div>The following builders either don\'t run this test (e.g. it\'s skipped) or all runs passed:</div>' +
+        '<div class=skipped-builder-list>' +
+            '<div class=skipped-builder>Webkit Linux</div>' +
+            '<div class=skipped-builder>Webkit Linux (dbg)</div>' +
+            '<div class=skipped-builder>Webkit Mac10.5</div>' +
+            '<div class=skipped-builder>Webkit Win</div>' +
+        '</div>' +
+        '<div class=expectations test=dummytest.html>' +
+            '<div><span class=link onclick="setQueryParameter(\'showExpectations\', true)">Show results</span> | ' +
+            '<span class=link onclick="setQueryParameter(\'showLargeExpectations\', true)">Show large thumbnails</span>' +
+            '<form onsubmit="setQueryParameter(\'revision\', revision.value);return false;">' +
+                'Show results for WebKit revision: <input name=revision placeholder="e.g. 65540" value="" id=revision-input>' +
+            '</form></div>' +
+        '</div>');
 });
 
-test('HtmlForIndividualTests', 2, function() {
+test('HtmlForIndividualTests', 4, function() {
     resetGlobals();
-    g_currentState.showChrome = false;
     var test1 = 'foo/nonexistant.html';
     var test2 = 'bar/nonexistant.html';
+
+    g_currentState.showChrome = false;
+
     var tests = [test1, test2];
-    equal(htmlForIndividualTests(tests), htmlForIndividualTestOnAllBuilders(test1) + '<hr>' + htmlForIndividualTestOnAllBuilders(test2));
+    equal(htmlForIndividualTests(tests),
+        '<h2><a href="http://trac.webkit.org/browser/trunk/LayoutTests/foo/nonexistant.html" target="_blank">foo/nonexistant.html</a></h2>' +
+        htmlForIndividualTestOnAllBuilders(test1) + '<hr>' +
+        '<h2><a href="http://trac.webkit.org/browser/trunk/LayoutTests/bar/nonexistant.html" target="_blank">bar/nonexistant.html</a></h2>' +
+        htmlForIndividualTestOnAllBuilders(test2));
+
+    tests = [test1];
+    equal(htmlForIndividualTests(tests), htmlForIndividualTestOnAllBuilders(test1));
 
     g_currentState.showChrome = true;
-    equal(htmlForIndividualTests(tests), htmlForIndividualTestOnAllBuildersWithChrome(test1) + '<hr>' + htmlForIndividualTestOnAllBuildersWithChrome(test2));
+
+    equal(htmlForIndividualTests(tests),
+        '<h2><a href="http://trac.webkit.org/browser/trunk/LayoutTests/foo/nonexistant.html" target="_blank">foo/nonexistant.html</a></h2>' +
+        htmlForIndividualTestOnAllBuildersWithChrome(test1));
+
+    tests = [test1, test2];
+    equal(htmlForIndividualTests(tests),
+        '<h2><a href="http://trac.webkit.org/browser/trunk/LayoutTests/foo/nonexistant.html" target="_blank">foo/nonexistant.html</a></h2>' +
+        htmlForIndividualTestOnAllBuildersWithChrome(test1) + '<hr>' +
+        '<h2><a href="http://trac.webkit.org/browser/trunk/LayoutTests/bar/nonexistant.html" target="_blank">bar/nonexistant.html</a></h2>' +
+        htmlForIndividualTestOnAllBuildersWithChrome(test2));
 });
 
 test('HtmlForSingleTestRow', 1, function() {