Delete old ews client side code
authoraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 May 2020 20:20:09 +0000 (20:20 +0000)
committeraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 May 2020 20:20:09 +0000 (20:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=211638

Reviewed by Jonathan Bedard.

* Scripts/webkitpy/common/checkout/changelog_unittest.py:
* Scripts/webkitpy/common/config/urls.py: Removed old ews server url.
* Scripts/webkitpy/common/net/statusserver.py: Removed.
* Scripts/webkitpy/common/net/statusserver_mock.py: Removed.
* Scripts/webkitpy/tool/bot/botinfo.py:
* Scripts/webkitpy/tool/bot/botinfo_unittest.py:
* Scripts/webkitpy/tool/bot/flakytestreporter.py:
* Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py:
* Scripts/webkitpy/tool/bot/queueengine.py:
* Scripts/webkitpy/tool/bot/queueengine_unittest.py:
* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
* Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
* Scripts/webkitpy/tool/commands/perfalizer.py:
* Scripts/webkitpy/tool/commands/queues.py:
(AbstractQueue._log_from_script_error_for_upload): Deleted.
(AbstractQueue._update_status_for_script_error): Deleted.
(AbstractPatchQueue._update_status): Deleted.
(AbstractPatchQueue._release_work_item): Deleted.
(AbstractPatchQueue._did_pass): Deleted.
(AbstractPatchQueue._did_fail): Deleted.
* Scripts/webkitpy/tool/commands/queues_unittest.py:
(AbstractQueueTest._assert_run_webkit_patch):
(AbstractQueueTest.test_no_iteration_count):
(PatchProcessingQueueTest.test_upload_results_archive_for_patch):
(AbstractQueueTest._assert_log_message): Deleted.
(AbstractQueueTest.test_log_from_script_error_for_upload): Deleted.
(AbstractPatchQueueTest): Deleted.
(NeedsUpdateSequence): Deleted.
(NeedsUpdateSequence._run): Deleted.
(StyleQueueTest): Deleted.
(StyleQueueTest.test_style_queue_with_style_exception): Deleted.
* Scripts/webkitpy/tool/commands/queuestest.py:
(QueuesTest._default_begin_work_queue_logs):
(QueuesTest._default_begin_work_queue_stderr): Deleted.
* Scripts/webkitpy/tool/commands/sheriffbot.py:
* Scripts/webkitpy/tool/main.py:
* Scripts/webkitpy/tool/mocktool.py:

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

20 files changed:
Tools/ChangeLog
Tools/Scripts/webkitpy/common/checkout/changelog_unittest.py
Tools/Scripts/webkitpy/common/config/urls.py
Tools/Scripts/webkitpy/common/net/statusserver.py [deleted file]
Tools/Scripts/webkitpy/common/net/statusserver_mock.py [deleted file]
Tools/Scripts/webkitpy/tool/bot/botinfo.py
Tools/Scripts/webkitpy/tool/bot/botinfo_unittest.py
Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py
Tools/Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py
Tools/Scripts/webkitpy/tool/bot/queueengine.py
Tools/Scripts/webkitpy/tool/bot/queueengine_unittest.py
Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
Tools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
Tools/Scripts/webkitpy/tool/commands/perfalizer.py
Tools/Scripts/webkitpy/tool/commands/queues.py
Tools/Scripts/webkitpy/tool/commands/queues_unittest.py
Tools/Scripts/webkitpy/tool/commands/queuestest.py
Tools/Scripts/webkitpy/tool/commands/sheriffbot.py
Tools/Scripts/webkitpy/tool/main.py
Tools/Scripts/webkitpy/tool/mocktool.py

index 44c95fd..1c35959 100644 (file)
@@ -1,3 +1,48 @@
+2020-05-08  Aakash Jain  <aakash_jain@apple.com>
+
+        Delete old ews client side code
+        https://bugs.webkit.org/show_bug.cgi?id=211638
+
+        Reviewed by Jonathan Bedard.
+
+        * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+        * Scripts/webkitpy/common/config/urls.py: Removed old ews server url.
+        * Scripts/webkitpy/common/net/statusserver.py: Removed.
+        * Scripts/webkitpy/common/net/statusserver_mock.py: Removed.
+        * Scripts/webkitpy/tool/bot/botinfo.py:
+        * Scripts/webkitpy/tool/bot/botinfo_unittest.py:
+        * Scripts/webkitpy/tool/bot/flakytestreporter.py:
+        * Scripts/webkitpy/tool/bot/flakytestreporter_unittest.py:
+        * Scripts/webkitpy/tool/bot/queueengine.py:
+        * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+        * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+        * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+        * Scripts/webkitpy/tool/commands/perfalizer.py:
+        * Scripts/webkitpy/tool/commands/queues.py:
+        (AbstractQueue._log_from_script_error_for_upload): Deleted.
+        (AbstractQueue._update_status_for_script_error): Deleted.
+        (AbstractPatchQueue._update_status): Deleted.
+        (AbstractPatchQueue._release_work_item): Deleted.
+        (AbstractPatchQueue._did_pass): Deleted.
+        (AbstractPatchQueue._did_fail): Deleted.
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        (AbstractQueueTest._assert_run_webkit_patch):
+        (AbstractQueueTest.test_no_iteration_count):
+        (PatchProcessingQueueTest.test_upload_results_archive_for_patch):
+        (AbstractQueueTest._assert_log_message): Deleted.
+        (AbstractQueueTest.test_log_from_script_error_for_upload): Deleted.
+        (AbstractPatchQueueTest): Deleted.
+        (NeedsUpdateSequence): Deleted.
+        (NeedsUpdateSequence._run): Deleted.
+        (StyleQueueTest): Deleted.
+        (StyleQueueTest.test_style_queue_with_style_exception): Deleted.
+        * Scripts/webkitpy/tool/commands/queuestest.py:
+        (QueuesTest._default_begin_work_queue_logs):
+        (QueuesTest._default_begin_work_queue_stderr): Deleted.
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+        * Scripts/webkitpy/tool/main.py:
+        * Scripts/webkitpy/tool/mocktool.py:
+
 2020-05-08  Alex Christensen  <achristensen@webkit.org>
 
         Limit HTTP referer to 4kb
index 507d196..25a6d38 100644 (file)
@@ -607,10 +607,6 @@ class ChangeLogTest(unittest.TestCase):
 
         Perform some file operations (automatically added comments).
 
-        * QueueStatusServer/config/charts.py: Copied from Tools/QueueStatusServer/model/queuelog.py.
-        (get_time_unit):
-        * QueueStatusServer/handlers/queuecharts.py: Added.
-        (QueueCharts):
         * Scripts/webkitpy/tool/bot/testdata/webkit_sheriff_0.js: Removed.
         * EWSTools/build-vm.sh: Renamed from Tools/EWSTools/cold-boot.sh.
 ''', True),
index a6d027f..046aced 100644 (file)
@@ -55,7 +55,6 @@ buildbot_url = "https://build.webkit.org"
 svn_server_host = "svn.webkit.org"
 svn_server_realm = "<http://svn.webkit.org:80> Mac OS Forge"
 
-statusserver_default_host = "webkit-queues.webkit.org"
 ewsserver_default_host = "ews.webkit.org"
 
 
diff --git a/Tools/Scripts/webkitpy/common/net/statusserver.py b/Tools/Scripts/webkitpy/common/net/statusserver.py
deleted file mode 100644 (file)
index a9e8452..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-# Copyright (C) 2009 Google Inc. All rights reserved.
-# Copyright (C) 2018, 2019 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# 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.
-#
-# This the client designed to talk to Tools/QueueStatusServer.
-
-import sys
-
-from webkitpy.common.config.urls import statusserver_default_host
-
-if sys.version_info > (3, 0):
-    from urllib.error import HTTPError
-    from urllib.request import Request, urlopen
-else:
-    from urllib2 import HTTPError, Request, urlopen
-
-
-class StatusServer:
-    def __init__(self, host=statusserver_default_host, browser=None, bot_id=None):
-        self.set_host(host)
-        self.set_bot_id(bot_id)
-
-    def set_host(self, host):
-        self.host = host
-        self.url = "http://%s" % self.host
-
-    def set_bot_id(self, bot_id):
-        self.bot_id = bot_id
-
-    def results_url_for_status(self, status_id):
-        return None
-
-    def submit_to_ews(self, attachment_id):
-        return None
-
-    def next_work_item(self, queue_name):
-        return None
-
-    def release_work_item(self, queue_name, patch):
-        return None
-
-    def release_lock(self, queue_name, patch):
-        return None
-
-    def update_work_items(self, queue_name, high_priority_work_items, work_items):
-        return None
-
-    def update_status(self, queue_name, status, patch=None, results_file=None):
-        return None
-
-    def update_svn_revision(self, svn_revision_number, broken_bot):
-        return None
-
-    def patch_status(self, queue_name, patch_id):
-        return None
-
-    def svn_revision(self, svn_revision_number):
-        return None
diff --git a/Tools/Scripts/webkitpy/common/net/statusserver_mock.py b/Tools/Scripts/webkitpy/common/net/statusserver_mock.py
deleted file mode 100644 (file)
index 93023a3..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-# Copyright (C) 2011 Google Inc. All rights reserved.
-# Copyright (C) 2019 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#    * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#    * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#    * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# 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.
-
-import logging
-
-_log = logging.getLogger(__name__)
-
-
-class MockStatusServer(object):
-
-    def __init__(self, bot_id=None, work_items=None):
-        self.host = "example.com"
-        self.bot_id = bot_id
-        self._work_items = work_items or []
-
-    def patch_status(self, queue_name, patch_id):
-        return None
-
-    def svn_revision(self, svn_revision):
-        return None
-
-    def next_work_item(self, queue_name):
-        if not self._work_items:
-            return None
-        return self._work_items.pop(0)
-
-    def release_work_item(self, queue_name, patch):
-        _log.info("MOCK: release_work_item: %s %s" % (queue_name, patch.id()))
-
-    def release_lock(self, queue_name, patch):
-        _log.info("MOCK: release_lock: %s %s" % (queue_name, patch.id()))
-
-    def update_work_items(self, queue_name, high_priority_work_items, work_items):
-        self._work_items = work_items
-        _log.info("MOCK: update_work_items: %s %s" % (queue_name, high_priority_work_items + work_items))
-
-    def submit_to_ews(self, patch_id):
-        _log.info("MOCK: submit_to_old_ews: %s" % (patch_id))
-
-    def update_status(self, queue_name, status, patch=None, results_file=None):
-        _log.info("MOCK: update_status: %s %s" % (queue_name, status))
-        return 187
-
-    def update_svn_revision(self, svn_revision, broken_bot):
-        return 191
-
-    def results_url_for_status(self, status_id):
-        return "http://dummy_url"
index 11a3d40..52b217f 100644 (file)
@@ -34,7 +34,4 @@ class BotInfo(object):
         self._port_name = port_name
 
     def summary_text(self):
-        # bot_id is also stored on the options dictionary on the tool.
-        bot_id = self._tool.status_server.bot_id
-        bot_id_string = "Bot: %s  " % (bot_id) if bot_id else ""
-        return "%sPort: %s  Platform: %s" % (bot_id_string, self._port_name, self._tool.platform.display_name())
+        return "Port: %s  Platform: %s" % (self._port_name, self._tool.platform.display_name())
index 5cc18bc..83414bf 100644 (file)
@@ -30,7 +30,6 @@ import unittest
 
 from webkitpy.tool.bot.botinfo import BotInfo
 from webkitpy.tool.mocktool import MockTool
-from webkitpy.common.net.statusserver_mock import MockStatusServer
 from webkitpy.port.test import TestPort
 
 
@@ -38,5 +37,4 @@ class BotInfoTest(unittest.TestCase):
 
     def test_summary_text(self):
         tool = MockTool()
-        tool.status_server = MockStatusServer("MockBotId")
-        self.assertEqual(BotInfo(tool, 'port-name').summary_text(), "Bot: MockBotId  Port: port-name  Platform: MockPlatform 1.0")
+        self.assertEqual(BotInfo(tool, 'port-name').summary_text(), "Port: port-name  Platform: MockPlatform 1.0")
index 25302b3..122e479 100644 (file)
@@ -156,15 +156,14 @@ If you would like to track this test fix with another bug, please close this bug
         # Check to make sure that the path makes sense.
         # Since we're not actually getting this path from the results.html
         # there is a chance it's wrong.
-        bot_id = self._tool.status_server.bot_id or "bot"
         archive_path = self._find_in_archive(results_diff_path, results_archive_zip)
         if archive_path:
             results_diff = results_archive_zip.read(archive_path)
-            description = "Failure diff from %s" % bot_id
+            description = "Failure diff from bot"
             self._tool.bugs.add_attachment_to_bug(flake_bug_id, results_diff, description, filename="failure.diff")
         else:
             _log.warn("%s does not exist in results archive, uploading entire archive." % results_diff_path)
-            description = "Archive of layout-test-results from %s" % bot_id
+            description = "Archive of layout-test-results from bot"
             # results_archive is a ZipFile object, grab the File object (.fp) to pass to Mechanize for uploading.
             results_archive_file = results_archive_zip.fp
             # Rewind the file object to start (since Mechanize won't do that automatically)
index 1bd9d7c..21bce2f 100644 (file)
@@ -36,7 +36,6 @@ from webkitpy.layout_tests.models import test_failures
 from webkitpy.thirdparty.mock import Mock
 from webkitpy.tool.bot.flakytestreporter import FlakyTestReporter
 from webkitpy.tool.mocktool import MockTool
-from webkitpy.common.net.statusserver_mock import MockStatusServer
 
 
 # Creating fake CommitInfos is a pain, so we use a mock one here.
@@ -101,7 +100,6 @@ blocked: 50856
     def test_report_flaky_tests_creating_bug(self):
         tool = MockTool()
         tool.filesystem = MockFileSystem({"/mock-results/foo/bar-diffs.txt": "mock"})
-        tool.status_server = MockStatusServer(bot_id="mock-bot-id")
         reporter = FlakyTestReporter(tool, 'dummy-queue')
         reporter._lookup_bug_for_flaky_test = lambda bug_id: None
         patch = tool.bugs.fetch_attachment(10000)
@@ -115,7 +113,7 @@ foo/bar.html was authored by abarth@webkit.org.
 https://trac.webkit.org/browser/trunk/LayoutTests/foo/bar.html
 
 The dummy-queue just saw foo/bar.html flake (text diff) while processing attachment 10000 on bug 50000.
-Bot: mock-bot-id  Port: MockPort  Platform: MockPlatform 1.0
+Port: MockPort  Platform: MockPlatform 1.0
 
 The bots will update this with information from each new failure.
 
@@ -126,7 +124,7 @@ If you would like to track this test fix with another bug, please close this bug
 component: Tools / Tests
 cc: abarth@webkit.org
 blocked: 50856
-MOCK add_attachment_to_bug: bug_id=60001, description=Failure diff from mock-bot-id filename=failure.diff mimetype=None
+MOCK add_attachment_to_bug: bug_id=60001, description=Failure diff from bot filename=failure.diff mimetype=None
 MOCK bug comment: bug_id=50000, cc=None, see_also=None
 --- Begin comment ---
 The dummy-queue encountered the following flaky tests while processing attachment 10000:
index 63544d2..83587a4 100644 (file)
@@ -127,7 +127,6 @@ class QueueEngine:
 
     def _stopping(self, message):
         _log.info(message)
-        self._delegate.stop_work_queue(message)
         logging.getLogger("webkitpy").removeHandler(self._log_handler)
         # Be careful to shut down our OutputTee or the unit tests will be unhappy.
         self._ensure_work_log_closed()
index 9fab33b..aa40d31 100644 (file)
@@ -53,7 +53,6 @@ class LoggingDelegate(QueueEngineDelegate):
         'process_work_item',
         'work_item_log_path',
         'should_continue_work_queue',
-        'stop_work_queue',
     ]
 
     def record(self, method_name):
@@ -122,7 +121,6 @@ class QueueEngineTest(unittest.TestCase):
         expected_callbacks = LoggingDelegate.expected_callbacks[:]
         expected_callbacks.remove('work_item_log_path')
         self._run_engine(delegate)
-        self.assertEqual(delegate.stop_message, "Delegate terminated queue.")
         self.assertEqual(delegate._callbacks, expected_callbacks)
         self.assertTrue(os.path.exists(os.path.join(self.temp_dir, "queue_log_path")))
 
@@ -151,16 +149,11 @@ class QueueEngineTest(unittest.TestCase):
 
     def _test_terminating_queue(self, exception, termination_message):
         work_item_index = LoggingDelegate.expected_callbacks.index('process_work_item')
-        # The terminating error should be handled right after process_work_item.
-        # There should be no other callbacks after stop_work_queue.
         expected_callbacks = LoggingDelegate.expected_callbacks[:work_item_index + 1]
-        expected_callbacks.append("stop_work_queue")
 
         delegate = RaisingDelegate(self, exception)
         self._run_engine(delegate, termination_message=termination_message)
-
         self.assertEqual(delegate._callbacks, expected_callbacks)
-        self.assertEqual(delegate.stop_message, termination_message)
 
     def test_terminating_error(self):
         self._test_terminating_queue(KeyboardInterrupt(), "User terminated queue.")
index d9014e4..98d2276 100644 (file)
@@ -84,8 +84,7 @@ class AbstractEarlyWarningSystem(AbstractReviewQueue, EarlyWarningSystemTaskDele
         if not extra_message_text:
             return  # Don't comment on Bugzilla if we don't have failing tests.
 
-        results_link = tool.status_server.results_url_for_status(status_id)
-        message = "Attachment %s did not pass %s (%s):\nOutput: %s" % (patch.id(), self.name, self.port_name, results_link)
+        message = "Attachment %s did not pass %s (%s)" % (patch.id(), self.name, self.port_name)
         if extra_message_text:
             message += "\n\n%s" % extra_message_text
         # FIXME: We might want to add some text about rejecting from the commit-queue in
@@ -123,7 +122,6 @@ class AbstractEarlyWarningSystem(AbstractReviewQueue, EarlyWarningSystemTaskDele
             results_archive = task.results_archive_from_patch_test_run(patch)
             if results_archive:
                 self._upload_results_archive_for_patch(patch, results_archive)
-            self._did_fail(patch)
             raise e
 
     # EarlyWarningSystemDelegate methods
@@ -135,11 +133,10 @@ class AbstractEarlyWarningSystem(AbstractReviewQueue, EarlyWarningSystemTaskDele
         self.run_webkit_patch(command + [self._deprecated_port.flag()] + (['--architecture=%s' % self._port.architecture()] if self._port.architecture() and self._port.did_override_architecture else []))
 
     def command_passed(self, message, patch):
-        self._update_status(message, patch=patch)
+        pass
 
     def command_failed(self, message, script_error, patch):
-        failure_log = self._log_from_script_error_for_upload(script_error)
-        return self._update_status(message, patch=patch, results_file=failure_log)
+        pass
 
     def test_results(self):
         return self._test_results_reader.results()
index 391dab4..6054d53 100644 (file)
@@ -132,34 +132,25 @@ class EarlyWarningSystemTest(QueuesTest):
         }
 
         if ews.should_build:
-            build_line = "Running: webkit-patch build --no-clean --no-update --build-style=%(build_style)s --group=%(group)s --port=%(port)s%(architecture)s\nMOCK: update_status: %(name)s Built patch\n" % string_replacements
+            build_line = "Running: webkit-patch build --no-clean --no-update --build-style=%(build_style)s --group=%(group)s --port=%(port)s%(architecture)s\n" % string_replacements
         else:
             build_line = ""
         string_replacements['build_line'] = build_line
 
         if ews.run_tests:
-            run_tests_line = "Running: webkit-patch build-and-test --no-clean --no-update --test --non-interactive --build-style=%(build_style)s --group=%(group)s --port=%(port)s%(architecture)s\nMOCK: update_status: %(name)s Passed tests\n" % string_replacements
+            run_tests_line = "Running: webkit-patch build-and-test --no-clean --no-update --test --non-interactive --build-style=%(build_style)s --group=%(group)s --port=%(port)s%(architecture)s\n" % string_replacements
         else:
             run_tests_line = ""
         string_replacements['run_tests_line'] = run_tests_line
 
-        if conclusive:
-            result_lines = "MOCK: update_status: %(name)s Pass\nMOCK: release_work_item: %(name)s 10000\n" % string_replacements
-        else:
-            result_lines = "MOCK: release_lock: %(name)s 10000\n" % string_replacements
-        string_replacements['result_lines'] = result_lines
+        string_replacements['result_lines'] = ""
 
         expected_logs = {
             "begin_work_queue": self._default_begin_work_queue_logs(ews.name),
-            "process_work_item": """MOCK: update_status: %(name)s Started processing patch
-Running: webkit-patch clean --port=%(port)s%(architecture)s
-MOCK: update_status: %(name)s Cleaned working directory
+            "process_work_item": """Running: webkit-patch clean --port=%(port)s%(architecture)s
 Running: webkit-patch update --port=%(port)s%(architecture)s
-MOCK: update_status: %(name)s Updated working directory
 Running: webkit-patch apply-attachment --no-update --non-interactive 10000 --port=%(port)s%(architecture)s
-MOCK: update_status: %(name)s Applied patch
 Running: webkit-patch check-patch-relevance --quiet --group=%(group)s --port=%(port)s%(architecture)s
-MOCK: update_status: %(name)s Checked relevance of patch
 %(build_line)s%(run_tests_line)s%(result_lines)s""" % string_replacements,
             "handle_unexpected_error": "Mock error message\n",
             "handle_script_error": "ScriptError error message\n\nMOCK output\n",
index 69a906d..9d2359c 100644 (file)
@@ -196,7 +196,7 @@ class Perfalizer(AbstractQueue, StepSequenceErrorHandler):
         return None
 
     def _is_old_failure(self, revision):
-        return self._tool.status_server.svn_revision(revision)
+        return False
 
     def next_work_item(self):
         self._irc_bot.process_pending_messages()
index 50c6a4f..81ba96e 100644 (file)
@@ -86,8 +86,6 @@ class AbstractQueue(Command, QueueEngineDelegate):
         # FIXME: We must always pass global options and their value in one argument
         # because our global option code looks for the first argument which does
         # not begin with "-" and assumes that is the command name.
-        if self._tool.status_server.bot_id:
-            webkit_patch_args += ["--bot-id=%s" % self._tool.status_server.bot_id]
         if self._options.port:
             webkit_patch_args += ["--port=%s" % self._options.port]
         webkit_patch_args.extend(args)
@@ -122,10 +120,9 @@ class AbstractQueue(Command, QueueEngineDelegate):
                 _log.error("User declined.")
                 sys.exit(1)
         _log.info("Running WebKit %s." % self.name)
-        self._tool.status_server.update_status(self.name, "Starting Queue")
 
     def stop_work_queue(self, reason):
-        self._tool.status_server.update_status(self.name, "Stopping Queue, reason: %s" % reason)
+        pass
 
     def should_continue_work_queue(self):
         self._iteration_count += 1
@@ -149,71 +146,19 @@ class AbstractQueue(Command, QueueEngineDelegate):
         self._tool = tool  # FIXME: This code is wrong too!  Command.bind_to_tool handles this!
         return engine(self.name, self, self._tool.wakeup_event, self._options.seconds_to_sleep).run()
 
-    @classmethod
-    def _log_from_script_error_for_upload(cls, script_error, output_limit=None):
-        # We have seen request timeouts with app engine due to large
-        # log uploads.  Trying only the last 512k.
-        if not output_limit:
-            output_limit = 512 * 1024  # 512k
-        output = script_error.message_with_output(output_limit=output_limit)
-        # We pre-encode the string to a byte array before passing it
-        # to status_server, because ClientForm (part of mechanize)
-        # wants a file-like object with pre-encoded data.
-        return BytesIO(output.encode("utf-8"))
-
-    @classmethod
-    def _update_status_for_script_error(cls, tool, state, script_error, is_error=False):
-        message = str(script_error)
-        if is_error:
-            message = "Error: %s" % message
-        failure_log = cls._log_from_script_error_for_upload(script_error)
-        return tool.status_server.update_status(cls.name, message, state["patch"], failure_log)
-
 
 class AbstractPatchQueue(AbstractQueue):
-    def _update_status(self, message, patch=None, results_file=None):
-        return self._tool.status_server.update_status(self.name, message, patch, results_file)
-
     def _next_patch(self):
-        # FIXME: Bugzilla accessibility should be checked here; if it's unaccessible,
-        # it should return None.
-        patch = None
-        while not patch:
-            patch_id = self._tool.status_server.next_work_item(self.name)
-            if not patch_id:
-                return None
-            patch = self._tool.bugs.fetch_attachment(patch_id)
-            if not patch:
-                # FIXME: Using a fake patch because release_work_item has the wrong API.
-                # We also don't really need to release the lock (although that's fine),
-                # mostly we just need to remove this bogus patch from our queue.
-                # If for some reason bugzilla is just down, then it will be re-fed later.
-                fake_patch = Attachment({'id': patch_id}, None)
-                self._did_skip(fake_patch)
-        return patch
-
-    def _release_work_item(self, patch):
-        self._tool.status_server.release_work_item(self.name, patch)
-
-    def _did_pass(self, patch):
-        self._update_status(self._pass_status, patch)
-        self._release_work_item(patch)
-
-    def _did_fail(self, patch):
-        self._update_status(self._fail_status, patch)
-        self._release_work_item(patch)
+        pass
 
     def _did_error(self, patch, reason):
-        message = "%s: %s" % (self._error_status, reason)
-        self._update_status(message, patch)
-        self._release_work_item(patch)
+        pass
 
     def _did_skip(self, patch):
-        self._update_status(self._skip_status, patch)
-        self._release_work_item(patch)
+        pass
 
     def _unlock_patch(self, patch):
-        self._tool.status_server.release_lock(self.name, patch)
+        pass
 
     def work_item_log_path(self, patch):
         return os.path.join(self._log_directory(), "%s.log" % patch.bug_id())
@@ -271,8 +216,7 @@ class PatchProcessingQueue(AbstractPatchQueue):
         if not self._port:
             self._create_port()
 
-        bot_id = self._tool.status_server.bot_id or "bot"
-        description = "Archive of layout-test-results from %s for %s" % (bot_id, self._port.name())
+        description = "Archive of layout-test-results for %s" % (self._port.name())
         # results_archive is a ZipFile object, grab the File object (.fp) to pass to Mechanize for uploading.
         results_archive_file = results_archive_zip.fp
         # Rewind the file object to start (since Mechanize won't do that automatically)
@@ -302,13 +246,10 @@ class AbstractReviewQueue(PatchProcessingQueue, StepSequenceErrorHandler):
         PatchProcessingQueue.begin_work_queue(self)
 
     def next_work_item(self):
-        return self._next_patch()
+        return None
 
     def process_work_item(self, patch):
-        self._update_status("Started processing patch", patch)
         passed = self.review_patch(patch)
-        if passed:
-            self._did_pass(patch)
         return passed
 
     def handle_unexpected_error(self, patch, message):
@@ -331,9 +272,6 @@ class StyleQueue(AbstractReviewQueue, StyleQueueTaskDelegate):
         task = StyleQueueTask(self, patch)
         try:
             style_check_succeeded = task.run()
-            if not style_check_succeeded:
-                # Caller unlocks when review_patch returns True, so we only need to unlock on transient failure.
-                self._unlock_patch(patch)
             return style_check_succeeded
         except UnableToApplyPatch as e:
             self._did_error(patch, "%s unable to apply patch." % self.name)
@@ -345,7 +283,6 @@ class StyleQueue(AbstractReviewQueue, StyleQueueTaskDelegate):
             output = re.sub(r'Failed to run .+ exit_code: 1', '', e.output)
             message = "Attachment %s did not pass %s:\n\n%s\n\nIf any of these errors are false positives, please file a bug against check-webkit-style." % (patch.id(), self.name, output)
             self._tool.bugs.post_comment_to_bug(patch.bug_id(), message, cc=self.watchers)
-            self._did_fail(patch)
             return False
         return True
 
@@ -355,11 +292,10 @@ class StyleQueue(AbstractReviewQueue, StyleQueueTaskDelegate):
         self.run_webkit_patch(command)
 
     def command_passed(self, message, patch):
-        self._update_status(message, patch=patch)
+        pass
 
     def command_failed(self, message, script_error, patch):
-        failure_log = self._log_from_script_error_for_upload(script_error)
-        return self._update_status(message, patch=patch, results_file=failure_log)
+        pass
 
     def expected_failures(self):
         return None
index 6b427c4..fc6210d 100644 (file)
@@ -42,7 +42,6 @@ from webkitpy.tool.commands.commandtest import CommandsTest
 from webkitpy.tool.commands.queues import *
 from webkitpy.tool.commands.queuestest import QueuesTest
 from webkitpy.tool.commands.stepsequence import StepSequence
-from webkitpy.common.net.statusserver_mock import MockStatusServer
 from webkitpy.tool.mocktool import MockTool, MockOptions
 
 
@@ -61,14 +60,13 @@ class AbstractQueueTest(CommandsTest):
     def _assert_run_webkit_patch(self, run_args, port=None):
         queue = TestQueue()
         tool = MockTool()
-        tool.status_server.bot_id = "gort"
         tool.executive = Mock()
         queue.bind_to_tool(tool)
         queue._options = Mock()
         queue._options.port = port
 
         queue.run_webkit_patch(run_args)
-        expected_run_args = ["echo", "--bot-id=gort"]
+        expected_run_args = ["echo"]
         if port:
             expected_run_args.append("--port=%s" % port)
         expected_run_args.extend(run_args)
@@ -96,38 +94,6 @@ class AbstractQueueTest(CommandsTest):
         self.assertTrue(queue.should_continue_work_queue())
         self.assertTrue(queue.should_continue_work_queue())
 
-    def _assert_log_message(self, script_error, log_message):
-        failure_log = AbstractQueue._log_from_script_error_for_upload(script_error, output_limit=10)
-        self.assertTrue(failure_log.read(), log_message)
-
-    def test_log_from_script_error_for_upload(self):
-        self._assert_log_message(ScriptError("test"), "test")
-        unicode_tor = u"WebKit \u2661 Tor Arne Vestb\u00F8!"
-        utf8_tor = unicode_tor.encode("utf-8")
-        self._assert_log_message(ScriptError(unicode_tor), utf8_tor)
-        script_error = ScriptError(unicode_tor, output=unicode_tor)
-        expected_output = "%s\nLast %s characters of output:\n%s" % (utf8_tor, 10, utf8_tor[-10:])
-        self._assert_log_message(script_error, expected_output)
-
-
-class AbstractPatchQueueTest(CommandsTest):
-    def test_next_patch(self):
-        queue = AbstractPatchQueue()
-        tool = MockTool()
-        queue.bind_to_tool(tool)
-        queue._options = Mock()
-        queue._options.port = None
-        self.assertIsNone(queue._next_patch())
-        tool.status_server = MockStatusServer(work_items=[2, 10000, 10001])
-        expected_stdout = "MOCK: fetch_attachment: 2 is not a known attachment id\n"  # A mock-only message to prevent us from making mistakes.
-        expected_logs = """MOCK: update_status: None Skip
-MOCK: release_work_item: None 2
-"""
-        patch = OutputCapture().assert_outputs(self, queue._next_patch, expected_stdout=expected_stdout, expected_logs=expected_logs)
-        # The patch.id() == 2 is ignored because it doesn't exist.
-        self.assertEqual(patch.id(), 10000)
-        self.assertEqual(queue._next_patch().id(), 10001)
-        self.assertEqual(queue._next_patch(), None)    # When the queue is empty
 
 
 class PatchProcessingQueueTest(CommandsTest):
@@ -139,7 +105,7 @@ class PatchProcessingQueueTest(CommandsTest):
         queue._options = Mock()
         queue._options.port = None
         patch = queue._tool.bugs.fetch_attachment(10001)
-        expected_logs = """MOCK add_attachment_to_bug: bug_id=50000, description=Archive of layout-test-results from bot for mac-highsierra filename=layout-test-results.zip mimetype=None
+        expected_logs = """MOCK add_attachment_to_bug: bug_id=50000, description=Archive of layout-test-results for mac-highsierra filename=layout-test-results.zip mimetype=None
 -- Begin comment --
 The attached test failures were seen while running run-webkit-tests on the mock-queue.
 Port: mac-highsierra  Platform: MockPlatform 1.0
@@ -157,19 +123,11 @@ class StyleQueueTest(QueuesTest):
     def test_style_queue_with_style_exception(self):
         expected_logs = {
             "begin_work_queue": self._default_begin_work_queue_logs("style-queue"),
-            "process_work_item": """MOCK: update_status: style-queue Started processing patch
-Running: webkit-patch clean
-MOCK: update_status: style-queue Cleaned working directory
+            "process_work_item": """Running: webkit-patch clean
 Running: webkit-patch update
-MOCK: update_status: style-queue Updated working directory
 Running: webkit-patch apply-attachment --no-update --non-interactive 10000
-MOCK: update_status: style-queue Applied patch
 Running: webkit-patch apply-watchlist-local 50000
-MOCK: update_status: style-queue Watchlist applied
 Running: webkit-patch check-style-local --non-interactive --quiet
-MOCK: update_status: style-queue Style checked
-MOCK: update_status: style-queue Pass
-MOCK: release_work_item: style-queue 10000
 """,
             "handle_unexpected_error": "Mock error message\n",
             "handle_script_error": "MOCK output\n",
@@ -180,22 +138,14 @@ MOCK: release_work_item: style-queue 10000
     def test_style_queue_with_watch_list_exception(self):
         expected_logs = {
             "begin_work_queue": self._default_begin_work_queue_logs("style-queue"),
-            "process_work_item": """MOCK: update_status: style-queue Started processing patch
-Running: webkit-patch clean
-MOCK: update_status: style-queue Cleaned working directory
+            "process_work_item": """Running: webkit-patch clean
 Running: webkit-patch update
-MOCK: update_status: style-queue Updated working directory
 Running: webkit-patch apply-attachment --no-update --non-interactive 10000
-MOCK: update_status: style-queue Applied patch
 Running: webkit-patch apply-watchlist-local 50000
 Exception for ['echo', 'apply-watchlist-local', 50000]
 
 MOCK command output
-MOCK: update_status: style-queue Unabled to apply watchlist
 Running: webkit-patch check-style-local --non-interactive --quiet
-MOCK: update_status: style-queue Style checked
-MOCK: update_status: style-queue Pass
-MOCK: release_work_item: style-queue 10000
 """,
             "handle_unexpected_error": "Mock error message\n",
             "handle_script_error": "MOCK output\n",
@@ -208,9 +158,6 @@ MOCK: release_work_item: style-queue 10000
         patch = tool.bugs.fetch_attachment(10007)  # _patch8, resolved bug, without review flag, not marked obsolete (maybe already landed)
         expected_logs = {
             "begin_work_queue": self._default_begin_work_queue_logs("style-queue"),
-            "process_work_item": """MOCK: update_status: style-queue Started processing patch
-MOCK: update_status: style-queue Error: style-queue did not process patch. Reason: Bug is already closed.
-MOCK: release_work_item: style-queue 10007
-""",
+            "process_work_item": "",
         }
         self.assert_queue_outputs(StyleQueue(), tool=tool, work_item=patch, expected_logs=expected_logs)
index 81d79f6..5dbdbb7 100644 (file)
@@ -65,14 +65,10 @@ class QueuesTest(unittest.TestCase):
                 expected_exception=exception,
                 expected_logs=logs)
 
-    def _default_begin_work_queue_stderr(self, name):
-        string_replacements = {"name": name}
-        return "MOCK: update_status: %(name)s Starting Queue\n" % string_replacements
-
     def _default_begin_work_queue_logs(self, name):
         checkout_dir = '/mock-checkout'
         string_replacements = {"name": name, 'checkout_dir': checkout_dir}
-        return "CAUTION: %(name)s will discard all local changes in \"%(checkout_dir)s\"\nRunning WebKit %(name)s.\nMOCK: update_status: %(name)s Starting Queue\n" % string_replacements
+        return "CAUTION: %(name)s will discard all local changes in \"%(checkout_dir)s\"\nRunning WebKit %(name)s.\n" % string_replacements
 
     def assert_queue_outputs(self, queue, args=None, work_item=None, expected_stdout=None, expected_stderr=None, expected_exceptions=None, expected_logs=None, options=None, tool=None):
         if not tool:
index 19799ba..2a1bd69 100644 (file)
@@ -55,7 +55,7 @@ class SheriffBot(AbstractQueue, StepSequenceErrorHandler):
         return None
 
     def _is_old_failure(self, revision):
-        return self._tool.status_server.svn_revision(revision)
+        return False
 
     def next_work_item(self):
         self._irc_bot.process_pending_messages()
index d508e4e..36f49c1 100644 (file)
@@ -37,7 +37,6 @@ from webkitpy.common.config.ports import DeprecatedPort
 from webkitpy.common.host import Host
 from webkitpy.common.net.irc import ircproxy
 from webkitpy.common.net.ewsserver import EWSServer
-from webkitpy.common.net.statusserver import StatusServer
 from webkitpy.tool.multicommandtool import MultiCommandTool
 from webkitpy.tool import commands
 
@@ -46,8 +45,6 @@ class WebKitPatch(MultiCommandTool, Host):
     global_options = [
         make_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="enable all logging"),
         make_option("-d", "--directory", action="append", dest="patch_directories", default=[], help="Directory to look at for changed files"),
-        make_option("--status-host", action="store", dest="status_host", type="string", help="Hostname (e.g. localhost or commit.webkit.org) where status updates should be posted."),
-        make_option("--bot-id", action="store", dest="bot_id", type="string", help="Identifier for this bot (if multiple bots are running for a queue)"),
         make_option("--irc-password", action="store", dest="irc_password", type="string", help="Password to use when communicating via IRC."),
         make_option("--seconds-to-sleep", action="store", default=120, type="int", help="Number of seconds to sleep in the task queue."),
         make_option("--port", action="store", dest="port", default=None, help="Specify a port (e.g., mac, gtk, ...)."),
@@ -57,7 +54,6 @@ class WebKitPatch(MultiCommandTool, Host):
         MultiCommandTool.__init__(self)
         Host.__init__(self)
         self._path = path
-        self.status_server = StatusServer()
         self.ews_server = EWSServer()
 
         self.wakeup_event = threading.Event()
@@ -94,10 +90,6 @@ class WebKitPatch(MultiCommandTool, Host):
     # FIXME: This may be unnecessary since we pass global options to all commands during execute() as well.
     def handle_global_options(self, options):
         self.initialize_scm(options.patch_directories)
-        if options.status_host:
-            self.status_server.set_host(options.status_host)
-        if options.bot_id:
-            self.status_server.set_bot_id(options.bot_id)
         if options.irc_password:
             self.irc_password = options.irc_password
         # If options.port is None, we'll get the default port for this platform.
index a9c8b2b..790ddf7 100644 (file)
@@ -32,7 +32,6 @@ import threading
 from webkitpy.common.host_mock import MockHost
 from webkitpy.common.net.buildbot.buildbot_mock import MockBuildBot
 from webkitpy.common.net.ewsserver_mock import MockEWSServer
-from webkitpy.common.net.statusserver_mock import MockStatusServer
 from webkitpy.common.net.irc.irc_mock import MockIRC
 
 # FIXME: Old-style "Ports" need to die and be replaced by modern layout_tests.port which needs to move to common.
@@ -67,7 +66,6 @@ class MockTool(MockHost):
         MockHost.__init__(self, *args, **kwargs)
 
         self._deprecated_port = MockPort()
-        self.status_server = MockStatusServer()
         self.ews_server = MockEWSServer()
 
         self._irc = None