Title: [91312] trunk/Tools
Revision
91312
Author
[email protected]
Date
2011-07-19 15:46:32 -0700 (Tue, 19 Jul 2011)

Log 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:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (91311 => 91312)


--- trunk/Tools/ChangeLog	2011-07-19 22:44:56 UTC (rev 91311)
+++ trunk/Tools/ChangeLog	2011-07-19 22:46:32 UTC (rev 91312)
@@ -1,3 +1,13 @@
+2011-07-19  Ojan Vafai  <[email protected]>
+
+        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:
+
 2011-07-19  Dimitri Glazkov  <[email protected]>
 
         Store line number on TestExpectationLine.

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


--- trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.html	2011-07-19 22:44:56 UTC (rev 91311)
+++ trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.html	2011-07-19 22:46:32 UTC (rev 91312)
@@ -320,15 +320,12 @@
 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/';
 
-// FIXME: Make this an array.
-var PLATFORMS = {
-    'SNOWLEOPARD': 'SNOWLEOPARD',
-    'LEOPARD': 'LEOPARD',
-    'XP': 'XP',
-    'VISTA': 'VISTA',
-    'WIN7': 'WIN7',
-    'LUCID': 'LUCID'
-};
+var PLATFORMS = ['SNOWLEOPARD', 'LEOPARD', 'XP', 'VISTA', 'WIN7', 'LUCID'];
+var PLATFORM_UNIONS = {
+    'MAC': ['LEOPARD', 'SNOWLEOPARD'],
+    'WIN': ['XP', 'VISTA', 'WIN7'],
+    'LINUX': ['LUCID']
+}
 
 // FIXME: Make the g_allExpectations data structure explicitly list every platform instead of having a fallbacks concept.
 var PLATFORM_FALLBACKS = {
@@ -711,11 +708,10 @@
 }
 
 // Map of all tests to true values by platform and build type.
-// e.g. g_allTestsByPlatformAndBuildType['WIN']['DEBUG'] will have the union
-// of all tests run on the win-debug builders.
+// e.g. g_allTestsByPlatformAndBuildType['XP']['DEBUG'] will have the union
+// of all tests run on the xp-debug builders.
 var g_allTestsByPlatformAndBuildType = {};
-for (var platform in PLATFORMS)
-    g_allTestsByPlatformAndBuildType[platform] = {};
+PLATFORMS.forEach(function(platform) { g_allTestsByPlatformAndBuildType[platform] = {}; });
 
 // Map of all tests to true values by platform and build type.
 // e.g. g_allTestsByPlatformAndBuildType['WIN']['DEBUG'] will have the union
@@ -1688,18 +1684,13 @@
 // are for real result changes, like SLOW, and excludes modifiers
 // that specificy things like platform, build_type, bug.
 // @param {string} modifierString String containing all modifiers.
-// @return {string} String containing only modifiers that effect
-//     the results.
+// @return {string} String containing only modifiers that effect the results.
 function realModifiers(modifierString)
 {
-    var newModifiers = [];
     var modifiers = modifierString.split(' ');;
-    for (var j = 0; j < modifiers.length; j++) {
-        var modifier = modifiers[j];
-        if (!(modifier in BUILD_TYPES) && !(modifier in PLATFORMS) && !startsWith(modifier, 'BUG'))
-            newModifiers.push(modifier);
-    }
-    return newModifiers.join(' ');
+    return modifiers.filter(function(modifier) {
+        return !(modifier in BUILD_TYPES) && PLATFORMS.indexOf(modifier) == -1 && !(modifier in PLATFORM_UNIONS) && !startsWith(modifier, 'BUG');
+    }).join(' ');
 }
 
 function generatePageForExpectationsUpdate()

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


--- trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_tests.js	2011-07-19 22:44:56 UTC (rev 91311)
+++ trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_tests.js	2011-07-19 22:46:32 UTC (rev 91312)
@@ -212,6 +212,22 @@
     runPlatformAndBuildTypeTest('XP Tests', 'XP', 'RELEASE');
 }
 
+function testRealModifiers()
+{
+    assertEquals(realModifiers('BUGFOO LINUX LEOPARD WIN DEBUG SLOW'), 'SLOW');
+    assertEquals(realModifiers('BUGFOO LUCID MAC XP RELEASE SKIP'), 'SKIP');
+    assertEquals(realModifiers('BUGFOO'), '');
+}
+
+function testAllTestsWithSamePlatformAndBuildType()
+{
+    // FIXME: test that allTestsWithSamePlatformAndBuildType actually returns the right set of tests.
+    for (var i = 0; i < PLATFORMS.length; i++) {
+        if (!g_allTestsByPlatformAndBuildType[PLATFORMS[i]])
+            throw Error(PLATFORMS[i] + ' is not in g_allTestsByPlatformAndBuildType');
+    }
+}
+
 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