summaryrefslogtreecommitdiffstats
path: root/WebKitTools/Scripts/webkitpy
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-07-22 15:37:06 +0100
committerBen Murdoch <benm@google.com>2010-07-27 10:20:25 +0100
commit967717af5423377c967781471ee106e2bb4e11c8 (patch)
tree1e701dc0a12f7f07cce1df4a7681717de77a211b /WebKitTools/Scripts/webkitpy
parentdcc30a9fca45f634b1d3a12b276d3a0ccce99fc3 (diff)
downloadexternal_webkit-967717af5423377c967781471ee106e2bb4e11c8.zip
external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.gz
external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.bz2
Merge WebKit at r63859 : Initial merge by git.
Change-Id: Ie8096c63ec7c991c9a9cba8bdd9c3b74a3b8ed62
Diffstat (limited to 'WebKitTools/Scripts/webkitpy')
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/committers.py6
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/statusserver.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/base.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py4
-rw-r--r--WebKitTools/Scripts/webkitpy/thirdparty/__init__.py4
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/__init__.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queries.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/rebaseline.py113
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py38
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/mocktool.py3
10 files changed, 167 insertions, 7 deletions
diff --git a/WebKitTools/Scripts/webkitpy/common/config/committers.py b/WebKitTools/Scripts/webkitpy/common/config/committers.py
index e5f0a50..0354981 100644
--- a/WebKitTools/Scripts/webkitpy/common/config/committers.py
+++ b/WebKitTools/Scripts/webkitpy/common/config/committers.py
@@ -74,6 +74,7 @@ committers_unable_to_review = [
Committer("Andrei Popescu", "andreip@google.com", "andreip"),
Committer("Andrew Wellington", ["andrew@webkit.org", "proton@wiretapped.net"], "proton"),
Committer("Andras Becsi", "abecsi@webkit.org", "bbandix"),
+ Committer("Andreas Kling", "andreas.kling@nokia.com", "kling"),
Committer("Andy Estes", "aestes@apple.com", "estes"),
Committer("Anthony Ricaud", "rik@webkit.org", "rik"),
Committer("Anton Muhin", "antonm@chromium.org", "antonm"),
@@ -132,6 +133,7 @@ committers_unable_to_review = [
Committer("Keishi Hattori", "keishi@webkit.org", "keishi"),
Committer("Kelly Norton", "knorton@google.com"),
Committer("Kenneth Russell", "kbr@google.com"),
+ Committer("Kent Hansen", "kent.hansen@nokia.com", "khansen"),
Committer("Kinuko Yasuda", "kinuko@chromium.org", "kinuko"),
Committer("Krzysztof Kowalczyk", "kkowalczyk@gmail.com"),
Committer("Leandro Pereira", ["leandro@profusion.mobi", "leandro@webkit.org"], "acidx"),
@@ -165,7 +167,7 @@ committers_unable_to_review = [
Committer("Tony Gentilcore", "tonyg@chromium.org", "tonyg-cr"),
Committer("Trey Matteson", "trey@usa.net", "trey"),
Committer("Tristan O'Tierney", ["tristan@otierney.net", "tristan@apple.com"]),
- Committer("Victor Wang", "victorw@chromium.org"),
+ Committer("Victor Wang", "victorw@chromium.org", "victorw"),
Committer("Vitaly Repeshko", "vitalyr@chromium.org"),
Committer("William Siegrist", "wsiegrist@apple.com", "wms"),
Committer("Xiaomei Ji", "xji@chromium.org", "xji"),
@@ -174,7 +176,7 @@ committers_unable_to_review = [
Committer("Yong Li", ["yong.li.webkit@gmail.com", "yong.li@torchmobile.com"], "yong"),
Committer("Yongjun Zhang", "yongjun.zhang@nokia.com"),
Committer("Yuzo Fujishima", "yuzo@google.com", "yuzo"),
- Committer("Zhenyao Mo", "zmo@google.com"),
+ Committer("Zhenyao Mo", "zmo@google.com", "zhenyao"),
Committer("Zoltan Herczeg", "zherczeg@webkit.org", "zherczeg"),
Committer("Zoltan Horvath", "zoltan@webkit.org", "zoltan"),
]
diff --git a/WebKitTools/Scripts/webkitpy/common/net/statusserver.py b/WebKitTools/Scripts/webkitpy/common/net/statusserver.py
index 0bd68d1..c8fced6 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/statusserver.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/statusserver.py
@@ -39,7 +39,7 @@ _log = logging.getLogger("webkitpy.common.net.statusserver")
class StatusServer:
- default_host = "webkit-commit-queue.appspot.com"
+ default_host = "queues.webkit.org"
def __init__(self, host=default_host):
self.set_host(host)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
index e1b23ac..d226e64 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
@@ -410,6 +410,8 @@ class Port(object):
"""Relative unix-style path for a filename under the LayoutTests
directory. Filenames outside the LayoutTests directory should raise
an error."""
+ # FIXME This should assert() here but cannot due to printing_unittest.Testprinter
+ # assert(filename.startswith(self.layout_tests_dir()))
return filename[len(self.layout_tests_dir()) + 1:]
def results_directory(self):
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py
index c9805d6..2745cce 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py
@@ -67,8 +67,8 @@ class HttpServerBase(object):
try:
response = urllib.urlopen(url)
_log.debug("Server running at %s" % url)
- except IOError:
- _log.debug("Server NOT running at %s" % url)
+ except IOError, e:
+ _log.debug("Server NOT running at %s: %s" % (url, e))
return False
return True
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/__init__.py b/WebKitTools/Scripts/webkitpy/thirdparty/__init__.py
index 3321293..1cb554a 100644
--- a/WebKitTools/Scripts/webkitpy/thirdparty/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/__init__.py
@@ -95,8 +95,8 @@ installer.install(url="http://surfnet.dl.sourceforge.net/project/python-irclib/p
pywebsocket_dir = os.path.join(autoinstalled_dir, "pywebsocket")
installer = AutoInstaller(target_dir=pywebsocket_dir)
-installer.install(url="http://pywebsocket.googlecode.com/files/mod_pywebsocket-0.5.tar.gz",
- url_subpath="pywebsocket-0.5/src/mod_pywebsocket")
+installer.install(url="http://pywebsocket.googlecode.com/files/mod_pywebsocket-0.5.1.tar.gz",
+ url_subpath="pywebsocket-0.5.1/src/mod_pywebsocket")
readme_path = os.path.join(autoinstalled_dir, "README")
if not os.path.exists(readme_path):
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/__init__.py b/WebKitTools/Scripts/webkitpy/tool/commands/__init__.py
index 71c3719..9bdec8f 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/__init__.py
@@ -1,4 +1,5 @@
# Required for Python to search this directory for module files
from webkitpy.tool.commands.prettydiff import PrettyDiff
+from webkitpy.tool.commands.rebaseline import Rebaseline
# FIXME: Add the rest of the commands here.
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queries.py b/WebKitTools/Scripts/webkitpy/tool/commands/queries.py
index 645060c..91ce5e9 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queries.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queries.py
@@ -273,6 +273,7 @@ class FailureReason(AbstractDeclarativeCommand):
return 1
return self._explain_failures_for_builder(builder, start_revision=int(start_revision))
+
class TreeStatus(AbstractDeclarativeCommand):
name = "tree-status"
help_text = "Print the status of the %s buildbots" % BuildBot.default_host
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/rebaseline.py b/WebKitTools/Scripts/webkitpy/tool/commands/rebaseline.py
new file mode 100644
index 0000000..78e06c6
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/rebaseline.py
@@ -0,0 +1,113 @@
+# 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.
+
+import os.path
+import re
+import shutil
+import urllib
+
+from webkitpy.common.net.buildbot import BuildBot, LayoutTestResults
+from webkitpy.common.system.user import User
+from webkitpy.layout_tests.port import factory
+from webkitpy.tool.grammar import pluralize
+from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
+
+
+# FIXME: I'm not sure where this logic should go in the end.
+# For now it's here, until we have a second need for it.
+class BuilderToPort(object):
+ _builder_name_to_port_name = {
+ r"SnowLeopard": "mac-snowleopard",
+ r"Leopard": "mac-leopard",
+ r"Tiger": "mac-tiger",
+ r"Windows": "win",
+ r"GTK": "gtk",
+ r"Qt": "qt",
+ r"Chromium Mac": "chromium-mac",
+ r"Chromium Linux": "chromium-linux",
+ r"Chromium Win": "chromium-win",
+ }
+
+ def _port_name_for_builder_name(self, builder_name):
+ for regexp, port_name in self._builder_name_to_port_name.items():
+ if re.match(regexp, builder_name):
+ return port_name
+
+ def port_for_builder(self, builder_name):
+ port_name = self._port_name_for_builder_name(builder_name)
+ assert(port_name) # Need to update _builder_name_to_port_name
+ port = factory.get(port_name)
+ assert(port) # Need to update _builder_name_to_port_name
+ return port
+
+
+class Rebaseline(AbstractDeclarativeCommand):
+ name = "rebaseline"
+ help_text = "Replaces local expected.txt files with new results from build bots"
+
+ # FIXME: This should share more code with FailureReason._builder_to_explain
+ def _builder_to_pull_from(self):
+ builder_statuses = self.tool.buildbot.builder_statuses()
+ red_statuses = [status for status in builder_statuses if not status["is_green"]]
+ print "%s failing" % (pluralize("builder", len(red_statuses)))
+ builder_choices = [status["name"] for status in red_statuses]
+ chosen_name = self.tool.user.prompt_with_list("Which builder to pull results from:", builder_choices)
+ # FIXME: prompt_with_list should really take a set of objects and a set of names and then return the object.
+ for status in red_statuses:
+ if status["name"] == chosen_name:
+ return (self.tool.buildbot.builder_with_name(chosen_name), status["build_number"])
+
+ def _replace_expectation_with_remote_result(self, local_file, remote_file):
+ (downloaded_file, headers) = urllib.urlretrieve(remote_file)
+ shutil.move(downloaded_file, local_file)
+
+ def _tests_to_update(self, build):
+ parsed_results = build.layout_test_results().parsed_results()
+ # FIXME: This probably belongs as API on LayoutTestResults
+ # but .failing_tests() already means something else.
+ return parsed_results[LayoutTestResults.fail_key]
+
+ def _results_url_for_test(self, build, test):
+ test_base = os.path.splitext(test)[0]
+ actual_path = test_base + "-actual.txt"
+ return build.results_url() + "/" + actual_path
+
+ def execute(self, options, args, tool):
+ builder, build_number = self._builder_to_pull_from()
+ build = builder.build(build_number)
+ port = BuilderToPort().port_for_builder(builder.name())
+
+ for test in self._tests_to_update(build):
+ results_url = self._results_url_for_test(build, test)
+ # Port operates with absolute paths.
+ absolute_path = os.path.join(port.layout_tests_dir(), test)
+ expected_file = port.expected_filename(absolute_path, ".txt")
+ print test
+ self._replace_expectation_with_remote_result(expected_file, results_url)
+
+ # FIXME: We should handle new results too.
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
new file mode 100644
index 0000000..d6582a7
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
@@ -0,0 +1,38 @@
+# 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.
+
+import unittest
+
+from webkitpy.tool.commands.rebaseline import BuilderToPort
+
+
+class BuilderToPortTest(unittest.TestCase):
+ def test_port_for_builder(self):
+ converter = BuilderToPort()
+ port = converter.port_for_builder("Leopard Intel Debug (Tests)")
+ self.assertEqual(port.name(), "mac-leopard")
diff --git a/WebKitTools/Scripts/webkitpy/tool/mocktool.py b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
index a467364..2114c30 100644
--- a/WebKitTools/Scripts/webkitpy/tool/mocktool.py
+++ b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
@@ -332,6 +332,9 @@ class MockBuilder(object):
def name(self):
return self._name
+ def results_url(self):
+ return "http://example.com/builders/%s/results/" % self.name()
+
def force_build(self, username, comments):
log("MOCK: force_build: name=%s, username=%s, comments=%s" % (
self._name, username, comments))