Changeset 91541 in webkit


Ignore:
Timestamp:
Jul 21, 2011 5:48:07 PM (13 years ago)
Author:
ojan@chromium.org
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:
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r91538 r91541  
     12011-07-21  Ojan Vafai  <ojan@chromium.org>
     2
     3        simplify gtest display now that we strip modifiers from the JSON
     4        https://bugs.webkit.org/show_bug.cgi?id=64990
     5
     6        Reviewed by Adam Barth.
     7
     8        Now that names are normalized, we can remove all the code that
     9        handles gtest name changes (e.g. for adding modifiers like DISABLED_).
     10        Instead, if you try to list a test with a modifier in it, we need
     11        to strip the modifier so we get the normalized value.
     12
     13        We also get rid of the concept of extra/missing expectations for gtests.
     14        In a patch soon, we'll stop showing extra/missing expectations from the UI
     15        entirely and only leave it for the special updating test_expectations.txt
     16        view of the dashboard, which doesn't apply to gtests.
     17
     18        * TestResultServer/static-dashboards/flakiness_dashboard.html:
     19        * TestResultServer/static-dashboards/flakiness_dashboard_tests.js:
     20
    1212011-07-21  Adam Barth  <abarth@webkit.org>
    222
  • trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.html

    r91518 r91541  
    315315var FORWARD = 'forward';
    316316var BACKWARD = 'backward';
    317 var GTEST_FLAKY_MARKER = '\.FLAKY_';
    318 var GTEST_FAILS_MARKER = '\.FAILS_';
     317var GTEST_MODIFIERS = ['FLAKY', 'FAILS', 'MAYBE', 'DISABLED'];
    319318var TEST_URL_BASE_PATH_TRAC = 'http://trac.webkit.org/browser/trunk/LayoutTests/';
    320319var TEST_URL_BASE_PATH = "http://svn.webkit.org/repository/webkit/trunk/LayoutTests/";
     
    612611}
    613612
    614 function individualTestsForSubstringList()
     613function substringList()
    615614{
    616615    // Convert windows slashes to unix slashes.
     
    619618    var testList = tests.split(separator);
    620619
    621     if (!isLayoutTestResults()) {
    622         testList.forEach(function(element) {
    623             // Make sure to search for the flaky/fails and non-flaky/non-fails
    624             // names for a test.
    625             // e.g. for test Foo.Bar, also search for Foo.FLAKY_Bar.
    626             if (stringContains(element, GTEST_FLAKY_MARKER))
    627                 testList.push(element.replace(GTEST_FLAKY_MARKER, '.'));
    628             else if (stringContains(element, GTEST_FAILS_MARKER))
    629                 testList.push(element.replace(GTEST_FAILS_MARKER, '.'));
    630             else {
    631                 testList.push(element.replace('.', GTEST_FLAKY_MARKER));
    632                 testList.push(element.replace('.', GTEST_FAILS_MARKER));
    633             }
     620    if (isLayoutTestResults())
     621        return testList;
     622
     623    var testListWithoutModifiers = [];
     624    testList.forEach(function(path) {
     625        GTEST_MODIFIERS.forEach(function(modifier) {
     626            path = path.replace('.' + modifier + '_', '.');
    634627        });
    635     }
     628        testListWithoutModifiers.push(path);
     629    });
     630    return testListWithoutModifiers;
     631}
     632
     633function individualTestsForSubstringList()
     634{
     635    var testList = substringList();
    636636
    637637    // Put the tests into an object first and then move them into an array
     
    11621162        }
    11631163
    1164     } else {
    1165         var isMarkedFlaky = stringContains(resultsForTest.test, GTEST_FLAKY_MARKER);
    1166         if (resultsForTest.isFlaky && !isMarkedFlaky)
    1167             missingExpectations.push('FLAKY');
    1168         else if (!resultsForTest.isFlaky && isMarkedFlaky)
    1169             extraExpectations.push('FLAKY');
    11701164    }
    11711165
     
    15531547        var a = a[column] ? String(a[column]) : 'z';
    15541548        var b = b[column] ? String(b[column]) : 'z';
    1555 
    1556         // For gtest tests, we make them as flaky/failing by prefixing the
    1557         // test name with FLAKY_ or FAILS_, resulting in three possible entries
    1558         // for the test.
    1559         // Place flaky/fails tests next to their non-flaky counterparts.
    1560         // FIXME: Merge the non-flaky/non-fails test with the flaky/fails
    1561         // one so there's only a single entry per test.
    1562         if (!isLayoutTestResults()) {
    1563             a = a.replace(GTEST_FLAKY_MARKER, '.');
    1564             b = b.replace(GTEST_FLAKY_MARKER, '.');
    1565             a = a.replace(GTEST_FAILS_MARKER, '.');
    1566             b = b.replace(GTEST_FAILS_MARKER, '.');
    1567         }
    15681549
    15691550        if (a < b)
     
    21822163    expectationsContainer.appendChild(container);
    21832164    for (var i = 0; i < failures.length; i++) {
     2165        // FIXME: This doesn't seem to work anymore. Did the paths change?
     2166        // Once that's resolved, see if we need to try each GTEST_MODIFIERS prefix as well.
    21842167        var pathToLog = builderMaster(builder).getLogPath(builder, failures[i]) + pathToFailureLog(test);
    21852168        appendNonWebKitResults(container, pathToLog);
  • trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_tests.js

    r91313 r91541  
    303303}
    304304
     305function testSubstringList()
     306{
     307    g_currentState.testType = 'gtest';
     308    g_currentState.tests = 'test.FLAKY_foo test.FAILS_foo1 test.DISABLED_foo2 test.MAYBE_foo3 test.foo4';
     309    assertEquals(substringList().toString(), 'test.foo,test.foo1,test.foo2,test.foo3,test.foo4');
     310
     311    g_currentState.testType = 'layout-tests';
     312    g_currentState.tests = 'foo/bar.FLAKY_foo.html';
     313    assertEquals(substringList().toString(), 'foo/bar.FLAKY_foo.html');
     314
     315}
     316
    305317function runTests()
    306318{
Note: See TracChangeset for help on using the changeset viewer.