<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[204289] trunk/Tools</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/204289">204289</a></dd>
<dt>Author</dt> <dd>aakash_jain@apple.com</dd>
<dt>Date</dt> <dd>2016-08-09 12:30:16 -0700 (Tue, 09 Aug 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>EWS logging should ensure the logging to file is stopped on queue termination
https://bugs.webkit.org/show_bug.cgi?id=160698
rdar://problem/24464570
Reviewed by Daniel Bates.
* Scripts/webkitpy/tool/bot/queueengine.py:
(QueueEngine._stopping): Stop logging to file on queue termination.
(QueueEngine._begin_logging): Configure the Python logger to log to file.
* Scripts/webkitpy/common/system/logutils.py:
(configure_logger_to_log_to_file): Return the handler so as to enable caller to remove it later.
* Scripts/webkitpy/tool/bot/queueengine_unittest.py:
(QueueEngineTest._run_engine): Removed extra newline character to improve log readability.
* Scripts/webkitpy/tool/commands/queues.py:
(AbstractQueue._log_directory): Reverting to os.path.join as we don't have host object.
(AbstractQueue.queue_log_path): Same.
(AbstractQueue.begin_work_queue): Removed logging initialization, it is now being done in QueueEngine.
(AbstractQueue.__init__): Removed host parameter, not required anymore, it was required by logging initialization
which moved to QueueEngine now.
(PatchProcessingQueue.__init__): Same.
(CommitQueue.__init__): Same.
(AbstractReviewQueue.__init__): Same.
(StyleQueue.__init__): Same.
* Scripts/webkitpy/tool/commands/queues_unittest.py:
(TestCommitQueue): Removed host parameter.
(TestCommitQueue.__init__): Same.
(AbstractPatchQueueTest.test_next_patch): Same.
(PatchProcessingQueueTest.test_upload_results_archive_for_patch): Same.
(test_commit_queue_failure): Same.
(mock_run_webkit_patch):
(MockCommitQueueTask.results_from_patch_test_run): Same.
(test_rollout_lands): Same.
(test_non_valid_patch): Same.
(test_auto_retry): Same.
(test_style_queue_with_watch_list_exception): Same.
(TestQueue.__init__): Deleted.
(TestReviewQueue.__init__): Deleted.
(TestFeederQueue.__init__): Deleted.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsScriptswebkitpycommonsystemlogutilspy">trunk/Tools/Scripts/webkitpy/common/system/logutils.py</a></li>
<li><a href="#trunkToolsScriptswebkitpytoolbotqueueenginepy">trunk/Tools/Scripts/webkitpy/tool/bot/queueengine.py</a></li>
<li><a href="#trunkToolsScriptswebkitpytoolbotqueueengine_unittestpy">trunk/Tools/Scripts/webkitpy/tool/bot/queueengine_unittest.py</a></li>
<li><a href="#trunkToolsScriptswebkitpytoolcommandsqueuespy">trunk/Tools/Scripts/webkitpy/tool/commands/queues.py</a></li>
<li><a href="#trunkToolsScriptswebkitpytoolcommandsqueues_unittestpy">trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (204288 => 204289)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-08-09 18:52:11 UTC (rev 204288)
+++ trunk/Tools/ChangeLog        2016-08-09 19:30:16 UTC (rev 204289)
</span><span class="lines">@@ -1,3 +1,44 @@
</span><ins>+2016-08-09 Aakash Jain <aakash_jain@apple.com>
+
+ EWS logging should ensure the logging to file is stopped on queue termination
+ https://bugs.webkit.org/show_bug.cgi?id=160698
+ rdar://problem/24464570
+
+ Reviewed by Daniel Bates.
+
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ (QueueEngine._stopping): Stop logging to file on queue termination.
+ (QueueEngine._begin_logging): Configure the Python logger to log to file.
+ * Scripts/webkitpy/common/system/logutils.py:
+ (configure_logger_to_log_to_file): Return the handler so as to enable caller to remove it later.
+ * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+ (QueueEngineTest._run_engine): Removed extra newline character to improve log readability.
+ * Scripts/webkitpy/tool/commands/queues.py:
+ (AbstractQueue._log_directory): Reverting to os.path.join as we don't have host object.
+ (AbstractQueue.queue_log_path): Same.
+ (AbstractQueue.begin_work_queue): Removed logging initialization, it is now being done in QueueEngine.
+ (AbstractQueue.__init__): Removed host parameter, not required anymore, it was required by logging initialization
+ which moved to QueueEngine now.
+ (PatchProcessingQueue.__init__): Same.
+ (CommitQueue.__init__): Same.
+ (AbstractReviewQueue.__init__): Same.
+ (StyleQueue.__init__): Same.
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ (TestCommitQueue): Removed host parameter.
+ (TestCommitQueue.__init__): Same.
+ (AbstractPatchQueueTest.test_next_patch): Same.
+ (PatchProcessingQueueTest.test_upload_results_archive_for_patch): Same.
+ (test_commit_queue_failure): Same.
+ (mock_run_webkit_patch):
+ (MockCommitQueueTask.results_from_patch_test_run): Same.
+ (test_rollout_lands): Same.
+ (test_non_valid_patch): Same.
+ (test_auto_retry): Same.
+ (test_style_queue_with_watch_list_exception): Same.
+ (TestQueue.__init__): Deleted.
+ (TestReviewQueue.__init__): Deleted.
+ (TestFeederQueue.__init__): Deleted.
+
</ins><span class="cx"> 2016-08-09 Konstantin Tokarev <annulen@yandex.ru>
</span><span class="cx">
</span><span class="cx"> webkit-gtk tarball fails to build due to missing files
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpycommonsystemlogutilspy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/common/system/logutils.py (204288 => 204289)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/common/system/logutils.py        2016-08-09 18:52:11 UTC (rev 204288)
+++ trunk/Tools/Scripts/webkitpy/common/system/logutils.py        2016-08-09 19:30:16 UTC (rev 204289)
</span><span class="lines">@@ -223,6 +223,7 @@
</span><span class="cx"> handler.setFormatter(formatter)
</span><span class="cx">
</span><span class="cx"> logger.addHandler(handler)
</span><ins>+ return handler
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> class FileSystemHandler(FileHandler):
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpytoolbotqueueenginepy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/tool/bot/queueengine.py (204288 => 204289)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/tool/bot/queueengine.py        2016-08-09 18:52:11 UTC (rev 204288)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/queueengine.py        2016-08-09 19:30:16 UTC (rev 204289)
</span><span class="lines">@@ -33,6 +33,8 @@
</span><span class="cx">
</span><span class="cx"> from datetime import datetime, timedelta
</span><span class="cx">
</span><ins>+from webkitpy.common.host import Host
+from webkitpy.common.system import logutils
</ins><span class="cx"> from webkitpy.common.system.executive import ScriptError
</span><span class="cx"> from webkitpy.common.system.outputtee import OutputTee
</span><span class="cx">
</span><span class="lines">@@ -124,14 +126,18 @@
</span><span class="cx"> return 0
</span><span class="cx">
</span><span class="cx"> def _stopping(self, message):
</span><del>- _log.info("\n%s" % message)
</del><ins>+ _log.info(message)
</ins><span class="cx"> self._delegate.stop_work_queue(message)
</span><ins>+ logging.getLogger("webkitpy").removeHandler(self._log_handler)
</ins><span class="cx"> # Be careful to shut down our OutputTee or the unit tests will be unhappy.
</span><span class="cx"> self._ensure_work_log_closed()
</span><span class="cx"> self._output_tee.remove_log(self._queue_log)
</span><span class="cx">
</span><span class="cx"> def _begin_logging(self):
</span><del>- self._queue_log = self._output_tee.add_log(self._delegate.queue_log_path())
</del><ins>+ _queue_log_path = self._delegate.queue_log_path()
+ # We are using logging.getLogger("webkitpy") instead of _log since we want to capture all messages logged from webkitpy modules.
+ self._log_handler = logutils.configure_logger_to_log_to_file(logging.getLogger("webkitpy"), _queue_log_path, Host().filesystem)
+ self._queue_log = self._output_tee.add_log(_queue_log_path)
</ins><span class="cx"> self._work_log = None
</span><span class="cx">
</span><span class="cx"> def _open_work_log(self, work_item):
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpytoolbotqueueengine_unittestpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/tool/bot/queueengine_unittest.py (204288 => 204289)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/tool/bot/queueengine_unittest.py        2016-08-09 18:52:11 UTC (rev 204288)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/queueengine_unittest.py        2016-08-09 19:30:16 UTC (rev 204289)
</span><span class="lines">@@ -146,7 +146,7 @@
</span><span class="cx"> engine = QueueEngine("test-queue", delegate, threading.Event())
</span><span class="cx"> if not termination_message:
</span><span class="cx"> termination_message = "Delegate terminated queue."
</span><del>- expected_logs = "\n%s\n" % termination_message
</del><ins>+ expected_logs = "%s\n" % termination_message
</ins><span class="cx"> OutputCapture().assert_outputs(self, engine.run, expected_logs=expected_logs)
</span><span class="cx">
</span><span class="cx"> def _test_terminating_queue(self, exception, termination_message):
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpytoolcommandsqueuespy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queues.py (204288 => 204289)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/tool/commands/queues.py        2016-08-09 18:52:11 UTC (rev 204288)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queues.py        2016-08-09 19:30:16 UTC (rev 204289)
</span><span class="lines">@@ -41,10 +41,8 @@
</span><span class="cx">
</span><span class="cx"> from webkitpy.common.config.committervalidator import CommitterValidator
</span><span class="cx"> from webkitpy.common.config.ports import DeprecatedPort
</span><del>-from webkitpy.common.host import Host
</del><span class="cx"> from webkitpy.common.net.bugzilla import Attachment
</span><span class="cx"> from webkitpy.common.net.statusserver import StatusServer
</span><del>-from webkitpy.common.system import logutils
</del><span class="cx"> from webkitpy.common.system.executive import ScriptError
</span><span class="cx"> from webkitpy.tool.bot.botinfo import BotInfo
</span><span class="cx"> from webkitpy.tool.bot.commitqueuetask import CommitQueueTask, CommitQueueTaskDelegate
</span><span class="lines">@@ -68,7 +66,7 @@
</span><span class="cx"> _fail_status = "Fail"
</span><span class="cx"> _error_status = "Error"
</span><span class="cx">
</span><del>- def __init__(self, options=None, host=Host()): # Default values should never be collections (like []) as default values are shared between invocations
</del><ins>+ def __init__(self, options=None): # Default values should never be collections (like []) as default values are shared between invocations
</ins><span class="cx"> options_list = (options or []) + [
</span><span class="cx"> make_option("--no-confirm", action="store_false", dest="confirm", default=True, help="Do not ask the user for confirmation before running the queue. Dangerous!"),
</span><span class="cx"> make_option("--exit-after-iteration", action="store", type="int", dest="iterations", default=None, help="Stop running the queue after iterating this number of times."),
</span><span class="lines">@@ -78,7 +76,6 @@
</span><span class="cx"> self._iteration_count = 0
</span><span class="cx"> if not hasattr(self, 'architecture'):
</span><span class="cx"> self.architecture = None
</span><del>- self.host = host
</del><span class="cx">
</span><span class="cx"> def _cc_watchers(self, bug_id):
</span><span class="cx"> try:
</span><span class="lines">@@ -112,20 +109,17 @@
</span><span class="cx"> return command_output
</span><span class="cx">
</span><span class="cx"> def _log_directory(self):
</span><del>- return self.host.filesystem.join("..", "%s-logs" % self.name)
</del><ins>+ return os.path.join("..", "%s-logs" % self.name)
</ins><span class="cx">
</span><span class="cx"> # QueueEngineDelegate methods
</span><span class="cx">
</span><span class="cx"> def queue_log_path(self):
</span><del>- return self.host.filesystem.join(self._log_directory(), "%s.log" % self.name)
</del><ins>+ return os.path.join(self._log_directory(), "%s.log" % self.name)
</ins><span class="cx">
</span><span class="cx"> def work_item_log_path(self, work_item):
</span><span class="cx"> raise NotImplementedError, "subclasses must implement"
</span><span class="cx">
</span><span class="cx"> def begin_work_queue(self):
</span><del>- # FIXME: We should stop the logging as well when the queue stops.
- # We are using logging.getLogger("webkitpy") instead of _log since we want to capture all messages logged from webkitpy modules.
- logutils.configure_logger_to_log_to_file(logging.getLogger("webkitpy"), self.queue_log_path(), self.host.filesystem)
</del><span class="cx"> _log.info("CAUTION: %s will discard all local changes in \"%s\"" % (self.name, self._tool.scm().checkout_root))
</span><span class="cx"> if self._options.confirm:
</span><span class="cx"> response = self._tool.user.prompt("Are you sure? Type \"yes\" to continue: ")
</span><span class="lines">@@ -265,10 +259,9 @@
</span><span class="cx"> # Subclasses must override.
</span><span class="cx"> port_name = None
</span><span class="cx">
</span><del>- def __init__(self, options=None, host=Host()):
</del><ins>+ def __init__(self, options=None):
</ins><span class="cx"> self._port = None # We can't instantiate port here because tool isn't avaialble.
</span><del>- self.host = host
- AbstractPatchQueue.__init__(self, options, host=host)
</del><ins>+ AbstractPatchQueue.__init__(self, options)
</ins><span class="cx">
</span><span class="cx"> # FIXME: This is a hack to map between the old port names and the new port names.
</span><span class="cx"> def _new_port_name_from_old(self, port_name, platform):
</span><span class="lines">@@ -320,10 +313,9 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> class CommitQueue(PatchProcessingQueue, StepSequenceErrorHandler, CommitQueueTaskDelegate):
</span><del>- def __init__(self, commit_queue_task_class=CommitQueueTask, host=Host()):
- self.host = host
</del><ins>+ def __init__(self, commit_queue_task_class=CommitQueueTask):
</ins><span class="cx"> self._commit_queue_task_class = commit_queue_task_class
</span><del>- PatchProcessingQueue.__init__(self, host=host)
</del><ins>+ PatchProcessingQueue.__init__(self)
</ins><span class="cx">
</span><span class="cx"> name = "commit-queue"
</span><span class="cx"> port_name = "mac"
</span><span class="lines">@@ -438,9 +430,8 @@
</span><span class="cx">
</span><span class="cx"> class AbstractReviewQueue(PatchProcessingQueue, StepSequenceErrorHandler):
</span><span class="cx"> """This is the base-class for the EWS queues and the style-queue."""
</span><del>- def __init__(self, options=None, host=Host()):
- self.host = host
- PatchProcessingQueue.__init__(self, options, host=host)
</del><ins>+ def __init__(self, options=None):
+ PatchProcessingQueue.__init__(self, options)
</ins><span class="cx">
</span><span class="cx"> def review_patch(self, patch):
</span><span class="cx"> raise NotImplementedError("subclasses must implement")
</span><span class="lines">@@ -472,9 +463,8 @@
</span><span class="cx"> class StyleQueue(AbstractReviewQueue, StyleQueueTaskDelegate):
</span><span class="cx"> name = "style-queue"
</span><span class="cx">
</span><del>- def __init__(self, host=Host()):
- self.host = host
- AbstractReviewQueue.__init__(self, host=host)
</del><ins>+ def __init__(self):
+ AbstractReviewQueue.__init__(self)
</ins><span class="cx">
</span><span class="cx"> def review_patch(self, patch):
</span><span class="cx"> task = StyleQueueTask(self, patch)
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpytoolcommandsqueues_unittestpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py (204288 => 204289)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py        2016-08-09 18:52:11 UTC (rev 204288)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py        2016-08-09 19:30:16 UTC (rev 204289)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx">
</span><span class="cx"> from webkitpy.common.checkout.scm import CheckoutNeedsUpdate
</span><span class="cx"> from webkitpy.common.checkout.scm.scm_mock import MockSCM
</span><del>-from webkitpy.common.host_mock import MockHost
</del><span class="cx"> from webkitpy.common.net.layouttestresults import LayoutTestResults
</span><span class="cx"> from webkitpy.common.net.bugzilla import Attachment
</span><span class="cx"> from webkitpy.common.system.outputcapture import OutputCapture
</span><span class="lines">@@ -48,7 +47,7 @@
</span><span class="cx">
</span><span class="cx"> class TestCommitQueue(CommitQueue):
</span><span class="cx"> def __init__(self, tool=None):
</span><del>- CommitQueue.__init__(self, host=MockHost())
</del><ins>+ CommitQueue.__init__(self)
</ins><span class="cx"> if tool:
</span><span class="cx"> self.bind_to_tool(tool)
</span><span class="cx"> self._options = MockOptions(confirm=False, parent_command="commit-queue", port=None)
</span><span class="lines">@@ -63,24 +62,15 @@
</span><span class="cx"> class TestQueue(AbstractPatchQueue):
</span><span class="cx"> name = "test-queue"
</span><span class="cx">
</span><del>- def __init__(self):
- AbstractPatchQueue.__init__(self, host=MockHost())
</del><span class="cx">
</span><del>-
</del><span class="cx"> class TestReviewQueue(AbstractReviewQueue):
</span><span class="cx"> name = "test-review-queue"
</span><span class="cx">
</span><del>- def __init__(self):
- AbstractReviewQueue.__init__(self, host=MockHost())
</del><span class="cx">
</span><del>-
</del><span class="cx"> class TestFeederQueue(FeederQueue):
</span><span class="cx"> _sleep_duration = 0
</span><span class="cx">
</span><del>- def __init__(self):
- FeederQueue.__init__(self, host=MockHost())
</del><span class="cx">
</span><del>-
</del><span class="cx"> class AbstractQueueTest(CommandsTest):
</span><span class="cx"> def test_log_directory(self):
</span><span class="cx"> self.assertEqual(TestQueue()._log_directory(), os.path.join("..", "test-queue-logs"))
</span><span class="lines">@@ -163,7 +153,7 @@
</span><span class="cx">
</span><span class="cx"> class AbstractPatchQueueTest(CommandsTest):
</span><span class="cx"> def test_next_patch(self):
</span><del>- queue = AbstractPatchQueue(host=MockHost())
</del><ins>+ queue = AbstractPatchQueue()
</ins><span class="cx"> tool = MockTool()
</span><span class="cx"> queue.bind_to_tool(tool)
</span><span class="cx"> queue._options = Mock()
</span><span class="lines">@@ -181,7 +171,7 @@
</span><span class="cx">
</span><span class="cx"> class PatchProcessingQueueTest(CommandsTest):
</span><span class="cx"> def test_upload_results_archive_for_patch(self):
</span><del>- queue = PatchProcessingQueue(host=MockHost())
</del><ins>+ queue = PatchProcessingQueue()
</ins><span class="cx"> queue.name = "mock-queue"
</span><span class="cx"> tool = MockTool()
</span><span class="cx"> queue.bind_to_tool(tool)
</span><span class="lines">@@ -270,7 +260,7 @@
</span><span class="cx"> "handle_script_error": "ScriptError error message\n\nMOCK output\n",
</span><span class="cx"> "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '10000' with comment 'Rejecting attachment 10000 from commit-queue.\n\nMock error message'\n",
</span><span class="cx"> }
</span><del>- self.assert_queue_outputs(CommitQueue(host=MockHost()), tool=tool, expected_logs=expected_logs)
</del><ins>+ self.assert_queue_outputs(CommitQueue(), tool=tool, expected_logs=expected_logs)
</ins><span class="cx">
</span><span class="cx"> def test_commit_queue_failure(self):
</span><span class="cx"> expected_logs = {
</span><span class="lines">@@ -286,7 +276,7 @@
</span><span class="cx"> "handle_script_error": "ScriptError error message\n\nMOCK output\n",
</span><span class="cx"> "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '10000' with comment 'Rejecting attachment 10000 from commit-queue.\n\nMock error message'\n",
</span><span class="cx"> }
</span><del>- queue = CommitQueue(host=MockHost())
</del><ins>+ queue = CommitQueue()
</ins><span class="cx">
</span><span class="cx"> def mock_run_webkit_patch(command):
</span><span class="cx"> if command[0] == 'clean' or command[0] == 'update':
</span><span class="lines">@@ -318,7 +308,7 @@
</span><span class="cx"> def results_from_patch_test_run(self, patch):
</span><span class="cx"> return LayoutTestResults([test_results.TestResult("mock_test_name.html", failures=[test_failures.FailureTextMismatch()])], did_exceed_test_failure_limit=False)
</span><span class="cx">
</span><del>- queue = CommitQueue(MockCommitQueueTask, host=MockHost())
</del><ins>+ queue = CommitQueue(MockCommitQueueTask)
</ins><span class="cx">
</span><span class="cx"> def mock_run_webkit_patch(command):
</span><span class="cx"> if command[0] == 'clean' or command[0] == 'update':
</span><span class="lines">@@ -357,7 +347,7 @@
</span><span class="cx"> "handle_script_error": "ScriptError error message\n\nMOCK output\n",
</span><span class="cx"> "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '10000' with comment 'Rejecting attachment 10000 from commit-queue.\n\nMock error message'\n",
</span><span class="cx"> }
</span><del>- self.assert_queue_outputs(CommitQueue(host=MockHost()), tool=tool, expected_logs=expected_logs)
</del><ins>+ self.assert_queue_outputs(CommitQueue(), tool=tool, expected_logs=expected_logs)
</ins><span class="cx">
</span><span class="cx"> def test_rollout_lands(self):
</span><span class="cx"> tool = MockTool()
</span><span class="lines">@@ -382,7 +372,7 @@
</span><span class="cx"> "handle_script_error": "ScriptError error message\n\nMOCK output\n",
</span><span class="cx"> "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '10005' with comment 'Rejecting attachment 10005 from commit-queue.\n\nMock error message'\n",
</span><span class="cx"> }
</span><del>- self.assert_queue_outputs(CommitQueue(host=MockHost()), tool=tool, work_item=rollout_patch, expected_logs=expected_logs)
</del><ins>+ self.assert_queue_outputs(CommitQueue(), tool=tool, work_item=rollout_patch, expected_logs=expected_logs)
</ins><span class="cx">
</span><span class="cx"> def test_non_valid_patch(self):
</span><span class="cx"> tool = MockTool()
</span><span class="lines">@@ -393,10 +383,10 @@
</span><span class="cx"> MOCK: release_work_item: commit-queue 10007
</span><span class="cx"> """,
</span><span class="cx"> }
</span><del>- self.assert_queue_outputs(CommitQueue(host=MockHost()), tool=tool, work_item=patch, expected_logs=expected_logs)
</del><ins>+ self.assert_queue_outputs(CommitQueue(), tool=tool, work_item=patch, expected_logs=expected_logs)
</ins><span class="cx">
</span><span class="cx"> def test_auto_retry(self):
</span><del>- queue = CommitQueue(host=MockHost())
</del><ins>+ queue = CommitQueue()
</ins><span class="cx"> options = Mock()
</span><span class="cx"> options.parent_command = "commit-queue"
</span><span class="cx"> tool = AlwaysCommitQueueTool()
</span><span class="lines">@@ -508,7 +498,7 @@
</span><span class="cx"> "handle_script_error": "MOCK output\n",
</span><span class="cx"> }
</span><span class="cx"> tool = MockTool(executive_throws_when_run=set(['check-style']))
</span><del>- self.assert_queue_outputs(StyleQueue(host=MockHost()), expected_logs=expected_logs, tool=tool)
</del><ins>+ self.assert_queue_outputs(StyleQueue(), expected_logs=expected_logs, tool=tool)
</ins><span class="cx">
</span><span class="cx"> def test_style_queue_with_watch_list_exception(self):
</span><span class="cx"> expected_logs = {
</span><span class="lines">@@ -533,7 +523,7 @@
</span><span class="cx"> "handle_script_error": "MOCK output\n",
</span><span class="cx"> }
</span><span class="cx"> tool = MockTool(executive_throws_when_run=set(['apply-watchlist-local']))
</span><del>- self.assert_queue_outputs(StyleQueue(host=MockHost()), expected_logs=expected_logs, tool=tool)
</del><ins>+ self.assert_queue_outputs(StyleQueue(), expected_logs=expected_logs, tool=tool)
</ins><span class="cx">
</span><span class="cx"> def test_non_valid_patch(self):
</span><span class="cx"> tool = MockTool()
</span><span class="lines">@@ -544,4 +534,4 @@
</span><span class="cx"> MOCK: release_work_item: style-queue 10007
</span><span class="cx"> """,
</span><span class="cx"> }
</span><del>- self.assert_queue_outputs(StyleQueue(host=MockHost()), tool=tool, work_item=patch, expected_logs=expected_logs)
</del><ins>+ self.assert_queue_outputs(StyleQueue(), tool=tool, work_item=patch, expected_logs=expected_logs)
</ins></span></pre>
</div>
</div>
</body>
</html>