[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
eric at webkit.org
eric at webkit.org
Wed Dec 22 18:34:38 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 0b086ceba5fe19a9a897c55f96d7fc4a294be9dc
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Dec 14 01:42:35 2010 +0000
2010-12-13 Eric Seidel <eric at webkit.org>
Reviewed by Adam Barth.
FlakyTestReporter doesn't understand bots running from multiple email addresses
https://bugs.webkit.org/show_bug.cgi?id=50960
This explains at least one of the dupes of:
https://bugs.webkit.org/show_bug.cgi?id=50863
that we saw filed by the commit-queue this morning.
I think the other one was explained by my previous fix to result counting code.
Since this is really hard to test with a unit test, instead I
create a new (possibly useful in the future) command
which given a layout test path will return you
the one bug which our tools would assume it the flaky test bug.
If some other script wants to use bug-for-test we'll
need to extend it with some options like --create-if-missing or similar.
* Scripts/webkitpy/common/net/bugzilla/bug.py:
* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
* Scripts/webkitpy/tool/bot/flakytestreporter.py:
* Scripts/webkitpy/tool/commands/__init__.py:
* Scripts/webkitpy/tool/commands/bugfortest.py: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 3306547..93ede49 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,28 @@
+2010-12-13 Eric Seidel <eric at webkit.org>
+
+ Reviewed by Adam Barth.
+
+ FlakyTestReporter doesn't understand bots running from multiple email addresses
+ https://bugs.webkit.org/show_bug.cgi?id=50960
+
+ This explains at least one of the dupes of:
+ https://bugs.webkit.org/show_bug.cgi?id=50863
+ that we saw filed by the commit-queue this morning.
+ I think the other one was explained by my previous fix to result counting code.
+
+ Since this is really hard to test with a unit test, instead I
+ create a new (possibly useful in the future) command
+ which given a layout test path will return you
+ the one bug which our tools would assume it the flaky test bug.
+ If some other script wants to use bug-for-test we'll
+ need to extend it with some options like --create-if-missing or similar.
+
+ * Scripts/webkitpy/common/net/bugzilla/bug.py:
+ * Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
+ * Scripts/webkitpy/tool/bot/flakytestreporter.py:
+ * Scripts/webkitpy/tool/commands/__init__.py:
+ * Scripts/webkitpy/tool/commands/bugfortest.py: Added.
+
2010-12-13 Mihai Parparita <mihaip at chromium.org>
Reviewed by James Robinson.
diff --git a/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bug.py b/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bug.py
index 855049e..af258eb 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bug.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bug.py
@@ -46,6 +46,9 @@ class Bug(object):
def title(self):
return self.bug_dictionary["title"]
+ def reporter_email(self):
+ return self.bug_dictionary["reporter_email"]
+
def assigned_to_email(self):
return self.bug_dictionary["assigned_to_email"]
diff --git a/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py b/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
index d2546b3..0a59e22 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
@@ -148,6 +148,8 @@ class BugzillaQueries(object):
quicksearch_url = "buglist.cgi?quicksearch=%s" % urllib.quote(search_string)
return self._fetch_bugs_from_advanced_query(quicksearch_url)
+ # Currently this returns all bugs across all components.
+ # In the future we may wish to extend this API to construct more restricted searches.
def fetch_bugs_matching_search(self, search_string, author_email=None):
query = "buglist.cgi?query_format=advanced"
if search_string:
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/flakytestreporter.py b/WebKitTools/Scripts/webkitpy/tool/bot/flakytestreporter.py
index fab0010..1a18026 100644
--- a/WebKitTools/Scripts/webkitpy/tool/bot/flakytestreporter.py
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/flakytestreporter.py
@@ -54,13 +54,28 @@ class FlakyTestReporter(object):
self._tool.bugs.authenticate()
return self._tool.bugs.username
+ # FIXME: This should move into common.config
+ _bot_emails = set([
+ "commit-queue at webkit.org", # commit-queue
+ "eseidel at chromium.org", # old commit-queue
+ "webkit.review.bot at gmail.com", # style-queue, sheriff-bot, CrLx/Gtk EWS
+ "buildbot at hotmail.com", # Win EWS
+ # Mac EWS currently uses eric at webkit.org, but that's not normally a bot
+ ])
+
def _lookup_bug_for_flaky_test(self, flaky_test):
- bot_email = self._bugzilla_email()
- bugs = self._tool.bugs.queries.fetch_bugs_matching_search(search_string=flaky_test, author_email=bot_email)
+ bugs = self._tool.bugs.queries.fetch_bugs_matching_search(search_string=flaky_test)
+ if not bugs:
+ return None
+ # Match any bugs which are from known bots or the email this bot is using.
+ allowed_emails = self._bot_emails | set([self._bugzilla_email])
+ bugs = filter(lambda bug: bug.reporter_email() in allowed_emails, bugs)
if not bugs:
return None
if len(bugs) > 1:
- _log.warn("Found %s %s matching '%s' from the %s (%s), using the first." % (pluralize('bug', len(bugs)), bugs, flaky_test, self._bot_name, bot_email))
+ # FIXME: There are probably heuristics we could use for finding
+ # the right bug instead of the first, like open vs. closed.
+ _log.warn("Found %s %s matching '%s' filed by a bot, using the first." % (pluralize('bug', len(bugs)), [bug.id() for bug in bugs], flaky_test))
return bugs[0]
def _view_source_url_for_test(self, test_path):
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/__init__.py b/WebKitTools/Scripts/webkitpy/tool/commands/__init__.py
index bae26bf..a974b67 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/__init__.py
@@ -1,6 +1,7 @@
# Required for Python to search this directory for module files
from webkitpy.tool.commands.bugsearch import BugSearch
+from webkitpy.tool.commands.bugfortest import BugForTest
from webkitpy.tool.commands.download import *
from webkitpy.tool.commands.earlywarningsystem import *
from webkitpy.tool.commands.openbugs import OpenBugs
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/bugfortest.py b/WebKitTools/Scripts/webkitpy/tool/commands/bugfortest.py
new file mode 100644
index 0000000..e0c4971
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/bugfortest.py
@@ -0,0 +1,47 @@
+# Copyright (c) 2010 Google 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.
+
+from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
+from webkitpy.tool.bot.flakytestreporter import FlakyTestReporter
+
+
+# This is mostly a command for testing FlakyTestReporter, however
+# it could be easily expanded to auto-create bugs, etc. if another
+# command outside of webkitpy wanted to use it.
+class BugForTest(AbstractDeclarativeCommand):
+ name = "bug-for-test"
+ help_text = "Finds the bugzilla bug for a given test"
+
+ def execute(self, options, args, tool):
+ reporter = FlakyTestReporter(tool, "webkitpy")
+ search_string = args[0]
+ bug = reporter._lookup_bug_for_flaky_test(search_string)
+ if bug:
+ print "%5s %s" % (bug.id(), bug.title())
+ else:
+ print "No bugs found matching '%s'" % search_string
diff --git a/WebKitTools/Scripts/webkitpy/tool/mocktool.py b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
index f02d35b..7b33719 100644
--- a/WebKitTools/Scripts/webkitpy/tool/mocktool.py
+++ b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
@@ -145,6 +145,9 @@ _patch7 = { # Valid review, patch is marked obsolete.
# This matches one of Bug.unassigned_emails
_unassigned_email = "webkit-unassigned at lists.webkit.org"
+# This is needed for the FlakyTestReporter to believe the bug
+# was filed by one of the webkitpy bots.
+_commit_queue_email = "commit-queue at webkit.org"
# FIXME: The ids should be 1, 2, 3 instead of crazy numbers.
@@ -154,6 +157,7 @@ _bug1 = {
"id": 42,
"title": "Bug with two r+'d and cq+'d patches, one of which has an "
"invalid commit-queue setter.",
+ "reporter_email": "foo at foo.com",
"assigned_to_email": _unassigned_email,
"attachments": [_patch1, _patch2],
"bug_status": "UNCONFIRMED",
@@ -163,6 +167,7 @@ _bug1 = {
_bug2 = {
"id": 75,
"title": "Bug with a patch needing review.",
+ "reporter_email": "foo at foo.com",
"assigned_to_email": "foo at foo.com",
"attachments": [_patch3],
"bug_status": "ASSIGNED",
@@ -172,6 +177,7 @@ _bug2 = {
_bug3 = {
"id": 76,
"title": "The third bug",
+ "reporter_email": "foo at foo.com",
"assigned_to_email": _unassigned_email,
"attachments": [_patch7],
"bug_status": "NEW",
@@ -181,6 +187,7 @@ _bug3 = {
_bug4 = {
"id": 77,
"title": "The fourth bug",
+ "reporter_email": "foo at foo.com",
"assigned_to_email": "foo at foo.com",
"attachments": [_patch4, _patch5, _patch6],
"bug_status": "REOPENED",
@@ -190,6 +197,7 @@ _bug4 = {
_bug5 = {
"id": 78,
"title": "The fifth bug",
+ "reporter_email": _commit_queue_email,
"assigned_to_email": "foo at foo.com",
"attachments": [],
"bug_status": "RESOLVED",
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list