Some build fixes for WKR and webkitbot.
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 May 2013 03:39:30 +0000 (03:39 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 May 2013 03:39:30 +0000 (03:39 +0000)
* Scripts/webkitpy/tool/bot/ircbot_unittest.py:
(IRCBotTest.test_help):
* Scripts/webkitpy/tool/commands/newcommitbot.py:
(Agent):
(Agent.__init__):
(Agent.name):
(NewCommitBot):
(NewCommitBot.begin_work_queue):
(NewCommitBot.next_work_item):
* Scripts/webkitpy/tool/commands/sheriffbot.py:
(SheriffBot):

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

Tools/ChangeLog
Tools/Scripts/webkitpy/tool/bot/ircbot_unittest.py
Tools/Scripts/webkitpy/tool/commands/newcommitbot.py
Tools/Scripts/webkitpy/tool/commands/sheriffbot.py

index 1fae3099fe4b360019c7aa0b5fc82237c946f008..2b9cbf7a287d644a0dda31ecb963908cde040c6f 100644 (file)
@@ -1,3 +1,19 @@
+2013-05-25  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Some build fixes for WKR and webkitbot.
+
+        * Scripts/webkitpy/tool/bot/ircbot_unittest.py:
+        (IRCBotTest.test_help):
+        * Scripts/webkitpy/tool/commands/newcommitbot.py:
+        (Agent):
+        (Agent.__init__):
+        (Agent.name):
+        (NewCommitBot):
+        (NewCommitBot.begin_work_queue):
+        (NewCommitBot.next_work_item):
+        * Scripts/webkitpy/tool/commands/sheriffbot.py:
+        (SheriffBot):
+
 2013-05-25  Ryosuke Niwa  <rniwa@webkit.org>
 
         Teach webkitbot and WKR how to respond to yt?
index daacef2fabb21380d69b43ff82d0b8ddb51b6a86..7e17670233be4b4a9f9d398215fae0cd6a1ccee6 100644 (file)
@@ -88,9 +88,9 @@ class IRCBotTest(unittest.TestCase):
         OutputCapture().assert_outputs(self, run, args=["hi"], expected_logs=expected_logs)
 
     def test_help(self):
-        expected_logs = 'MOCK: irc.post: mock_nick: Available commands: create-bug, help, hi, ping, restart, roll-chromium-deps, rollout, whois\nMOCK: irc.post: mock_nick: Type "mock-sheriff-bot: help COMMAND" for help on my individual commands.\n'
+        expected_logs = 'MOCK: irc.post: mock_nick: Available commands: create-bug, help, hi, ping, restart, roll-chromium-deps, rollout, whois, yt?\nMOCK: irc.post: mock_nick: Type "mock-sheriff-bot: help COMMAND" for help on my individual commands.\n'
         OutputCapture().assert_outputs(self, run, args=["help"], expected_logs=expected_logs)
-        expected_logs = 'MOCK: irc.post: mock_nick: Usage: hi\nMOCK: irc.post: mock_nick: Retrieves a random quip from Bugzilla.\nMOCK: irc.post: mock_nick: Aliases: hello\n'
+        expected_logs = 'MOCK: irc.post: mock_nick: Usage: hi\nMOCK: irc.post: mock_nick: Responds with hi.\nMOCK: irc.post: mock_nick: Aliases: hello\n'
         OutputCapture().assert_outputs(self, run, args=["help hi"], expected_logs=expected_logs)
         OutputCapture().assert_outputs(self, run, args=["help hello"], expected_logs=expected_logs)
 
index b098cb3c3df0fb6611083cdce86610891c90aeee..52399779c6052e7a42bc7b14a365e4802418c6ed 100644 (file)
@@ -45,8 +45,17 @@ from webkitpy.tool.commands.stepsequence import StepSequenceErrorHandler
 _log = logging.getLogger(__name__)
 
 
+class Agent(object):
+    def __init__(self, tool, newcommitbot):
+        self._tool = tool
+        self._newcommitbot = newcommitbot
+
+    def name(self):
+        return 'WKR'
+
+
 class NewCommitBot(AbstractQueue, StepSequenceErrorHandler):
-    name = "new-commit-bot"
+    name = "WKR"
     watchers = AbstractQueue.watchers + ["rniwa@webkit.org"]
 
     _commands = {
@@ -63,7 +72,7 @@ class NewCommitBot(AbstractQueue, StepSequenceErrorHandler):
     def begin_work_queue(self):
         AbstractQueue.begin_work_queue(self)
         self._last_svn_revision = int(self._tool.scm().head_svn_revision())
-        self._irc_bot = IRCBot('WKR', self._tool, None, self._commands)
+        self._irc_bot = IRCBot(self.name, self._tool, Agent(self._tool, self), self._commands)
         self._tool.ensure_irc_connected(self._irc_bot.irc_delegate())
 
     def work_item_log_path(self, failure_map):
@@ -74,6 +83,7 @@ class NewCommitBot(AbstractQueue, StepSequenceErrorHandler):
 
         _log.info('Last SVN revision: %d' % self._last_svn_revision)
 
+        return
         count = 0
         while count < self._maximum_number_of_revisions_to_avoid_spamming_irc:
             new_revision = self._last_svn_revision + 1
index aea3b51bfb9ef8c739f869181296f2dff7f94218..1bf31f18b1e9c5abd4853104ac077b2fea6cc091 100644 (file)
@@ -38,7 +38,7 @@ _log = logging.getLogger(__name__)
 
 
 class SheriffBot(AbstractQueue, StepSequenceErrorHandler):
-    name = "webkitbot"
+    name = "rniwabot"
     watchers = AbstractQueue.watchers + [
         "abarth@webkit.org",
         "eric@webkit.org",