[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 13:57:11 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit f5902da790ceffe20b5de5facc0b7e2ac519f9fb
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 30 09:12:28 2010 +0000

    2010-09-30  Eric Seidel  <eric at webkit.org>
    
            Reviewed by Adam Barth.
    
            webkit-patch failure-reason dies if non-trunk commits are in the blame range
            https://bugs.webkit.org/show_bug.cgi?id=46866
    
            I also made failure-reason use RegressionWindow in a cleaner way.
    
            * Scripts/webkitpy/tool/commands/queries.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68766 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 9ca6d50..83c9885 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,14 @@
+2010-09-30  Eric Seidel  <eric at webkit.org>
+
+        Reviewed by Adam Barth.
+
+        webkit-patch failure-reason dies if non-trunk commits are in the blame range
+        https://bugs.webkit.org/show_bug.cgi?id=46866
+
+        I also made failure-reason use RegressionWindow in a cleaner way.
+
+        * Scripts/webkitpy/tool/commands/queries.py:
+
 2010-09-29  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queries.py b/WebKitTools/Scripts/webkitpy/tool/commands/queries.py
index 3e8feaa..620afbc 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queries.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queries.py
@@ -188,17 +188,21 @@ class FailureReason(AbstractDeclarativeCommand):
     name = "failure-reason"
     help_text = "Lists revisions where individual test failures started at %s" % BuildBot.default_host
 
-    def _print_blame_information_for_transition(self, green_build, red_build, failing_tests):
-        regression_window = RegressionWindow(green_build, red_build)
-        revisions = regression_window.revisions()
+    def _blame_line_for_revision(self, revision):
+        try:
+            commit_info = self._tool.checkout().commit_info_for_revision(revision)
+        except Exception, e:
+            return "FAILED to fetch CommitInfo for r%s, exception: %s" % (revision, e)
+        if not commit_info:
+            return "FAILED to fetch CommitInfo for r%s, likely missing ChangeLog" % revision
+        return commit_info.blame_string(self._tool.bugs)
+
+    def _print_blame_information_for_transition(self, regression_window, failing_tests):
+        red_build = regression_window.failing_build()
         print "SUCCESS: Build %s (r%s) was the first to show failures: %s" % (red_build._number, red_build.revision(), failing_tests)
         print "Suspect revisions:"
-        for revision in revisions:
-            commit_info = self._tool.checkout().commit_info_for_revision(revision)
-            if commit_info:
-                print commit_info.blame_string(self._tool.bugs)
-            else:
-                print "FAILED to fetch CommitInfo for r%s, likely missing ChangeLog" % revision
+        for revision in regression_window.revisions():
+            print self._blame_line_for_revision(revision)
 
     def _explain_failures_for_builder(self, builder, start_revision):
         print "Examining failures for \"%s\", starting at r%s" % (builder.name(), start_revision)
@@ -235,7 +239,8 @@ class FailureReason(AbstractDeclarativeCommand):
                 print "No change in build %s (r%s), %s unexplained failures (%s in this build)" % (build._number, build.revision(), len(results_to_explain), len(failures))
                 last_build_with_results = build
                 continue
-            self._print_blame_information_for_transition(build, last_build_with_results, fixed_results)
+            regression_window = RegressionWindow(build, last_build_with_results)
+            self._print_blame_information_for_transition(regression_window, fixed_results)
             last_build_with_results = build
             results_to_explain -= fixed_results
         if results_to_explain:
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queries_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queries_unittest.py
index 7dddfe7..05a4a5c 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queries_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queries_unittest.py
@@ -26,12 +26,15 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+import unittest
+
 from webkitpy.common.net.bugzilla import Bugzilla
 from webkitpy.thirdparty.mock import Mock
 from webkitpy.tool.commands.commandtest import CommandsTest
 from webkitpy.tool.commands.queries import *
 from webkitpy.tool.mocktool import MockTool
 
+
 class QueryCommandsTest(CommandsTest):
     def test_bugs_to_commit(self):
         expected_stderr = "Warning, attachment 128 on bug 42 has invalid committer (non-committer at example.com)\n"
@@ -71,3 +74,17 @@ class QueryCommandsTest(CommandsTest):
 
         expected_stdout = "Test 'media' is not skipped by any port.\n"
         self.assert_execute_outputs(SkippedPorts(), ("media",), expected_stdout)
+
+
+class FailureReasonTest(unittest.TestCase):
+    def test_blame_line_for_revision(self):
+        tool = MockTool()
+        command = FailureReason()
+        command.bind_to_tool(tool)
+        # This is an artificial example, mostly to test the CommitInfo lookup failure case.
+        self.assertEquals(command._blame_line_for_revision(None), "FAILED to fetch CommitInfo for rNone, likely missing ChangeLog")
+
+        def raising_mock(self):
+            raise Exception("MESSAGE")
+        tool.checkout().commit_info_for_revision = raising_mock
+        self.assertEquals(command._blame_line_for_revision(None), "FAILED to fetch CommitInfo for rNone, exception: MESSAGE")
diff --git a/WebKitTools/Scripts/webkitpy/tool/mocktool.py b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
index 31f4539..f84ec2b 100644
--- a/WebKitTools/Scripts/webkitpy/tool/mocktool.py
+++ b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
@@ -457,6 +457,9 @@ class MockCheckout(object):
     _committer_list = CommitterList()
 
     def commit_info_for_revision(self, svn_revision):
+        # The real Checkout would probably throw an exception, but this is the only way tests have to get None back at the moment.
+        if not svn_revision:
+            return None
         return CommitInfo(svn_revision, "eric at webkit.org", {
             "bug_id": 42,
             "author_name": "Adam Barth",

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list