Changeset 91312 in webkit


Ignore:
Timestamp:
Jul 19, 2011 3:46:32 PM (13 years ago)
Author:
ojan@chromium.org
Message:

cleanup some of the PLATFORM logic in the flakiness dashboard
https://bugs.webkit.org/show_bug.cgi?id=64821

Reviewed by Adam Barth.

  • 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

    r91311 r91312  
     12011-07-19  Ojan Vafai  <ojan@chromium.org>
     2
     3        cleanup some of the PLATFORM logic in the flakiness dashboard
     4        https://bugs.webkit.org/show_bug.cgi?id=64821
     5
     6        Reviewed by Adam Barth.
     7
     8        * TestResultServer/static-dashboards/flakiness_dashboard.html:
     9        * TestResultServer/static-dashboards/flakiness_dashboard_tests.js:
     10
    1112011-07-19  Dimitri Glazkov  <dglazkov@chromium.org>
    212
  • trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.html

    r91304 r91312  
    321321var TEST_RESULTS_BASE_PATH = 'http://build.chromium.org/f/chromium/layout_test_results/';
    322322
    323 // FIXME: Make this an array.
    324 var PLATFORMS = {
    325     'SNOWLEOPARD': 'SNOWLEOPARD',
    326     'LEOPARD': 'LEOPARD',
    327     'XP': 'XP',
    328     'VISTA': 'VISTA',
    329     'WIN7': 'WIN7',
    330     'LUCID': 'LUCID'
    331 };
     323var PLATFORMS = ['SNOWLEOPARD', 'LEOPARD', 'XP', 'VISTA', 'WIN7', 'LUCID'];
     324var PLATFORM_UNIONS = {
     325    'MAC': ['LEOPARD', 'SNOWLEOPARD'],
     326    'WIN': ['XP', 'VISTA', 'WIN7'],
     327    'LINUX': ['LUCID']
     328}
    332329
    333330// FIXME: Make the g_allExpectations data structure explicitly list every platform instead of having a fallbacks concept.
     
    712709
    713710// Map of all tests to true values by platform and build type.
    714 // e.g. g_allTestsByPlatformAndBuildType['WIN']['DEBUG'] will have the union
    715 // of all tests run on the win-debug builders.
     711// e.g. g_allTestsByPlatformAndBuildType['XP']['DEBUG'] will have the union
     712// of all tests run on the xp-debug builders.
    716713var g_allTestsByPlatformAndBuildType = {};
    717 for (var platform in PLATFORMS)
    718     g_allTestsByPlatformAndBuildType[platform] = {};
     714PLATFORMS.forEach(function(platform) { g_allTestsByPlatformAndBuildType[platform] = {}; });
    719715
    720716// Map of all tests to true values by platform and build type.
     
    16891685// that specificy things like platform, build_type, bug.
    16901686// @param {string} modifierString String containing all modifiers.
    1691 // @return {string} String containing only modifiers that effect
    1692 //     the results.
     1687// @return {string} String containing only modifiers that effect the results.
    16931688function realModifiers(modifierString)
    16941689{
    1695     var newModifiers = [];
    16961690    var modifiers = modifierString.split(' ');;
    1697     for (var j = 0; j < modifiers.length; j++) {
    1698         var modifier = modifiers[j];
    1699         if (!(modifier in BUILD_TYPES) && !(modifier in PLATFORMS) && !startsWith(modifier, 'BUG'))
    1700             newModifiers.push(modifier);
    1701     }
    1702     return newModifiers.join(' ');
     1691    return modifiers.filter(function(modifier) {
     1692        return !(modifier in BUILD_TYPES) && PLATFORMS.indexOf(modifier) == -1 && !(modifier in PLATFORM_UNIONS) && !startsWith(modifier, 'BUG');
     1693    }).join(' ');
    17031694}
    17041695
  • trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_tests.js

    r91304 r91312  
    213213}
    214214
     215function testRealModifiers()
     216{
     217    assertEquals(realModifiers('BUGFOO LINUX LEOPARD WIN DEBUG SLOW'), 'SLOW');
     218    assertEquals(realModifiers('BUGFOO LUCID MAC XP RELEASE SKIP'), 'SKIP');
     219    assertEquals(realModifiers('BUGFOO'), '');
     220}
     221
     222function testAllTestsWithSamePlatformAndBuildType()
     223{
     224    // FIXME: test that allTestsWithSamePlatformAndBuildType actually returns the right set of tests.
     225    for (var i = 0; i < PLATFORMS.length; i++) {
     226        if (!g_allTestsByPlatformAndBuildType[PLATFORMS[i]])
     227            throw Error(PLATFORMS[i] + ' is not in g_allTestsByPlatformAndBuildType');
     228    }
     229}
     230
    215231function runTests()
    216232{
Note: See TracChangeset for help on using the changeset viewer.