[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

eric at webkit.org eric at webkit.org
Wed Dec 22 14:39:41 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 0ec201fd1b9c0eb9ca294a2968c72ce4803ca1f5
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 15 01:54:24 2010 +0000

    2010-10-14  Eric Seidel  <eric at webkit.org>
    
            Unreviewed, just fixing an exception seen on the commit-queue.
    
            I should have unit tested this function before.
    
            * Scripts/webkitpy/tool/commands/queues.py:
            * Scripts/webkitpy/tool/commands/queues_unittest.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69832 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 5ea3206..84e5247 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,5 +1,14 @@
 2010-10-14  Eric Seidel  <eric at webkit.org>
 
+        Unreviewed, just fixing an exception seen on the commit-queue.
+
+        I should have unit tested this function before.
+
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+
+2010-10-14  Eric Seidel  <eric at webkit.org>
+
         Reviewed by Adam Barth.
 
         commit-queue should not fail patches due to flaky tests
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
index e0c80bd..df42e80 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
@@ -39,6 +39,7 @@ from optparse import make_option
 from StringIO import StringIO
 
 from webkitpy.common.net.bugzilla import CommitterValidator
+from webkitpy.common.net.layouttestresults import LayoutTestResults
 from webkitpy.common.net.statusserver import StatusServer
 from webkitpy.common.system.executive import ScriptError
 from webkitpy.common.system.deprecated_logging import error, log
@@ -268,15 +269,22 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler, CommitQueueTaskD
         failure_log = self._log_from_script_error_for_upload(script_error)
         return self._update_status(message, patch=patch, results_file=failure_log)
 
+    # FIXME: This exists for mocking, but should instead be mocked via
+    # some sort of tool.filesystem() object.
+    def _read_file_contents(self, path):
+        try:
+            with codecs.open(path, "r", "utf-8") as open_file:
+                return open_file.read()
+        except OSError, e:  # File does not exist or can't be read.
+            return None
+
     # FIXME: This may belong on the Port object.
     def layout_test_results(self):
         results_path = self._tool.port().layout_tests_results_path()
-        try:
-            # FIXME: We need a nice open() abstraction for better mocking here.
-            with codecs.open(results_path, "r", "utf-8") as results_file:
-                return LayoutTestResults.results_from_string(results_file)
-        except OSError, e:  # File does not exist or can't be read.
+        results_html = self._read_file_contents(results_path)
+        if not results_html:
             return None
+        return LayoutTestResults.results_from_string(results_html)
 
     def refetch_patch(self, patch):
         return self._tool.bugs.fetch_attachment(patch.id())
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
index c8f63ec..ad04f2b 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
@@ -336,6 +336,13 @@ Please file bugs against the tests.  The commit-queue is continuing to process y
 """
         OutputCapture().assert_outputs(self, queue.report_flaky_tests, [MockPatch(), ["foo/bar.html", "bar/baz.html"]], expected_stderr=expected_stderr)
 
+    def test_layout_test_results(self):
+        queue = CommitQueue()
+        queue.bind_to_tool(MockTool())
+        queue._read_file_contents = lambda path: None
+        self.assertEquals(queue.layout_test_results(), None)
+        queue._read_file_contents = lambda path: ""
+        self.assertEquals(queue.layout_test_results(), None)
 
 class RietveldUploadQueueTest(QueuesTest):
     def test_rietveld_upload_queue(self):

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list