Title: [91541] trunk/Tools
Revision
91541
Author
[email protected]
Date
2011-07-21 17:48:07 -0700 (Thu, 21 Jul 2011)

Log Message

simplify gtest display now that we strip modifiers from the JSON
https://bugs.webkit.org/show_bug.cgi?id=64990

Reviewed by Adam Barth.

Now that names are normalized, we can remove all the code that
handles gtest name changes (e.g. for adding modifiers like DISABLED_).
Instead, if you try to list a test with a modifier in it, we need
to strip the modifier so we get the normalized value.

We also get rid of the concept of extra/missing expectations for gtests.
In a patch soon, we'll stop showing extra/missing expectations from the UI
entirely and only leave it for the special updating test_expectations.txt
view of the dashboard, which doesn't apply to gtests.

* TestResultServer/static-dashboards/flakiness_dashboard.html:
* TestResultServer/static-dashboards/flakiness_dashboard_tests.js:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (91540 => 91541)


--- trunk/Tools/ChangeLog	2011-07-22 00:40:30 UTC (rev 91540)
+++ trunk/Tools/ChangeLog	2011-07-22 00:48:07 UTC (rev 91541)
@@ -1,3 +1,23 @@
+2011-07-21  Ojan Vafai  <[email protected]>
+
+        simplify gtest display now that we strip modifiers from the JSON
+        https://bugs.webkit.org/show_bug.cgi?id=64990
+
+        Reviewed by Adam Barth.
+
+        Now that names are normalized, we can remove all the code that
+        handles gtest name changes (e.g. for adding modifiers like DISABLED_).
+        Instead, if you try to list a test with a modifier in it, we need
+        to strip the modifier so we get the normalized value.
+
+        We also get rid of the concept of extra/missing expectations for gtests.
+        In a patch soon, we'll stop showing extra/missing expectations from the UI
+        entirely and only leave it for the special updating test_expectations.txt
+        view of the dashboard, which doesn't apply to gtests.
+
+        * TestResultServer/static-dashboards/flakiness_dashboard.html:
+        * TestResultServer/static-dashboards/flakiness_dashboard_tests.js:
+
 2011-07-21  Adam Barth  <[email protected]>
 
         Refactor Trac.js for use in garden-o-matic

Modified: trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.html (91540 => 91541)


--- trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.html	2011-07-22 00:40:30 UTC (rev 91540)
+++ trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.html	2011-07-22 00:48:07 UTC (rev 91541)
@@ -314,8 +314,7 @@
 var ALL = 'ALL';
 var FORWARD = 'forward';
 var BACKWARD = 'backward';
-var GTEST_FLAKY_MARKER = '\.FLAKY_';
-var GTEST_FAILS_MARKER = '\.FAILS_';
+var GTEST_MODIFIERS = ['FLAKY', 'FAILS', 'MAYBE', 'DISABLED'];
 var TEST_URL_BASE_PATH_TRAC = 'http://trac.webkit.org/browser/trunk/LayoutTests/';
 var TEST_URL_BASE_PATH = "http://svn.webkit.org/repository/webkit/trunk/LayoutTests/";
 var TEST_RESULTS_BASE_PATH = 'http://build.chromium.org/f/chromium/layout_test_results/';
@@ -611,29 +610,30 @@
     return individualTestsForSubstringList();
 }
 
-function individualTestsForSubstringList()
+function substringList()
 {
     // Convert windows slashes to unix slashes.
     var tests = g_currentState.tests.replace(/\\/g, '/');
     var separator = stringContains(tests, ' ') ? ' ' : ',';
     var testList = tests.split(separator);
 
-    if (!isLayoutTestResults()) {
-        testList.forEach(function(element) {
-            // Make sure to search for the flaky/fails and non-flaky/non-fails
-            // names for a test.
-            // e.g. for test Foo.Bar, also search for Foo.FLAKY_Bar.
-            if (stringContains(element, GTEST_FLAKY_MARKER))
-                testList.push(element.replace(GTEST_FLAKY_MARKER, '.'));
-            else if (stringContains(element, GTEST_FAILS_MARKER))
-                testList.push(element.replace(GTEST_FAILS_MARKER, '.'));
-            else {
-                testList.push(element.replace('.', GTEST_FLAKY_MARKER));
-                testList.push(element.replace('.', GTEST_FAILS_MARKER));
-            }
+    if (isLayoutTestResults())
+        return testList;
+
+    var testListWithoutModifiers = [];
+    testList.forEach(function(path) {
+        GTEST_MODIFIERS.forEach(function(modifier) {
+            path = path.replace('.' + modifier + '_', '.');
         });
-    }
+        testListWithoutModifiers.push(path);
+    });
+    return testListWithoutModifiers;
+}
 
+function individualTestsForSubstringList()
+{
+    var testList = substringList();
+
     // Put the tests into an object first and then move them into an array
     // as a way of deduping.
     var testsMap = {};
@@ -1161,12 +1161,6 @@
                 extraExpectations.push('PASS');
         }
 
-    } else {
-        var isMarkedFlaky = stringContains(resultsForTest.test, GTEST_FLAKY_MARKER);
-        if (resultsForTest.isFlaky && !isMarkedFlaky)
-            missingExpectations.push('FLAKY');
-        else if (!resultsForTest.isFlaky && isMarkedFlaky)
-            extraExpectations.push('FLAKY');
     }
 
     resultsForTest.meetsExpectations = !missingExpectations.length && !extraExpectations.length;
@@ -1553,19 +1547,6 @@
         var a = a[column] ? String(a[column]) : 'z';
         var b = b[column] ? String(b[column]) : 'z';
 
-        // For gtest tests, we make them as flaky/failing by prefixing the
-        // test name with FLAKY_ or FAILS_, resulting in three possible entries
-        // for the test.
-        // Place flaky/fails tests next to their non-flaky counterparts.
-        // FIXME: Merge the non-flaky/non-fails test with the flaky/fails
-        // one so there's only a single entry per test.
-        if (!isLayoutTestResults()) {
-            a = a.replace(GTEST_FLAKY_MARKER, '.');
-            b = b.replace(GTEST_FLAKY_MARKER, '.');
-            a = a.replace(GTEST_FAILS_MARKER, '.');
-            b = b.replace(GTEST_FAILS_MARKER, '.');
-        }
-
         if (a < b)
             return -1;
         else if (a == b)
@@ -2181,6 +2162,8 @@
     container.innerHTML = '<div><b>' + builder + '</b></div>';
     expectationsContainer.appendChild(container);
     for (var i = 0; i < failures.length; i++) {
+        // FIXME: This doesn't seem to work anymore. Did the paths change?
+        // Once that's resolved, see if we need to try each GTEST_MODIFIERS prefix as well.
         var pathToLog = builderMaster(builder).getLogPath(builder, failures[i]) + pathToFailureLog(test);
         appendNonWebKitResults(container, pathToLog);
     }

Modified: trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_tests.js (91540 => 91541)


--- trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_tests.js	2011-07-22 00:40:30 UTC (rev 91540)
+++ trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_tests.js	2011-07-22 00:48:07 UTC (rev 91541)
@@ -302,6 +302,18 @@
     assertEquals(JSON.stringify(expectations), '{"modifiers":"MAC LINUX XP VISTA","expectations":"FAIL"}');
 }
 
+function testSubstringList()
+{
+    g_currentState.testType = 'gtest';
+    g_currentState.tests = 'test.FLAKY_foo test.FAILS_foo1 test.DISABLED_foo2 test.MAYBE_foo3 test.foo4';
+    assertEquals(substringList().toString(), 'test.foo,test.foo1,test.foo2,test.foo3,test.foo4');
+
+    g_currentState.testType = 'layout-tests';
+    g_currentState.tests = 'foo/bar.FLAKY_foo.html';
+    assertEquals(substringList().toString(), 'foo/bar.FLAKY_foo.html');
+
+}
+
 function runTests()
 {
     document.body.innerHTML = '<pre id=unittest-results></pre>';
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to