Diff
Modified: trunk/Tools/ChangeLog (138633 => 138634)
--- trunk/Tools/ChangeLog 2013-01-02 20:33:18 UTC (rev 138633)
+++ trunk/Tools/ChangeLog 2013-01-02 20:37:53 UTC (rev 138634)
@@ -1,3 +1,32 @@
+2013-01-02 Adam Barth <[email protected]>
+
+ Remove old-run-webkit-tests support from webkitpy
+ https://bugs.webkit.org/show_bug.cgi?id=105619
+
+ Reviewed by Eric Seidel.
+
+ This patch removes support for webkitpy parsing the
+ old-run-webkit-tests results format. There doesn't seem to be any
+ reason to keep this code around anymore now that most bots have
+ switched to new-run-webkit-tests.
+
+ * Scripts/webkitpy/common/net/buildbot/buildbot.py:
+ (Builder.fetch_layout_test_results):
+ * Scripts/webkitpy/common/net/layouttestresults.py:
+ (path_for_layout_test):
+ (LayoutTestResults.results_from_string):
+ (LayoutTestResults):
+ * Scripts/webkitpy/common/net/layouttestresults_unittest.py:
+ (LayoutTestResultsTest.test_results_from_string):
+ * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
+ (test_flaky_test_failure):
+ * Scripts/webkitpy/tool/bot/layouttestresultsreader_unittest.py:
+ (LayoutTestResultsReaderTest.test_missing_layout_test_results):
+ * Scripts/webkitpy/tool/bot/patchanalysistask.py:
+ (PatchAnalysisTask._test_patch):
+ * Scripts/webkitpy/tool/commands/queuestest.py:
+ (QueuesTest.assert_queue_outputs):
+
2013-01-02 Heikki Paajanen <[email protected]>
[Qt][WK2] Add simple UI to find text from page
Modified: trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot.py (138633 => 138634)
--- trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot.py 2013-01-02 20:33:18 UTC (rev 138633)
+++ trunk/Tools/Scripts/webkitpy/common/net/buildbot/buildbot.py 2013-01-02 20:37:53 UTC (rev 138634)
@@ -85,10 +85,6 @@
def fetch_layout_test_results(self, results_url):
# FIXME: This should cache that the result was a 404 and stop hitting the network.
results_file = NetworkTransaction(convert_404_to_None=True).run(lambda: self._fetch_file_from_results(results_url, "full_results.json"))
- if not results_file:
- results_file = NetworkTransaction(convert_404_to_None=True).run(lambda: self._fetch_file_from_results(results_url, "results.html"))
-
- # results_from_string accepts either ORWT html or NRWT json.
return LayoutTestResults.results_from_string(results_file)
def url_encoded_name(self):
Modified: trunk/Tools/Scripts/webkitpy/common/net/layouttestresults.py (138633 => 138634)
--- trunk/Tools/Scripts/webkitpy/common/net/layouttestresults.py 2013-01-02 20:33:18 UTC (rev 138633)
+++ trunk/Tools/Scripts/webkitpy/common/net/layouttestresults.py 2013-01-02 20:37:53 UTC (rev 138634)
@@ -25,9 +25,6 @@
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# A module for parsing results.html files generated by old-run-webkit-tests
-# This class is one big hack and only needs to exist until we transition to new-run-webkit-tests.
import logging
@@ -45,88 +42,6 @@
return "LayoutTests/%s" % test_name
-class ORWTResultsHTMLParser(object):
- """This class knows how to parse old-run-webkit-tests results.html files."""
-
- stderr_key = u'Tests that had stderr output:'
- fail_key = u'Tests where results did not match expected results:'
- timeout_key = u'Tests that timed out:'
- # FIXME: This may need to be made aware of WebKitTestRunner results for WebKit2.
- crash_key = u'Tests that caused the DumpRenderTree tool to crash:'
- missing_key = u'Tests that had no expected results (probably new):'
- webprocess_crash_key = u'Tests that caused the Web process to crash:'
-
- expected_keys = [
- stderr_key,
- fail_key,
- crash_key,
- webprocess_crash_key,
- timeout_key,
- missing_key,
- ]
-
- @classmethod
- def _failures_from_fail_row(self, row):
- # Look at all anchors in this row, and guess what type
- # of new-run-webkit-test failures they equate to.
- failures = set()
- test_name = None
- for anchor in row.findAll("a"):
- anchor_text = unicode(anchor.string)
- if not test_name:
- test_name = anchor_text
- continue
- if anchor_text in ["expected image", "image diffs"] or '%' in anchor_text:
- failures.add(test_failures.FailureImageHashMismatch())
- elif anchor_text in ["expected", "actual", "diff", "pretty diff"]:
- failures.add(test_failures.FailureTextMismatch())
- else:
- _log.warning("Unhandled link text in results.html parsing: %s. Please file a bug against webkitpy." % anchor_text)
- # FIXME: Its possible the row contained no links due to ORWT brokeness.
- # We should probably assume some type of failure anyway.
- return failures
-
- @classmethod
- def _failures_from_row(cls, row, table_title):
- if table_title == cls.fail_key:
- return cls._failures_from_fail_row(row)
- if table_title == cls.crash_key:
- return [test_failures.FailureCrash()]
- if table_title == cls.webprocess_crash_key:
- return [test_failures.FailureCrash(process_name="WebProcess")]
- if table_title == cls.timeout_key:
- return [test_failures.FailureTimeout()]
- if table_title == cls.missing_key:
- return [test_failures.FailureMissingResult(), test_failures.FailureMissingImageHash(), test_failures.FailureMissingImage()]
- return None
-
- @classmethod
- def _test_result_from_row(cls, row, table_title):
- test_name = unicode(row.find("a").string)
- failures = cls._failures_from_row(row, table_title)
- # TestResult is a class designed to work with new-run-webkit-tests.
- # old-run-webkit-tests does not save quite enough information in results.html for us to parse.
- # FIXME: It's unclear if test_name should include LayoutTests or not.
- return test_results.TestResult(test_name, failures)
-
- @classmethod
- def _parse_results_table(cls, table):
- table_title = unicode(table.findPreviousSibling("p").string)
- if table_title not in cls.expected_keys:
- # This Exception should only ever be hit if run-webkit-tests changes its results.html format.
- raise Exception("Unhandled title: %s" % table_title)
- # Ignore stderr failures. Everyone ignores them anyway.
- if table_title == cls.stderr_key:
- return []
- # FIXME: We might end with two TestResults object for the same test if it appears in more than one row.
- return [cls._test_result_from_row(row, table_title) for row in table.findAll("tr")]
-
- @classmethod
- def parse_results_html(cls, page):
- tables = BeautifulSoup(page).findAll("table")
- return sum([cls._parse_results_table(table) for table in tables], [])
-
-
# FIXME: This should be unified with ResultsSummary or other NRWT layout tests code
# in the layout_tests package.
# This doesn't belong in common.net, but we don't have a better place for it yet.
@@ -135,12 +50,8 @@
def results_from_string(cls, string):
if not string:
return None
- # For now we try to parse first as json, then as results.html
- # eventually we will remove the html fallback support.
test_results = ResultsJSONParser.parse_results_json(string)
if not test_results:
- test_results = ORWTResultsHTMLParser.parse_results_html(string)
- if not test_results:
return None
return cls(test_results)
@@ -150,7 +61,7 @@
self._unit_test_failures = []
# FIXME: run-webkit-tests should store the --exit-after-N-failures value
- # (or some indication of early exit) somewhere in the results.html/results.json
+ # (or some indication of early exit) somewhere in the results.json
# file. Until it does, callers should set the limit to
# --exit-after-N-failures value used in that run. Consumers of LayoutTestResults
# may use that value to know if absence from the failure list means PASS.
Modified: trunk/Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py (138633 => 138634)
--- trunk/Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py 2013-01-02 20:33:18 UTC (rev 138633)
+++ trunk/Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py 2013-01-02 20:37:53 UTC (rev 138634)
@@ -28,106 +28,14 @@
import unittest
-from webkitpy.common.net.layouttestresults import LayoutTestResults, ORWTResultsHTMLParser
+from webkitpy.common.net.layouttestresults import LayoutTestResults
from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.layout_tests.models import test_results
from webkitpy.layout_tests.models import test_failures
from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup
-class ORWTResultsHTMLParserTest(unittest.TestCase):
- _example_results_html = """
-<html>
-<head>
-<title>Layout Test Results</title>
-</head>
-<body>
-<p>Tests that had stderr output:</p>
-<table>
-<tr>
-<td><a href=""
-<td><a href=""
-</tr>
-<td><a href=""
-<td><a href=""
-</tr>
-</table><p>Tests that had no expected results (probably new):</p>
-<table>
-<tr>
-<td><a href=""
-<td><a href=""
-</tr>
-</table></body>
-</html>
-"""
-
- _example_results_html_with_failing_tests = """
-<html>
-<head>
-<title>Layout Test Results</title>
-</head>
-<body>
-<p>Tests where results did not match expected results:</p>
-<table>
-<tr>
-<td><a href=""
-<td>
-<a href=""
-</td>
-<td>
-<a href=""
-</td>
-<td>
-<a href=""
-</td>
-<td>
-<a href="" diff</a>
-</td>
-</tr>
-</table>
-<p>Tests that had stderr output:</p>
-<table>
-<tr>
-<td><a href=""
-<td><a href=""
-</tr>
-<td><a href=""
-<td><a href=""
-</tr>
-</table><p>Tests that had no expected results (probably new):</p>
-<table>
-<tr>
-<td><a href=""
-<td><a href=""
-</tr>
-</table></body>
-</html>
-"""
-
- def test_parse_layout_test_results(self):
- failures = [test_failures.FailureMissingResult(), test_failures.FailureMissingImageHash(), test_failures.FailureMissingImage()]
- testname = 'fast/repaint/no-caret-repaint-in-non-content-editable-element.html'
- expected_results = [test_results.TestResult(testname, failures)]
-
- results = ORWTResultsHTMLParser.parse_results_html(self._example_results_html)
- self.assertEqual(expected_results, results)
-
-
- def test_failures_from_fail_row(self):
- row = BeautifulSoup("<tr><td><a>test.hml</a></td><td><a>expected image</a></td><td><a>25%</a></td></tr>")
- test_name = unicode(row.find("a").string)
- # Even if the caller has already found the test name, findAll inside _failures_from_fail_row will see it again.
- failures = OutputCapture().assert_outputs(self, ORWTResultsHTMLParser._failures_from_fail_row, [row])
- self.assertEqual(len(failures), 1)
- self.assertEqual(type(sorted(failures)[0]), test_failures.FailureImageHashMismatch)
-
- row = BeautifulSoup("<tr><td><a>test.hml</a><a>foo</a></td></tr>")
- expected_logs = "Unhandled link text in results.html parsing: foo. Please file a bug against webkitpy.\n"
- OutputCapture().assert_outputs(self, ORWTResultsHTMLParser._failures_from_fail_row, [row], expected_logs=expected_logs)
-
-
class LayoutTestResultsTest(unittest.TestCase):
-
def test_set_failure_limit_count(self):
results = LayoutTestResults([])
self.assertEqual(results.failure_limit_count(), None)
@@ -137,10 +45,3 @@
def test_results_from_string(self):
self.assertEqual(LayoutTestResults.results_from_string(None), None)
self.assertEqual(LayoutTestResults.results_from_string(""), None)
- results = LayoutTestResults.results_from_string(ORWTResultsHTMLParserTest._example_results_html)
- self.assertEqual(len(results.failing_tests()), 1)
-
- def test_tests_matching_failure_types(self):
- results = LayoutTestResults.results_from_string(ORWTResultsHTMLParserTest._example_results_html_with_failing_tests)
- failing_tests = results.tests_matching_failure_types([test_failures.FailureTextMismatch])
- self.assertEqual(len(results.failing_tests()), 2)
Modified: trunk/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py (138633 => 138634)
--- trunk/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py 2013-01-02 20:33:18 UTC (rev 138633)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py 2013-01-02 20:37:53 UTC (rev 138634)
@@ -280,7 +280,7 @@
ScriptError("MOCK tests failure"),
])
# CommitQueueTask will only report flaky tests if we successfully parsed
- # results.html and returned a LayoutTestResults object, so we fake one.
+ # results.json and returned a LayoutTestResults object, so we fake one.
commit_queue.test_results = lambda: LayoutTestResults([])
expected_logs = """run_webkit_patch: ['clean']
command_passed: success_message='Cleaned working directory' patch='10000'
Modified: trunk/Tools/Scripts/webkitpy/tool/bot/layouttestresultsreader_unittest.py (138633 => 138634)
--- trunk/Tools/Scripts/webkitpy/tool/bot/layouttestresultsreader_unittest.py 2013-01-02 20:33:18 UTC (rev 138633)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/layouttestresultsreader_unittest.py 2013-01-02 20:37:53 UTC (rev 138634)
@@ -46,7 +46,7 @@
# Make sure that our filesystem mock functions as we expect.
self.assertRaises(IOError, tool.filesystem.read_text_file, layout_tests_results_path)
self.assertRaises(IOError, tool.filesystem.read_text_file, unit_tests_results_path)
- # layout_test_results shouldn't raise even if the results.html file is missing.
+ # layout_test_results shouldn't raise even if the results.json file is missing.
self.assertEqual(reader.results(), None)
def test_create_unit_test_results(self):
Modified: trunk/Tools/Scripts/webkitpy/tool/bot/patchanalysistask.py (138633 => 138634)
--- trunk/Tools/Scripts/webkitpy/tool/bot/patchanalysistask.py 2013-01-02 20:33:18 UTC (rev 138633)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/patchanalysistask.py 2013-01-02 20:37:53 UTC (rev 138634)
@@ -192,7 +192,7 @@
return True
if self._test():
- # Only report flaky tests if we were successful at parsing results.html and archiving results.
+ # Only report flaky tests if we were successful at parsing results.json and archiving results.
if first_results and first_results_archive:
self._report_flaky_tests(first_results.failing_test_results(), first_results_archive)
return True
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queuestest.py (138633 => 138634)
--- trunk/Tools/Scripts/webkitpy/tool/commands/queuestest.py 2013-01-02 20:33:18 UTC (rev 138633)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queuestest.py 2013-01-02 20:37:53 UTC (rev 138634)
@@ -79,7 +79,7 @@
tool = MockTool()
# This is a hack to make it easy for callers to not have to setup a custom MockFileSystem just to test the commit-queue
# the cq tries to read the layout test results, and will hit a KeyError in MockFileSystem if we don't do this.
- tool.filesystem.write_text_file('/mock-results/results.html', "")
+ tool.filesystem.write_text_file('/mock-results/full_results.json', "")
if not expected_stdout:
expected_stdout = {}
if not expected_stderr: