Commit 04c21931 authored by rniwa@webkit.org's avatar rniwa@webkit.org
Browse files

2011-06-10 Ryosuke Niwa <rniwa@webkit.org>

        Reviewed by Ojan Vafai.

        new-run-webkit-tests: results.html don't list the same list of failed tests as bots do
        https://bugs.webkit.org/show_bug.cgi?id=62425

        Fixed the bug by hiding expected crash, timeout, pass, etc... by default.

        * fast/harness/resources/results-test.js:
        * fast/harness/results-expected.txt:
        * fast/harness/results.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@88592 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0c78841f
2011-06-10 Ryosuke Niwa <rniwa@webkit.org>
Reviewed by Ojan Vafai.
new-run-webkit-tests: results.html don't list the same list of failed tests as bots do
https://bugs.webkit.org/show_bug.cgi?id=62425
Fixed the bug by hiding expected crash, timeout, pass, etc... by default.
* fast/harness/resources/results-test.js:
* fast/harness/results-expected.txt:
* fast/harness/results.html:
2011-06-10 Jer Noble <jer.noble@apple.com>
Reviewed by Darin Adler.
......
......@@ -432,6 +432,67 @@ function runTests()
assertTrue(document.querySelector('tbody td:nth-child(3)').textContent == 'expected actual diff ');
}, '{"toggle-images":false,"unexpected-results":false}');
function enclosingNodeWithTagNameHasClassName(node, tagName, className) {
while (node && (!node.tagName || node.localName != tagName))
node = node.parentNode;
if (!node)
return false;
return node.className == className;
}
results = mockResults();
var subtree = results.tests['foo'] = {}
subtree['expected-to-pass-but-crashed.html'] = mockExpectation('PASS', 'CRASH');
subtree['expected-to-pass-or-crash-and-crashed.html'] = mockExpectation('PASS CRASH', 'CRASH');
subtree['expected-to-pass-but-timeouted.html'] = mockExpectation('PASS', 'CRASH');
subtree['expected-to-pass-or-timeout-and-timeouted.html'] = mockExpectation('PASS TIMEOUT', 'TIMEOUT');
subtree['expected-fail-but-passed.html'] = mockExpectation('FAIL', 'PASS');
subtree['expected-pass-or-fail-and-passed.html'] = mockExpectation('PASS FAIL', 'PASS');
runTest(results, function() {
assertTrue(!document.getElementById('results-table'));
var testLinks = document.querySelectorAll('.test-link');
assertTrue(testLinks[0].innerText == 'foo/expected-to-pass-but-crashed.html');
assertTrue(!enclosingNodeWithTagNameHasClassName(testLinks[0], 'tbody', 'expected'));
assertTrue(testLinks[1].innerText == 'foo/expected-to-pass-or-crash-and-crashed.html');
assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[1], 'tbody', 'expected'));
assertTrue(!enclosingNodeWithTagNameHasClassName(testLinks[0], 'table', 'expected'));
assertTrue(testLinks[2].innerText == 'foo/expected-to-pass-but-timeouted.html');
assertTrue(!enclosingNodeWithTagNameHasClassName(testLinks[2], 'tbody', 'expected'));
assertTrue(testLinks[3].innerText == 'foo/expected-to-pass-or-timeout-and-timeouted.html');
assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[3], 'tbody', 'expected'));
assertTrue(!enclosingNodeWithTagNameHasClassName(testLinks[2], 'table', 'expected'));
assertTrue(testLinks[4].innerText == 'foo/expected-fail-but-passed.html');
assertTrue(!enclosingNodeWithTagNameHasClassName(testLinks[4], 'tbody', 'expected'));
assertTrue(testLinks[5].innerText == 'foo/expected-pass-or-fail-and-passed.html');
assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[5], 'tbody', 'expected'));
assertTrue(!enclosingNodeWithTagNameHasClassName(testLinks[4], 'table', 'expected'));
});
results = mockResults();
var subtree = results.tests['foo'] = {}
subtree['expected-to-pass-or-crash-and-crashed.html'] = mockExpectation('PASS CRASH', 'CRASH');
subtree['expected-to-pass-or-timeout-and-timeouted.html'] = mockExpectation('PASS TIMEOUT', 'TIMEOUT');
subtree['expected-pass-or-fail-and-passed.html'] = mockExpectation('PASS FAIL', 'PASS');
runTest(results, function() {
assertTrue(!document.getElementById('results-table'));
var testLinks = document.querySelectorAll('.test-link');
assertTrue(testLinks[0].innerText == 'foo/expected-to-pass-or-crash-and-crashed.html');
assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[0], 'tbody', 'expected'));
assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[0], 'table', 'expected'));
assertTrue(testLinks[1].innerText == 'foo/expected-to-pass-or-timeout-and-timeouted.html');
assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[1], 'tbody', 'expected'));
assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[1], 'table', 'expected'));
assertTrue(testLinks[2].innerText == 'foo/expected-pass-or-fail-and-passed.html');
assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[2], 'tbody', 'expected'));
assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[2], 'table', 'expected'));
});
document.body.innerHTML = '<pre>' + g_log.join('\n') + '</pre>';
}
......
......@@ -125,3 +125,29 @@ TEST-28: PASS
TEST-28: PASS
TEST-29: PASS
TEST-29: PASS
TEST-30: PASS
TEST-30: PASS
TEST-30: PASS
TEST-30: PASS
TEST-30: PASS
TEST-30: PASS
TEST-30: PASS
TEST-30: PASS
TEST-30: PASS
TEST-30: PASS
TEST-30: PASS
TEST-30: PASS
TEST-30: PASS
TEST-30: PASS
TEST-30: PASS
TEST-30: PASS
TEST-31: PASS
TEST-31: PASS
TEST-31: PASS
TEST-31: PASS
TEST-31: PASS
TEST-31: PASS
TEST-31: PASS
TEST-31: PASS
TEST-31: PASS
TEST-31: PASS
......@@ -555,22 +555,34 @@ function forEachTest(handler, opt_tree, opt_prefix)
}
}
function hasUnexpected(tests)
{
return tests.some(function (test) { return !test.isExpected; });
}
function testList(tests, header, tableId)
{
tests.sort();
var html = '<p>' + header + '</p><table id="' + tableId + '">';
var html = '<p>' + header + ':</p><table id="' + tableId + '"';
if (!hasUnexpected(tests))
html += ' class=expected';
html += '>';
// FIXME: add the expected failure column for all the test lists if globalState().results.uses_expectations_file
if (tableId == 'passes-table')
html += '<thead><th>test</th><th>expected failure</th></thead>';
for (var i = 0; i < tests.length; i++) {
var testObject = tests[i];
var test = testObject.name;
html += '<tbody><tr><td>';
html += '<tbody';
if (globalState().results.uses_expectations_file)
html += ' class="' + (testObject.isExpected ? 'expected' : '') + '"';
html += '><tr><td>';
html += (tableId == 'passes-table') ? testLink(test) : testLinkWithExpandButton(test);
html += '</td><td>';
if (tableId == 'stderr-table')
html += resultLink(stripExtension(test), '-stderr.txt', 'stderr');
else if (tableId == 'passes-table')
......@@ -965,15 +977,11 @@ function failingTestsTable(tests, title, id)
return '';
var tableRowHtml = '';
var hasUnexpected = false;
for (var i = 0; i < tests.length; i++) {
if (!tests[i].isExpected)
hasUnexpected = true;
for (var i = 0; i < tests.length; i++)
tableRowHtml += tableRow(tests[i]);
}
var header = '<div';
if (!hasUnexpected)
if (!hasUnexpected(tests))
header += ' class=expected';
header += '><p>' + title + ':</p>' +
......@@ -1015,19 +1023,19 @@ function generatePage()
'Flaky tests (failed the first run and got a different result on retry)', 'flaky-tests-table');
if (globalState().crashTests.length)
html += testList(globalState().crashTests, 'Tests that crashed:', 'crash-tests-table');
html += testList(globalState().crashTests, 'Tests that crashed', 'crash-tests-table');
if (globalState().timeoutTests.length)
html += testList(globalState().timeoutTests, 'Tests that timed out:', 'timeout-tests-table');
html += testList(globalState().timeoutTests, 'Tests that timed out', 'timeout-tests-table');
if (globalState().newTests.length)
html += testList(globalState().newTests, 'Tests that had no expected results (probably new):', 'new-tests-table');
html += testList(globalState().newTests, 'Tests that had no expected results (probably new)', 'new-tests-table');
if (globalState().testsWithStderr.length)
html += testList(globalState().testsWithStderr, 'Tests that had stderr output:', 'stderr-table');
html += testList(globalState().testsWithStderr, 'Tests that had stderr output', 'stderr-table');
if (globalState().results.uses_expectations_file && globalState().unexpectedPassTests.length)
html += testList(globalState().unexpectedPassTests, 'Tests expected to fail but passed:', 'passes-table');
html += testList(globalState().unexpectedPassTests, 'Tests expected to fail but passed', 'passes-table');
if (globalState().hasHttpTests) {
html += '<p>httpd access log: <a href="access_log.txt">access_log.txt</a></p>' +
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment