Changeset 91313 in webkit
- Timestamp:
- Jul 19, 2011 3:48:55 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r91312 r91313 1 2011-07-19 Ojan Vafai <ojan@chromium.org> 2 3 remove the concept of platform fallbacks 4 https://bugs.webkit.org/show_bug.cgi?id=64829 5 6 Reviewed by Adam Barth. 7 8 In the process, wrote tests for this code and fixed a pretty major 9 bug (now covered by the test). 10 11 * TestResultServer/static-dashboards/flakiness_dashboard.html: 12 * TestResultServer/static-dashboards/flakiness_dashboard_tests.js: 13 14 2011-07-19 Ojan Vafai <ojan@chromium.org> 15 16 cleanup some of the PLATFORM logic in the flakiness dashboard 17 https://bugs.webkit.org/show_bug.cgi?id=64821 18 19 Reviewed by Adam Barth. 20 21 * TestResultServer/static-dashboards/flakiness_dashboard.html: 22 * TestResultServer/static-dashboards/flakiness_dashboard_tests.js: 23 1 24 2011-07-19 Ojan Vafai <ojan@chromium.org> 2 25 -
trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.html
r91312 r91313 755 755 return null; 756 756 757 var platformObject; 758 while (platform && !(platformObject = testObject[platform])) 759 platform = PLATFORM_FALLBACKS[platform]; 760 761 if (platformObject) { 762 if (platformObject[buildType]) 763 return platformObject[buildType]; 764 765 if (platformObject[ALL]) 766 return platformObject[ALL]; 767 768 if (testObject[ALL]) { 769 var allPlatformObject = testObject[ALL]; 770 if (allPlatformObject[buildType]) 771 return allPlatformObject[buildType]; 772 773 if (allPlatformObject[ALL]) 774 return allPlatformObject[ALL]; 775 } 776 } 777 return null; 757 var platformObject = testObject[platform]; 758 if (!platformObject) 759 return null; 760 761 return platformObject[buildType]; 778 762 } 779 763 … … 840 824 } 841 825 842 function addFallbacks(callback, candidates, validValues)843 {844 var hasAnyValidValues = false;845 for (var i = 0; i < candidates.length; i++) {846 if (candidates[i] in validValues) {847 hasAnyValidValues = true;848 callback(candidates[i]);849 }850 }851 if (!hasAnyValidValues)852 callback(ALL);853 }854 855 826 function addTestToAllExpectations(test, expectations) 856 827 { 828 if (!g_allExpectations[test]) 829 g_allExpectations[test] = {}; 830 857 831 for (var j = 0; j < expectations.length; j++) { 858 832 var modifiers = expectations[j].modifiers.split(' '); 859 addFallbacks(function(platformKey) { 860 addFallbacks(function(buildTypeKey) { 861 // Setting the ALL key overrides any previously seen expectations. 862 if (platformKey == ALL && g_allExpectations[test]) { 863 for (var platform in PLATFORM_FALLBACKS) { 864 if (platform in g_allExpectations[test]) { 865 // Setting the ALL key overrides any previously seen 866 // expectations. 867 if (buildTypeKey == ALL) 868 g_allExpectations[test][platform] = {}; 869 } 870 } 871 } else if (buildTypeKey == ALL && g_allExpectations[test]) 872 g_allExpectations[test][platformKey] = {} 873 874 if (!g_allExpectations[test]) 875 g_allExpectations[test] = {}; 876 877 var testHolder = g_allExpectations[test]; 878 if (!testHolder[platformKey]) 879 testHolder[platformKey] = {} 880 881 testHolder[platformKey][buildTypeKey] = expectations[j]; 882 }, modifiers, BUILD_TYPES); 883 }, modifiers, PLATFORM_FALLBACKS); 833 var allPlatforms = []; 834 var allBuildTypes = []; 835 modifiers.forEach(function(modifier) { 836 if (modifier in BUILD_TYPES) { 837 allBuildTypes.push(modifier); 838 return; 839 } 840 841 if (PLATFORMS.indexOf(modifier) != -1) { 842 allPlatforms.push(modifier); 843 return; 844 } 845 846 if (modifier in PLATFORM_UNIONS) { 847 PLATFORM_UNIONS[modifier].forEach(function(platform) { 848 allPlatforms.push(platform); 849 }); 850 } 851 }) 852 853 if (!allPlatforms.length) 854 allPlatforms = PLATFORMS; 855 856 if (!allBuildTypes.length) 857 allBuildTypes = Object.keys(BUILD_TYPES); 858 859 allPlatforms.forEach(function(platform) { 860 if (!g_allExpectations[test][platform]) 861 g_allExpectations[test][platform] = {}; 862 863 allBuildTypes.forEach(function(buildType) { 864 g_allExpectations[test][platform][buildType] = expectations[j]; 865 }); 866 }); 884 867 } 885 868 } … … 908 891 909 892 // Sort the array to hit more specific paths last. More specific 910 // paths (e.g. foo/bar/baz.html) override entries for less-specific ones 911 // (e.g. foo/bar). 893 // paths (e.g. foo/bar/baz.html) override entries for less-specific ones (e.g. foo/bar). 912 894 expectationsArray.sort(alphanumericCompare('path')); 913 895 -
trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_tests.js
r91312 r91313 229 229 } 230 230 231 function testGetExpectations() 232 { 233 g_builders['WebKit Win'] = true; 234 g_resultsByBuilder = { 235 'WebKit Win': { 236 'tests': { 237 'foo/test1.html': {'results': [[100, 'F']], 'times': [[100, 0]]}, 238 'foo/test3.html': {'results': [[100, 'F']], 'times': [[100, 0]]}, 239 'test1.html': {'results': [[100, 'F']], 'times': [[100, 0]]} 240 } 241 } 242 } 243 244 g_expectationsByTest = { 245 'foo': [ 246 {'modifiers': '', 'expectations': 'FAIL PASS CRASH'} 247 ], 248 'foo/test1.html': [ 249 {'modifiers': 'RELEASE BUGFOO', 'expectations': 'FAIL'}, 250 {'modifiers': 'DEBUG', 'expectations': 'CRASH'} 251 ], 252 'foo/test2.html': [ 253 {'modifiers': '', 'expectations': 'FAIL'}, 254 {'modifiers': 'LINUX DEBUG', 'expectations': 'CRASH'} 255 ], 256 'test1.html': [ 257 {'modifiers': 'RELEASE', 'expectations': 'FAIL'}, 258 {'modifiers': 'DEBUG', 'expectations': 'CRASH'} 259 ], 260 'http/tests/appcache/interrupted-update.html': [ 261 {'modifiers': 'WIN7', 'expectations': 'TIMEOUT'}, 262 {'modifiers': 'MAC LINUX XP VISTA', 'expectations': 'FAIL'} 263 ] 264 } 265 266 processExpectations(); 267 268 var expectations = getExpectations('foo/test1.html', 'XP', 'DEBUG'); 269 assertEquals(JSON.stringify(expectations), '{"modifiers":"DEBUG","expectations":"CRASH"}'); 270 271 var expectations = getExpectations('foo/test1.html', 'LUCID', 'RELEASE'); 272 assertEquals(JSON.stringify(expectations), '{"modifiers":"RELEASE BUGFOO","expectations":"FAIL"}'); 273 274 var expectations = getExpectations('foo/test2.html', 'LUCID', 'RELEASE'); 275 assertEquals(JSON.stringify(expectations), '{"modifiers":"","expectations":"FAIL"}'); 276 277 var expectations = getExpectations('foo/test2.html', 'LEOPARD', 'DEBUG'); 278 assertEquals(JSON.stringify(expectations), '{"modifiers":"","expectations":"FAIL"}'); 279 280 var expectations = getExpectations('foo/test2.html', 'LUCID', 'DEBUG'); 281 assertEquals(JSON.stringify(expectations), '{"modifiers":"LINUX DEBUG","expectations":"CRASH"}'); 282 283 var expectations = getExpectations('foo/test3.html', 'LUCID', 'DEBUG'); 284 assertEquals(JSON.stringify(expectations), '{"modifiers":"","expectations":"FAIL PASS CRASH"}'); 285 286 var expectations = getExpectations('test1.html', 'XP', 'DEBUG'); 287 assertEquals(JSON.stringify(expectations), '{"modifiers":"DEBUG","expectations":"CRASH"}'); 288 289 var expectations = getExpectations('test1.html', 'LUCID', 'RELEASE'); 290 assertEquals(JSON.stringify(expectations), '{"modifiers":"RELEASE","expectations":"FAIL"}'); 291 292 var expectations = getExpectations('http/tests/appcache/interrupted-update.html', 'WIN7', 'RELEASE'); 293 assertEquals(JSON.stringify(expectations), '{"modifiers":"WIN7","expectations":"TIMEOUT"}'); 294 295 var expectations = getExpectations('http/tests/appcache/interrupted-update.html', 'LEOPARD', 'RELEASE'); 296 assertEquals(JSON.stringify(expectations), '{"modifiers":"MAC LINUX XP VISTA","expectations":"FAIL"}'); 297 298 var expectations = getExpectations('http/tests/appcache/interrupted-update.html', 'LUCID', 'RELEASE'); 299 assertEquals(JSON.stringify(expectations), '{"modifiers":"MAC LINUX XP VISTA","expectations":"FAIL"}'); 300 301 var expectations = getExpectations('http/tests/appcache/interrupted-update.html', 'VISTA', 'RELEASE'); 302 assertEquals(JSON.stringify(expectations), '{"modifiers":"MAC LINUX XP VISTA","expectations":"FAIL"}'); 303 } 304 231 305 function runTests() 232 306 {
Note: See TracChangeset
for help on using the changeset viewer.