Changeset 129079 in webkit
- Timestamp:
- Sep 19, 2012 5:59:24 PM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r129073 r129079 1 2012-09-19 Dirk Pranke <dpranke@chromium.org> 2 3 update flakiness dashboard after cutover to new test expectations syntax 4 https://bugs.webkit.org/show_bug.cgi?id=97152 5 6 Reviewed by Ryosuke Niwa. 7 8 This change clones the TestExpectation parsing state machine 9 from python into javascript. 10 11 * TestResultServer/static-dashboards/flakiness_dashboard.js: 12 (parsedExpectations.lines.forEach): 13 (parsedExpectations): 14 * TestResultServer/static-dashboards/flakiness_dashboard_unittests.js: 15 1 16 2012-09-19 Dana Jansens <danakj@chromium.org> 2 17 -
trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.js
r128321 r129079 589 589 lines.forEach(function(line) { 590 590 line = trimString(line); 591 if (!line || startsWith(line, ' //'))591 if (!line || startsWith(line, '#')) 592 592 return; 593 593 594 // FIXME: Make this robust against not having modifiers and/or expectations. 595 // Right now, run-webkit-tests doesn't allow such lines, but it may in the future. 596 var match = line.match(/([^:]+)*:([^=]+)=(.*)/); 597 if (!match) { 598 console.error('Line could not be parsed: ' + line); 599 return; 594 // This code mimics _tokenize_line_using_new_format() in 595 // Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py 596 // 597 // FIXME: consider doing more error checking here. 598 // 599 // FIXME: Clean this all up once we've fully cut over to the new syntax. 600 var tokens = line.split(/\s+/) 601 var parsed_bugs = []; 602 var parsed_modifiers = []; 603 var parsed_path; 604 var parsed_expectations = []; 605 var state = 'start'; 606 607 // This clones _configuration_tokens_list in test_expectations.py. 608 // FIXME: unify with the platforms constants at the top of the file. 609 var configuration_tokens = { 610 'Release': 'RELEASE', 611 'Debug': 'DEBUG', 612 'Mac': 'MAC', 613 'Win': 'Win', 614 'Linux': 'LINUX', 615 'SnowLeopard': 'SNOWLEOPARD', 616 'Lion': 'LION', 617 'MountainLion': 'MOUNTAINLION', 618 'Win7': 'WIN7', 619 'XP': 'XP', 620 'Vista': 'VISTA', 621 'Android': 'ANDROID', 622 }; 623 624 var expectation_tokens = { 625 'Crash': 'CRASH', 626 'Failure': 'FAIL', 627 'ImageOnlyFailure': 'IMAGE', 628 'Missing': 'MISSING', 629 'Pass': 'PASS', 630 'Rebaseline': 'REBASELINE', 631 'Skip': 'SKIP', 632 'Slow': 'SLOW', 633 'Timeout': 'TIMEOUT', 634 'WontFix': 'WONTFIX', 635 }; 636 637 638 tokens.forEach(function(token) { 639 if (token.indexOf('Bug') != -1 || 640 token.indexOf('webkit.org') != -1 || 641 token.indexOf('crbug.com') != -1 || 642 token.indexOf('code.google.com') != -1) { 643 parsed_bugs.push(token); 644 } else if (token == '[') { 645 if (state == 'start') { 646 state = 'configuration'; 647 } else if (state == 'name_found') { 648 state = 'expectations'; 649 } 650 } else if (token == ']') { 651 if (state == 'configuration') { 652 state = 'name'; 653 } else if (state == 'expectations') { 654 state = 'done'; 655 } 656 } else if (state == 'configuration') { 657 parsed_modifiers.push(configuration_tokens[token]); 658 } else if (state == 'expectations') { 659 if (token == 'Rebaseline' || token == 'Skip' || token == 'Slow' || token == 'WontFix') { 660 parsed_modifiers.push(token.toUpperCase()); 661 } else { 662 parsed_expectations.push(expectation_tokens[token]); 663 } 664 } else if (token == '#') { 665 state = 'done'; 666 } else if (state == 'name' || state == 'start') { 667 parsed_path = token; 668 state = 'name_found'; 669 } 670 }); 671 672 if (!parsed_expectations.length) { 673 if (parsed_modifiers.indexOf('Slow') == -1) { 674 parsed_modifiers.push('Skip'); 675 parsed_expectations = ['Pass']; 676 } 600 677 } 601 678 602 679 // FIXME: Should we include line number and comment lines here? 603 680 expectations.push({ 604 modifiers: trimString(match[1]),605 path: trimString(match[2]),606 expectations: trimString(match[3])681 modifiers: parsed_bugs.concat(parsed_modifiers).join(' '), 682 path: parsed_path, 683 expectations: parsed_expectations.join(' '), 607 684 }); 608 685 }); -
trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard_unittests.js
r128321 r129079 85 85 {'modifiers': 'RELEASE', 'expectations': 'FAIL'} 86 86 ]; 87 g_expectations = ' RELEASE : ' + test + ' = FAIL';87 g_expectations = '[ Release ] ' + test + ' [ Failure ]'; 88 88 runExpectationsTest(builder, test, 'FAIL', 'RELEASE'); 89 89 }); … … 97 97 {'modifiers': 'DEBUG', 'expectations': 'CRASH'} 98 98 ]; 99 g_expectations = ' RELEASE : ' + test + ' = FAIL\n' +100 ' DEBUG : ' + test + ' = CRASH';99 g_expectations = '[ Release ] ' + test + ' [ Failure ]\n' + 100 '[ Debug ] ' + test + ' [ Crash ]'; 101 101 runExpectationsTest(builder, test, 'FAIL', 'RELEASE'); 102 102 }); … … 110 110 {'modifiers': 'DEBUG', 'expectations': 'CRASH'} 111 111 ]; 112 g_expectations = ' RELEASE : ' + test + ' = FAIL\n' +113 ' DEBUG : ' + test + ' = CRASH';112 g_expectations = '[ Release ] ' + test + ' [ Failure ]\n' + 113 '[ Debug ] ' + test + ' [ Crash ]'; 114 114 runExpectationsTest(builder, test, 'CRASH', 'DEBUG'); 115 115 }); … … 118 118 resetGlobals(); 119 119 var test = 'bar/1.html'; 120 g_expectations = ' WONTFIX : bar = FAIL PASS TIMEOUT\n' +121 ' WONTFIX MAC : ' + test + ' = FAIL\n' +122 ' LINUX DEBUG : ' + test + ' = CRASH';120 g_expectations = 'bar [ WontFix Failure Pass Timeout ]\n' + 121 '[ Mac ] ' + test + ' [ WontFix Failure ]\n' + 122 '[ Linux Debug ] ' + test + ' [ Crash ]'; 123 123 124 124 runExpectationsTest('Webkit Win', test, 'FAIL PASS TIMEOUT', 'WONTFIX'); … … 126 126 runExpectationsTest('Webkit Linux', test, 'FAIL PASS TIMEOUT', 'WONTFIX'); 127 127 runExpectationsTest('Webkit Linux (dbg)(3)', test, 'CRASH', 'LINUX DEBUG'); 128 runExpectationsTest('Webkit Mac10.7', test, 'FAIL', ' WONTFIX MAC');129 runExpectationsTest('Webkit Mac10.7 (dbg)(3)', test, 'FAIL', ' WONTFIX MAC');128 runExpectationsTest('Webkit Mac10.7', test, 'FAIL', 'MAC WONTFIX'); 129 runExpectationsTest('Webkit Mac10.7 (dbg)(3)', test, 'FAIL', 'MAC WONTFIX'); 130 130 }); 131 131 … … 186 186 187 187 test('realModifiers', 3, function() { 188 equal(realModifiers('BUG FOOLINUX LION WIN DEBUG SLOW'), 'SLOW');189 equal(realModifiers('BUG FOOLUCID MAC XP RELEASE SKIP'), 'SKIP');190 equal(realModifiers('BUG FOO'), '');188 equal(realModifiers('BUG(Foo) LINUX LION WIN DEBUG SLOW'), 'SLOW'); 189 equal(realModifiers('BUG(Foo) LUCID MAC XP RELEASE SKIP'), 'SKIP'); 190 equal(realModifiers('BUG(Foo)'), ''); 191 191 }); 192 192 … … 220 220 } 221 221 222 g_expectations = 'B UG123 : foo = FAIL PASS CRASH\n' +223 ' RELEASE BUGFOO : foo/test1.html = FAIL\n' +224 ' DEBUG : foo/test1.html = CRASH\n' +225 'B UG456 : foo/test2.html = FAIL\n' +226 ' LINUX DEBUG : foo/test2.html = CRASH\n' +227 ' RELEASE : test1.html = FAIL\n' +228 ' DEBUG : test1.html = CRASH\n' +229 ' WIN7 : http/tests/appcache/interrupted-update.html = TIMEOUT\n' +230 ' MAC LINUX XP : http/tests/appcache/interrupted-update.html = FAIL\n';222 g_expectations = 'Bug(123) foo [ Failure Pass Crash ]\n' + 223 'Bug(Foo) [ Release ] foo/test1.html [ Failure ]\n' + 224 '[ Debug ] foo/test1.html [ Crash ]\n' + 225 'Bug(456) foo/test2.html [ Failure ]\n' + 226 '[ Linux Debug ] foo/test2.html [ Crash ]\n' + 227 '[ Release ] test1.html [ Failure ]\n' + 228 '[ Debug ] test1.html [ Crash ]\n' + 229 '[ Win7 ] http/tests/appcache/interrupted-update.html [ Timeout ]\n' + 230 '[ Mac Linux XP ] http/tests/appcache/interrupted-update.html [ Failure ]\n'; 231 231 232 232 processExpectations(); … … 236 236 237 237 var expectations = getExpectations('foo/test1.html', 'LUCID', 'RELEASE'); 238 equal(JSON.stringify(expectations), '{"modifiers":" RELEASE BUGFOO","expectations":"FAIL"}');238 equal(JSON.stringify(expectations), '{"modifiers":"Bug(Foo) RELEASE","expectations":"FAIL"}'); 239 239 240 240 var expectations = getExpectations('foo/test2.html', 'LUCID', 'RELEASE'); 241 equal(JSON.stringify(expectations), '{"modifiers":"B UG456","expectations":"FAIL"}');241 equal(JSON.stringify(expectations), '{"modifiers":"Bug(456)","expectations":"FAIL"}'); 242 242 243 243 var expectations = getExpectations('foo/test2.html', 'LION', 'DEBUG'); 244 equal(JSON.stringify(expectations), '{"modifiers":"B UG456","expectations":"FAIL"}');244 equal(JSON.stringify(expectations), '{"modifiers":"Bug(456)","expectations":"FAIL"}'); 245 245 246 246 var expectations = getExpectations('foo/test2.html', 'LUCID', 'DEBUG'); … … 248 248 249 249 var expectations = getExpectations('foo/test3.html', 'LUCID', 'DEBUG'); 250 equal(JSON.stringify(expectations), '{"modifiers":"B UG123","expectations":"FAIL PASS CRASH"}');250 equal(JSON.stringify(expectations), '{"modifiers":"Bug(123)","expectations":"FAIL PASS CRASH"}'); 251 251 252 252 var expectations = getExpectations('test1.html', 'XP', 'DEBUG');
Note: See TracChangeset
for help on using the changeset viewer.