diff options
| author | Ben Murdoch <benm@google.com> | 2011-05-24 11:24:40 +0100 |
|---|---|---|
| committer | Ben Murdoch <benm@google.com> | 2011-06-02 09:53:15 +0100 |
| commit | 81bc750723a18f21cd17d1b173cd2a4dda9cea6e (patch) | |
| tree | 7a9e5ed86ff429fd347a25153107221543909b19 /Tools/Scripts/webkitpy/tool/bot | |
| parent | 94088a6d336c1dd80a1e734af51e96abcbb689a7 (diff) | |
| download | external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.zip external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.gz external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.bz2 | |
Merge WebKit at r80534: Intial merge by Git
Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61
Diffstat (limited to 'Tools/Scripts/webkitpy/tool/bot')
4 files changed, 39 insertions, 7 deletions
diff --git a/Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py b/Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py index 270a656..bec593b 100644 --- a/Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py +++ b/Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py @@ -158,22 +158,26 @@ If you would like to track this test fix with another bug, please close this bug return archived_path return None - def _attach_failure_diff(self, flake_bug_id, flaky_test, results_archive): + def _attach_failure_diff(self, flake_bug_id, flaky_test, results_archive_zip): results_diff_path = self._results_diff_path_for_test(flaky_test) # 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) + archive_path = self._find_in_archive(results_diff_path, results_archive_zip) if archive_path: - results_diff = results_archive.read(archive_path) + results_diff = results_archive_zip.read(archive_path) description = "Failure diff from %s" % bot_id 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 # results_archive is a ZipFile object, grab the File object (.fp) to pass to Mechanize for uploading. - self._tool.bugs.add_attachment_to_bug(flake_bug_id, results_archive.fp, description, filename="layout-test-results.zip") + results_archive_file = results_archive_zip.fp + # Rewind the file object to start (since Mechanize won't do that automatically) + # See https://bugs.webkit.org/show_bug.cgi?id=54593 + results_archive_file.seek(0) + self._tool.bugs.add_attachment_to_bug(flake_bug_id, results_archive_file, description, filename="layout-test-results.zip") def report_flaky_tests(self, patch, flaky_test_results, results_archive): message = "The %s encountered the following flaky tests while processing attachment %s:\n\n" % (self._bot_name, patch.id()) diff --git a/Tools/Scripts/webkitpy/tool/bot/irc_command.py b/Tools/Scripts/webkitpy/tool/bot/irc_command.py index 67a1c44..af109e4 100644 --- a/Tools/Scripts/webkitpy/tool/bot/irc_command.py +++ b/Tools/Scripts/webkitpy/tool/bot/irc_command.py @@ -30,6 +30,7 @@ import random from webkitpy.common.config import irc as config_irc from webkitpy.common.config import urls +from webkitpy.common.config.committers import CommitterList from webkitpy.common.net.bugzilla import parse_bug_id from webkitpy.common.system.executive import ScriptError from webkitpy.tool.bot.queueengine import TerminateQueue @@ -109,6 +110,19 @@ class Hi(IRCCommand): return random.choice(quips) +class Whois(IRCCommand): + def execute(self, nick, args, tool, sheriff): + if len(args) != 1: + return "%s: Usage: BUGZILLA_EMAIL" % nick + email = args[0] + committer = CommitterList().committer_by_email(email) + if not committer: + return "%s: Sorry, I don't know %s. Maybe you could introduce me?" % (nick, email) + if not committer.irc_nickname: + return "%s: %s hasn't told me their nick. Boo hoo :-(" % (nick, email) + return "%s: %s is %s. Why do you ask?" % (nick, email, committer.irc_nickname) + + class Eliza(IRCCommand): therapist = None @@ -123,9 +137,10 @@ class Eliza(IRCCommand): # FIXME: Lame. We should have an auto-registering CommandCenter. commands = { + "help": Help, + "hi": Hi, "last-green-revision": LastGreenRevision, "restart": Restart, "rollout": Rollout, - "help": Help, - "hi": Hi, + "whois": Whois, } diff --git a/Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py b/Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py index 7aeb6a0..f3c63ec 100644 --- a/Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py +++ b/Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py @@ -36,3 +36,16 @@ class IRCCommandTest(unittest.TestCase): eliza = Eliza() eliza.execute("tom", "hi", None, None) eliza.execute("tom", "bye", None, None) + + def test_whois(self): + whois = Whois() + self.assertEquals("tom: Usage: BUGZILLA_EMAIL", + whois.execute("tom", [], None, None)) + self.assertEquals("tom: Usage: BUGZILLA_EMAIL", + whois.execute("tom", ["Adam", "Barth"], None, None)) + self.assertEquals("tom: Sorry, I don't know unknown@example.com. Maybe you could introduce me?", + whois.execute("tom", ["unknown@example.com"], None, None)) + self.assertEquals("tom: tonyg@chromium.org is tonyg-cr. Why do you ask?", + whois.execute("tom", ["tonyg@chromium.org"], None, None)) + self.assertEquals("tom: vicki@apple.com hasn't told me their nick. Boo hoo :-(", + whois.execute("tom", ["vicki@apple.com"], None, None)) diff --git a/Tools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py b/Tools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py index ccb8ac2..5368ca4 100644 --- a/Tools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py +++ b/Tools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py @@ -51,7 +51,7 @@ class SheriffIRCBotTest(unittest.TestCase): OutputCapture().assert_outputs(self, run, args=["hi"], expected_stderr=expected_stderr) def test_help(self): - expected_stderr = "MOCK: irc.post: mock_nick: Available commands: rollout, hi, help, restart, last-green-revision\n" + expected_stderr = "MOCK: irc.post: mock_nick: Available commands: whois, hi, last-green-revision, rollout, restart, help\n" OutputCapture().assert_outputs(self, run, args=["help"], expected_stderr=expected_stderr) def test_lgr(self): |
