[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

eric at webkit.org eric at webkit.org
Fri Jan 21 14:59:16 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit 8b3cd1f23e86da800c1877847d3401cb7f79540d
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 6 00:10:21 2011 +0000

    2011-01-05  Eric Seidel  <eric at webkit.org>
    
            Reviewed by Ojan Vafai.
    
            commit-queue should report failure type when reporting flaky tests
            https://bugs.webkit.org/show_bug.cgi?id=51900
    
            This patch was a ridiculous amount of plumbing.  In the end I like
            the NRWT-style TestResult class even less.  But now we're passing
            a list of TestResult objects from the queue to the FlakyTestReporter.
            Thus the FlakyTestReporter can more easily report what type of failure
            occurred.
    
            In the process, I found that I was not alone in finding TestResult
            cumbersome to use.  A bunch of code was trying to create a TestResult
            object with default values.  However since the constructor didn't make
            this easy, some places were getting it wrong (including the TestResult unit test)!
            I've fixed the TestResult constructor to have default values for non-essential
            arguments.
    
            * Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py:
            * Scripts/webkitpy/common/net/layouttestresults.py:
            * Scripts/webkitpy/common/net/layouttestresults_unittest.py:
            * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
            * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
            * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
            * Scripts/webkitpy/layout_tests/layout_package/test_results.py:
            * Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py:
            * Scripts/webkitpy/layout_tests/layout_package/test_runner.py:
            * Scripts/webkitpy/tool/bot/commitqueuetask.py:
            * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
            * Scripts/webkitpy/tool/bot/flakytestreporter.py:
            * Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py:
            * Scripts/webkitpy/tool/commands/queues.py:
            * Scripts/webkitpy/tool/commands/queues_unittest.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75114 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index 8bfc1d4..c11028b 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,5 +1,41 @@
 2011-01-05  Eric Seidel  <eric at webkit.org>
 
+        Reviewed by Ojan Vafai.
+
+        commit-queue should report failure type when reporting flaky tests
+        https://bugs.webkit.org/show_bug.cgi?id=51900
+
+        This patch was a ridiculous amount of plumbing.  In the end I like
+        the NRWT-style TestResult class even less.  But now we're passing
+        a list of TestResult objects from the queue to the FlakyTestReporter.
+        Thus the FlakyTestReporter can more easily report what type of failure
+        occurred.
+
+        In the process, I found that I was not alone in finding TestResult
+        cumbersome to use.  A bunch of code was trying to create a TestResult
+        object with default values.  However since the constructor didn't make
+        this easy, some places were getting it wrong (including the TestResult unit test)!
+        I've fixed the TestResult constructor to have default values for non-essential
+        arguments.
+
+        * Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py:
+        * Scripts/webkitpy/common/net/layouttestresults.py:
+        * Scripts/webkitpy/common/net/layouttestresults_unittest.py:
+        * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+        * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
+        * Scripts/webkitpy/layout_tests/layout_package/test_results.py:
+        * Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py:
+        * Scripts/webkitpy/layout_tests/layout_package/test_runner.py:
+        * Scripts/webkitpy/tool/bot/commitqueuetask.py:
+        * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
+        * Scripts/webkitpy/tool/bot/flakytestreporter.py:
+        * Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py:
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+
+2011-01-05  Eric Seidel  <eric at webkit.org>
+
         Unreviewed.
 
         Move LayoutTestResults over to new-run-webkit-tests TestResult architecture
diff --git a/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py b/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py
index f544647..ba898ec 100644
--- a/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py
+++ b/Tools/Scripts/webkitpy/common/net/buildbot/buildbot_unittest.py
@@ -37,8 +37,7 @@ from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup
 
 class BuilderTest(unittest.TestCase):
     def _mock_test_result(self, testname):
-        failures = [test_failures.FailureTextMismatch()]
-        return test_results.TestResult(testname, failures, test_run_time=None, total_time_for_all_diffs=None, time_for_diffs=None)
+        return test_results.TestResult(testname, [test_failures.FailureTextMismatch()])
 
     def _install_fetch_build(self, failure):
         def _mock_fetch_build(build_number):
diff --git a/Tools/Scripts/webkitpy/common/net/layouttestresults.py b/Tools/Scripts/webkitpy/common/net/layouttestresults.py
index 62253fb..6ac77f0 100644
--- a/Tools/Scripts/webkitpy/common/net/layouttestresults.py
+++ b/Tools/Scripts/webkitpy/common/net/layouttestresults.py
@@ -97,7 +97,7 @@ class LayoutTestResults(object):
         # 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, test_run_time=None, total_time_for_all_diffs=None, time_for_diffs=None)
+        return test_results.TestResult(test_name, failures)
 
     @classmethod
     def _parse_results_table(cls, table):
@@ -131,10 +131,16 @@ class LayoutTestResults(object):
     def test_results(self):
         return self._test_results
 
+    def results_matching_failure_types(self, failure_types):
+        return [result for result in self._test_results if result.has_failure_matching_types(failure_types)]
+
     def tests_matching_failure_types(self, failure_types):
-        return [result.filename for result in self._test_results if result.has_failure_matching_types(failure_types)]
+        return [result.filename for result in self.results_matching_failure_types(failure_types)]
 
-    def failing_tests(self):
+    def failing_test_results(self):
         # These should match the "fail", "crash", and "timeout" keys.
         failure_types = [test_failures.FailureTextMismatch, test_failures.FailureImageHashMismatch, test_failures.FailureCrash, test_failures.FailureTimeout]
-        return self.tests_matching_failure_types(failure_types)
+        return self.results_matching_failure_types(failure_types)
+
+    def failing_tests(self):
+        return [result.filename for result in self.failing_test_results()]
diff --git a/Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py b/Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py
index 386dd3f..14a9ed3 100644
--- a/Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py
+++ b/Tools/Scripts/webkitpy/common/net/layouttestresults_unittest.py
@@ -64,7 +64,7 @@ class LayoutTestResultsTest(unittest.TestCase):
     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, test_run_time=None, total_time_for_all_diffs=None, time_for_diffs=None)]
+        expected_results = [test_results.TestResult(testname, failures)]
 
         results = LayoutTestResults._parse_results_html(self._example_results_html)
         self.assertEqual(expected_results, results)
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
index fdb8da6..2bb2d02 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
@@ -500,11 +500,9 @@ class TestShellThread(WatchableThread):
             result = worker.get_test_result()
         except AttributeError, e:
             # This gets raised if the worker thread has already exited.
-            failures = []
-            _log.error('Cannot get results of test: %s' %
-                       test_input.filename)
-            result = test_results.TestResult(test_input.filename, failures=[],
-                test_run_time=0, total_time_for_all_diffs=0, time_for_diffs={})
+            _log.error('Cannot get results of test: %s' % test_input.filename)
+            # FIXME: Seems we want a unique failure type here.
+            result = test_results.TestResult(test_input.filename)
 
         return result
 
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
index 54d129b..12e65b2 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
@@ -46,6 +46,7 @@ import webkitpy.thirdparty.simplejson as simplejson
 
 _log = logging.getLogger("webkitpy.layout_tests.layout_package.json_results_generator")
 
+# FIXME: We already have a TestResult class in test_results.py
 class TestResult(object):
     """A simple class that represents a single test result."""
 
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py
index 0e478c8..9280b02 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py
@@ -139,9 +139,7 @@ class  Testprinter(unittest.TestCase):
         elif result_type == test_expectations.CRASH:
             failures = [test_failures.FailureCrash()]
         path = os.path.join(self._port.layout_tests_dir(), test)
-        return test_results.TestResult(path, failures, run_time,
-                                       total_time_for_all_diffs=0,
-                                       time_for_diffs=0)
+        return test_results.TestResult(path, failures=failures, test_run_time=run_time)
 
     def get_result_summary(self, tests, expectations_str):
         test_paths = [os.path.join(self._port.layout_tests_dir(), test) for
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results.py
index 8630437..055f65b 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results.py
@@ -38,13 +38,14 @@ class TestResult(object):
     def loads(str):
         return cPickle.loads(str)
 
-    def __init__(self, filename, failures, test_run_time,
-                 total_time_for_all_diffs, time_for_diffs):
-        self.failures = failures
+    def __init__(self, filename, failures=None, test_run_time=None, total_time_for_all_diffs=None, time_for_diffs=None):
         self.filename = filename
-        self.test_run_time = test_run_time
-        self.time_for_diffs = time_for_diffs
-        self.total_time_for_all_diffs = total_time_for_all_diffs
+        self.failures = failures or []
+        self.test_run_time = test_run_time or 0
+        self.total_time_for_all_diffs = total_time_for_all_diffs or 0
+        self.time_for_diffs = time_for_diffs or {}  # FIXME: Why is this a dictionary?
+
+        # FIXME: Setting this in the constructor makes this class hard to mutate.
         self.type = test_failures.determine_result_type(failures)
 
     def __eq__(self, other):
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py
index 5921666..c8fcf64 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py
@@ -32,12 +32,20 @@ from test_results import TestResult
 
 
 class Test(unittest.TestCase):
+    def test_defaults(self):
+        result = TestResult("foo")
+        self.assertEqual(result.filename, 'foo')
+        self.assertEqual(result.failures, [])
+        self.assertEqual(result.test_run_time, 0)
+        self.assertEqual(result.total_time_for_all_diffs, 0)
+        self.assertEqual(result.time_for_diffs, {})
+
     def test_loads(self):
         result = TestResult(filename='foo',
                             failures=[],
                             test_run_time=1.1,
                             total_time_for_all_diffs=0.5,
-                            time_for_diffs=0.5)
+                            time_for_diffs={})
         s = result.dumps()
         new_result = TestResult.loads(s)
         self.assertTrue(isinstance(new_result, TestResult))
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py
index 24d04ca..5b02a00 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py
@@ -251,6 +251,7 @@ class TestRunner:
             overrides=overrides_str)
         return self._expectations
 
+    # FIXME: This method is way too long and needs to be broken into pieces.
     def prepare_lists_and_print_output(self):
         """Create appropriate subsets of test lists and returns a
         ResultSummary object. Also prints expected test counts.
@@ -384,9 +385,7 @@ class TestRunner:
             # subtracted out of self._test_files, above), but we stub out the
             # results here so the statistics can remain accurate.
             for test in skip_chunk:
-                result = test_results.TestResult(test,
-                    failures=[], test_run_time=0, total_time_for_all_diffs=0,
-                    time_for_diffs=0)
+                result = test_results.TestResult(test)
                 result.type = test_expectations.SKIP
                 result_summary.add(result, expected=True)
         self._printer.print_expected('')
diff --git a/Tools/Scripts/webkitpy/tool/bot/commitqueuetask.py b/Tools/Scripts/webkitpy/tool/bot/commitqueuetask.py
index b9eba7b..4bdc79b 100644
--- a/Tools/Scripts/webkitpy/tool/bot/commitqueuetask.py
+++ b/Tools/Scripts/webkitpy/tool/bot/commitqueuetask.py
@@ -149,11 +149,11 @@ class CommitQueueTask(object):
         "Able to pass tests without patch",
         "Unable to pass tests without patch (tree is red?)")
 
-    def _failing_tests_from_last_run(self):
+    def _failing_results_from_last_run(self):
         results = self._delegate.layout_test_results()
         if not results:
-            return None
-        return results.failing_tests()
+            return []  # Makes callers slighty cleaner to not have to deal with None
+        return results.failing_test_results()
 
     def _land(self):
         # Unclear if this should pass --quiet or not.  If --parent-command always does the reporting, then it should.
@@ -168,8 +168,8 @@ class CommitQueueTask(object):
         "Landed patch",
         "Unable to land patch")
 
-    def _report_flaky_tests(self, flaky_tests):
-        self._delegate.report_flaky_tests(self._patch, flaky_tests)
+    def _report_flaky_tests(self, flaky_test_results):
+        self._delegate.report_flaky_tests(self._patch, flaky_test_results)
 
     def _test_patch(self):
         if self._patch.is_rollout():
@@ -177,12 +177,14 @@ class CommitQueueTask(object):
         if self._test():
             return True
 
-        first_failing_tests = self._failing_tests_from_last_run()
+        first_failing_results = self._failing_results_from_last_run()
+        first_failing_tests = [result.filename for result in first_failing_results]
         if self._test():
-            self._report_flaky_tests(first_failing_tests)
+            self._report_flaky_tests(first_failing_results)
             return True
 
-        second_failing_tests = self._failing_tests_from_last_run()
+        second_failing_results = self._failing_results_from_last_run()
+        second_failing_tests = [result.filename for result in second_failing_results]
         if first_failing_tests != second_failing_tests:
             # We could report flaky tests here, but since run-webkit-tests
             # is run with --exit-after-N-failures=1, we would need to
diff --git a/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py b/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py
index 376f407..f279cac 100644
--- a/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py
@@ -31,6 +31,8 @@ import unittest
 
 from webkitpy.common.system.deprecated_logging import error, log
 from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.layout_tests.layout_package import test_results
+from webkitpy.layout_tests.layout_package import test_failures
 from webkitpy.thirdparty.mock import Mock
 from webkitpy.tool.bot.commitqueuetask import *
 from webkitpy.tool.mocktool import MockTool
@@ -62,11 +64,15 @@ class MockCommitQueue(CommitQueueTaskDelegate):
     def layout_test_results(self):
         return None
 
-    def report_flaky_tests(self, patch, flaky_tests):
+    def report_flaky_tests(self, patch, flaky_results):
+        flaky_tests = [result.filename for result in flaky_results]
         log("report_flaky_tests: patch='%s' flaky_tests='%s'" % (patch.id(), flaky_tests))
 
 
 class CommitQueueTaskTest(unittest.TestCase):
+    def _mock_test_result(self, testname):
+        return test_results.TestResult(testname, [test_failures.FailureTextMismatch()])
+
     def _run_through_task(self, commit_queue, expected_stderr, expected_exception=None, expect_retry=False):
         tool = MockTool(log_executive=True)
         patch = tool.bugs.fetch_attachment(197)
@@ -189,7 +195,7 @@ run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--n
 command_failed: failure_message='Patch does not pass tests' script_error='MOCK tests failure' patch='197'
 run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive']
 command_passed: success_message='Passed tests' patch='197'
-report_flaky_tests: patch='197' flaky_tests='None'
+report_flaky_tests: patch='197' flaky_tests='[]'
 run_webkit_patch: ['land-attachment', '--force-clean', '--ignore-builders', '--non-interactive', '--parent-command=commit-queue', 197]
 command_passed: success_message='Landed patch' patch='197'
 """
@@ -227,13 +233,13 @@ command_failed: failure_message='Patch does not pass tests' script_error='MOCK t
         task = CommitQueueTask(commit_queue, patch)
         self._double_flaky_test_counter = 0
 
-        def mock_failing_tests_from_last_run():
+        def mock_failing_results_from_last_run():
             CommitQueueTaskTest._double_flaky_test_counter += 1
             if CommitQueueTaskTest._double_flaky_test_counter % 2:
-                return ['foo.html']
-            return ['bar.html']
+                return [self._mock_test_result('foo.html')]
+            return [self._mock_test_result('bar.html')]
 
-        task._failing_tests_from_last_run = mock_failing_tests_from_last_run
+        task._failing_results_from_last_run = mock_failing_results_from_last_run
         success = OutputCapture().assert_outputs(self, task.run, expected_stderr=expected_stderr)
         self.assertEqual(success, False)
 
diff --git a/Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py b/Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py
index 56af101..91fcb85 100644
--- a/Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py
+++ b/Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py
@@ -126,8 +126,9 @@ If you would like to track this test fix with another bug, please close this bug
         bot_id_string = "Bot: %s  " % (bot_id) if bot_id else ""
         return "%sPort: %s  Platform: %s" % (bot_id_string, self._tool.port().name(), self._tool.platform.display_name())
 
-    def _latest_flake_message(self, flaky_test, patch):
-        flake_message = "The %s just saw %s flake while processing attachment %s on bug %s." % (self._bot_name, flaky_test, patch.id(), patch.bug_id())
+    def _latest_flake_message(self, flaky_result, patch):
+        failure_messages = [failure.message() for failure in flaky_result.failures]
+        flake_message = "The %s just saw %s flake (%s) while processing attachment %s on bug %s." % (self._bot_name, flaky_result.filename, ", ".join(failure_messages), patch.id(), patch.bug_id())
         return "%s\n%s" % (flake_message, self._bot_information())
 
     def _results_diff_path_for_test(self, flaky_test):
@@ -152,11 +153,12 @@ If you would like to track this test fix with another bug, please close this bug
         else:
             self._tool.bugs.post_comment_to_bug(bug.id(), latest_flake_message)
 
-    def report_flaky_tests(self, flaky_tests, patch):
+    def report_flaky_tests(self, flaky_test_results, patch):
         message = "The %s encountered the following flaky tests while processing attachment %s:\n\n" % (self._bot_name, patch.id())
-        for flaky_test in flaky_tests:
+        for flaky_result in flaky_test_results:
+            flaky_test = flaky_result.filename
             bug = self._lookup_bug_for_flaky_test(flaky_test)
-            latest_flake_message = self._latest_flake_message(flaky_test, patch)
+            latest_flake_message = self._latest_flake_message(flaky_result, patch)
             author_emails = self._author_emails_for_test(flaky_test)
             if not bug:
                 _log.info("Bug does not already exist for %s, creating." % flaky_test)
diff --git a/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py b/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py
index 6685837..631f8d1 100644
--- a/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py
@@ -31,6 +31,8 @@ import unittest
 from webkitpy.common.config.committers import Committer
 from webkitpy.common.system.filesystem_mock import MockFileSystem
 from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.layout_tests.layout_package import test_results
+from webkitpy.layout_tests.layout_package import test_failures
 from webkitpy.tool.bot.flakytestreporter import FlakyTestReporter
 from webkitpy.tool.mocktool import MockTool, MockStatusServer
 
@@ -49,6 +51,9 @@ class MockCommitInfo(object):
 
 
 class FlakyTestReporterTest(unittest.TestCase):
+    def _mock_test_result(self, testname):
+        return test_results.TestResult(testname, [test_failures.FailureTextMismatch()])
+
     def _assert_emails_for_test(self, emails):
         tool = MockTool()
         reporter = FlakyTestReporter(tool, 'dummy-queue')
@@ -112,7 +117,7 @@ foo/bar.html has been flaky on the dummy-queue.
 foo/bar.html was authored by abarth at webkit.org.
 http://trac.webkit.org/browser/trunk/LayoutTests/foo/bar.html
 
-The dummy-queue just saw foo/bar.html flake while processing attachment 197 on bug 42.
+The dummy-queue just saw foo/bar.html flake (Text diff mismatch) while processing attachment 197 on bug 42.
 Bot: mock-bot-id  Port: MockPort  Platform: MockPlatform 1.0
 
 The bots will update this with information from each new failure.
@@ -134,7 +139,8 @@ The dummy-queue is continuing to process your patch.
 --- End comment ---
 
 """
-        OutputCapture().assert_outputs(self, reporter.report_flaky_tests, [['foo/bar.html'], patch], expected_stderr=expected_stderr)
+        test_results = [self._mock_test_result('foo/bar.html')]
+        OutputCapture().assert_outputs(self, reporter.report_flaky_tests, [test_results, patch], expected_stderr=expected_stderr)
 
     def test_optional_author_string(self):
         reporter = FlakyTestReporter(MockTool(), 'dummy-queue')
diff --git a/Tools/Scripts/webkitpy/tool/commands/queues.py b/Tools/Scripts/webkitpy/tool/commands/queues.py
index e15555f..7683c7f 100644
--- a/Tools/Scripts/webkitpy/tool/commands/queues.py
+++ b/Tools/Scripts/webkitpy/tool/commands/queues.py
@@ -312,9 +312,9 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler, CommitQueueTaskD
     def refetch_patch(self, patch):
         return self._tool.bugs.fetch_attachment(patch.id())
 
-    def report_flaky_tests(self, patch, flaky_tests):
+    def report_flaky_tests(self, patch, flaky_test_results):
         reporter = FlakyTestReporter(self._tool, self.name)
-        reporter.report_flaky_tests(flaky_tests, patch)
+        reporter.report_flaky_tests(flaky_test_results, patch)
 
     # StepSequenceErrorHandler methods
 
diff --git a/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py b/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py
index d793213..f171075 100644
--- a/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py
@@ -31,6 +31,8 @@ import os
 from webkitpy.common.checkout.scm import CheckoutNeedsUpdate
 from webkitpy.common.net.bugzilla import Attachment
 from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.layout_tests.layout_package import test_results
+from webkitpy.layout_tests.layout_package import test_failures
 from webkitpy.thirdparty.mock import Mock
 from webkitpy.tool.commands.commandtest import CommandsTest
 from webkitpy.tool.commands.queues import *
@@ -198,6 +200,9 @@ class SecondThoughtsCommitQueue(CommitQueue):
 
 
 class CommitQueueTest(QueuesTest):
+    def _mock_test_result(self, testname):
+        return test_results.TestResult(testname, [test_failures.FailureTextMismatch()])
+
     def test_commit_queue(self):
         expected_stderr = {
             "begin_work_queue": self._default_begin_work_queue_stderr("commit-queue", MockSCM.fake_checkout_root),
@@ -333,13 +338,13 @@ MOCK: release_work_item: commit-queue 197
         queue.bind_to_tool(MockTool())
         expected_stderr = """MOCK bug comment: bug_id=76, cc=None
 --- Begin comment ---
-The commit-queue just saw foo/bar.html flake while processing attachment 197 on bug 42.
+The commit-queue just saw foo/bar.html flake (Text diff mismatch) while processing attachment 197 on bug 42.
 Port: MockPort  Platform: MockPlatform 1.0
 --- End comment ---
 
 MOCK bug comment: bug_id=76, cc=None
 --- Begin comment ---
-The commit-queue just saw bar/baz.html flake while processing attachment 197 on bug 42.
+The commit-queue just saw bar/baz.html flake (Text diff mismatch) while processing attachment 197 on bug 42.
 Port: MockPort  Platform: MockPlatform 1.0
 --- End comment ---
 
@@ -353,7 +358,9 @@ The commit-queue is continuing to process your patch.
 --- End comment ---
 
 """
-        OutputCapture().assert_outputs(self, queue.report_flaky_tests, [QueuesTest.mock_work_item, ["foo/bar.html", "bar/baz.html"]], expected_stderr=expected_stderr)
+        test_names = ["foo/bar.html", "bar/baz.html"]
+        test_results = [self._mock_test_result(name) for name in test_names]
+        OutputCapture().assert_outputs(self, queue.report_flaky_tests, [QueuesTest.mock_work_item, test_results], expected_stderr=expected_stderr)
 
     def test_layout_test_results(self):
         queue = CommitQueue()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list