2011-01-05 Eric Seidel <eric@webkit.org>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Jan 2011 21:34:28 +0000 (21:34 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Jan 2011 21:34:28 +0000 (21:34 +0000)
        Unreviewed.

        Move LayoutTestResults over to new-run-webkit-tests TestResult architecture
        https://bugs.webkit.org/show_bug.cgi?id=51802

        Fix two exceptions seen on the bots after my original commit.

        * Scripts/webkitpy/common/net/layouttestresults.py:
        * Scripts/webkitpy/common/net/layouttestresults_unittest.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@75099 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/common/net/layouttestresults.py
Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py

index 4391022..7bf7d18 100644 (file)
@@ -1,3 +1,15 @@
+2011-01-05  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed.
+
+        Move LayoutTestResults over to new-run-webkit-tests TestResult architecture
+        https://bugs.webkit.org/show_bug.cgi?id=51802
+
+        Fix two exceptions seen on the bots after my original commit.
+
+        * Scripts/webkitpy/common/net/layouttestresults.py:
+        * Scripts/webkitpy/common/net/layouttestresults_unittest.py:
+
 2011-01-05  Kundu Suchismita  <suchi.kundu@nokia.com>
 
         Reviewed by Andreas Kling.
index fa8c39d..02a30b8 100644 (file)
@@ -66,8 +66,8 @@ class LayoutTestResults(object):
         # of new-run-webkit-test failures they equate to.
         failures = set()
         for anchor in row.findAll("a"):
-            anchor_text = anchor.string
-            if anchor_text in ["expected image", "image diffs"] or anchor_text.contains('%'):
+            anchor_text = unicode(anchor.string)
+            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())
@@ -75,6 +75,7 @@ class LayoutTestResults(object):
                 log("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):
index e0a35e8..391e3aa 100644 (file)
@@ -31,6 +31,8 @@ import unittest
 from webkitpy.common.net.layouttestresults import LayoutTestResults
 from webkitpy.layout_tests.layout_package import test_results
 from webkitpy.layout_tests.layout_package import test_failures
+from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup
+
 
 class LayoutTestResultsTest(unittest.TestCase):
     _example_results_html = """
@@ -71,3 +73,10 @@ class LayoutTestResultsTest(unittest.TestCase):
         self.assertEqual(LayoutTestResults.results_from_string(""), None)
         results = LayoutTestResults.results_from_string(self._example_results_html)
         self.assertEqual(len(results.failing_tests()), 0)
+
+    def test_failures_from_fail_row(self):
+        row_html = "<tr><td><a>25%</a></td></tr>"
+        row = BeautifulSoup(row_html)
+        failures = LayoutTestResults._failures_from_fail_row(row)
+        self.assertEqual(len(failures), 1)
+        self.assertEqual(type(sorted(failures)[0]), test_failures.FailureImageHashMismatch)