summaryrefslogtreecommitdiffstats
path: root/WebKitTools/Scripts/webkitpy/tool
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-05-26 10:11:43 +0100
committerSteve Block <steveblock@google.com>2010-05-27 11:14:42 +0100
commite78cbe89e6f337f2f1fe40315be88f742b547151 (patch)
treed778000b84a04f24bbad50c7fa66244365e960e9 /WebKitTools/Scripts/webkitpy/tool
parent7b582e96e4e909ed7dba1e07153d20fbddaec3f7 (diff)
downloadexternal_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.zip
external_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.tar.gz
external_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.tar.bz2
Merge WebKit at r60074: Initial merge by git
Change-Id: I18a2dc5439e36c928351ea829d8fb4e39b062fc7
Diffstat (limited to 'WebKitTools/Scripts/webkitpy/tool')
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/patchcollection.py26
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem.py3
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queues.py14
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py25
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/upload.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/upload_unittest.py2
-rwxr-xr-xWebKitTools/Scripts/webkitpy/tool/main.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/mocktool.py3
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/options.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/postdiff.py3
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/runtests.py5
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py2
13 files changed, 74 insertions, 14 deletions
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection.py b/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection.py
index 9a2cdfa..6100cf8 100644
--- a/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection.py
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/patchcollection.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 Google Inc. All rights reserved.
+# 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
@@ -26,6 +26,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
class PersistentPatchCollectionDelegate:
def collection_name(self):
raise NotImplementedError, "subclasses must implement"
@@ -56,9 +57,22 @@ class PersistentPatchCollection:
self._status_cache[patch_id] = status
return status
- def next(self):
+ def _is_active_patch_id(self, patch_id):
+ """Active patches are patches waiting to be processed from this collection."""
+ status = self._cached_status(patch_id)
+ return not status or not self._delegate.is_terminal_status(status)
+
+ def _fetch_active_patch_ids(self):
patch_ids = self._delegate.fetch_potential_patch_ids()
- for patch_id in patch_ids:
- status = self._cached_status(patch_id)
- if not status or not self._delegate.is_terminal_status(status):
- return patch_id
+ return filter(lambda patch_id: self._is_active_patch_id(patch_id), patch_ids)
+
+ def next(self):
+ # Note: We only fetch all the ids so we can post them back to the server.
+ # This will go away once we have a feeder queue and all other queues are
+ # just pulling their next work item from the server.
+ patch_ids = self._fetch_active_patch_ids()
+ # FIXME: We're assuming self._name is a valid queue-name.
+ self._status.update_work_items(self._name, patch_ids)
+ if not patch_ids:
+ return None
+ return patch_ids[0]
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem.py b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
index 7505c62..9fbfda6 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
@@ -116,6 +116,9 @@ class QtEWS(AbstractEarlyWarningSystem):
class WinEWS(AbstractEarlyWarningSystem):
name = "win-ews"
port_name = "win"
+ # Use debug, the Apple Win port fails to link Release on 32-bit Windows.
+ # https://bugs.webkit.org/show_bug.cgi?id=39197
+ _build_style = "debug"
class AbstractChromiumEWS(AbstractEarlyWarningSystem):
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
index 3d0ddd1..27e09ba 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
@@ -47,6 +47,7 @@ class EarlyWarningSytemTest(QueuesTest):
expected_stderr = {
"begin_work_queue": "CAUTION: %(name)s will discard all local changes in \"%(checkout_dir)s\"\nRunning WebKit %(name)s.\n" % string_replacemnts,
"handle_unexpected_error": "Mock error message\n",
+ "next_work_item": "MOCK: update_work_items: %(name)s [103]\n" % string_replacemnts,
"process_work_item": "MOCK: update_status: %(name)s Pass\n" % string_replacemnts,
}
return expected_stderr
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
index 78ca729..08bd3aa 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
@@ -135,6 +135,9 @@ class AbstractPatchQueue(AbstractQueue):
def _update_status(self, message, patch=None, results_file=None):
self.tool.status_server.update_status(self.name, message, patch, results_file)
+ def _update_work_items(self, patch_ids):
+ self.tool.status_server.update_work_items(self.name, patch_ids)
+
def _did_pass(self, patch):
self._update_status(self._pass_status, patch)
@@ -169,12 +172,21 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler):
all_patches = sum([self.tool.bugs.fetch_bug(bug_id).commit_queued_patches(include_invalid=True) for bug_id in bug_ids], [])
return self.committer_validator.patches_after_rejecting_invalid_commiters_and_reviewers(all_patches)
+ def _patch_cmp(self, a, b):
+ # Sort first by is_rollout, then by attach_date.
+ # Reversing the order so that is_rollout is first.
+ rollout_cmp = cmp(b.is_rollout(), a.is_rollout())
+ if (rollout_cmp != 0):
+ return rollout_cmp
+ return cmp(a.attach_date(), b.attach_date())
+
def next_work_item(self):
patches = self._validate_patches_in_commit_queue()
+ patches = sorted(patches, self._patch_cmp)
+ self._update_work_items([patch.id() for patch in patches])
builders_are_green = self._builders_are_green()
if not builders_are_green:
patches = filter(lambda patch: patch.is_rollout(), patches)
- # FIXME: We could sort the patches in a specific order here, was suggested by https://bugs.webkit.org/show_bug.cgi?id=33395
if not patches:
queue_text = "queue" if builders_are_green else "rollout queue"
self._update_status("Empty %s" % queue_text)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
index 0bd42fb..a5d56da 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
@@ -122,7 +122,8 @@ class CommitQueueTest(QueuesTest):
# FIXME: The commit-queue warns about bad committers twice. This is due to the fact that we access Attachment.reviewer() twice and it logs each time.
"next_work_item" : """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
-2 patches in commit-queue [197, 106]
+MOCK: update_work_items: commit-queue [106, 197]
+2 patches in commit-queue [106, 197]
""",
"process_work_item" : "MOCK: update_status: commit-queue Pass\n",
}
@@ -137,6 +138,7 @@ Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.c
# FIXME: The commit-queue warns about bad committers twice. This is due to the fact that we access Attachment.reviewer() twice and it logs each time.
"next_work_item" : """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
+MOCK: update_work_items: commit-queue [106, 197]
MOCK: update_status: commit-queue Builders ["Builder2"] are red. See http://build.webkit.org
1 patch in commit-queue [106]
""",
@@ -154,6 +156,7 @@ MOCK: update_status: commit-queue Builders ["Builder2"] are red. See http://buil
# FIXME: The commit-queue warns about bad committers twice. This is due to the fact that we access Attachment.reviewer() twice and it logs each time.
"next_work_item": """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
+MOCK: update_work_items: commit-queue [106, 197]
MOCK: update_status: commit-queue Builders ["Builder2"] are red. See http://build.webkit.org
1 patch in commit-queue [106]
""",
@@ -170,11 +173,31 @@ MOCK: update_status: commit-queue Builders ["Builder2"] are red. See http://buil
expected_run_args = ["echo", "--status-host=example.com", "build-and-test", "--force-clean", "--build", "--test", "--non-interactive", "--no-update", "--build-style=both", "--quiet"]
tool.executive.run_and_throw_if_fail.assert_called_with(expected_run_args)
+ def _mock_attachment(self, is_rollout, attach_date):
+ attachment = Mock()
+ attachment.is_rollout = lambda: is_rollout
+ attachment.attach_date = lambda: attach_date
+ return attachment
+
+ def test_patch_cmp(self):
+ long_ago_date = datetime(1900, 1, 21)
+ recent_date = datetime(2010, 1, 21)
+ attachment1 = self._mock_attachment(is_rollout=False, attach_date=recent_date)
+ attachment2 = self._mock_attachment(is_rollout=False, attach_date=long_ago_date)
+ attachment3 = self._mock_attachment(is_rollout=True, attach_date=recent_date)
+ attachment4 = self._mock_attachment(is_rollout=True, attach_date=long_ago_date)
+ attachments = [attachment1, attachment2, attachment3, attachment4]
+ expected_sort = [attachment4, attachment3, attachment2, attachment1]
+ queue = CommitQueue()
+ attachments.sort(queue._patch_cmp)
+ self.assertEqual(attachments, expected_sort)
+
class StyleQueueTest(QueuesTest):
def test_style_queue(self):
expected_stderr = {
"begin_work_queue" : "CAUTION: style-queue will discard all local changes in \"%s\"\nRunning WebKit style-queue.\n" % MockSCM.fake_checkout_root,
+ "next_work_item": "MOCK: update_work_items: style-queue [103]\n",
"should_proceed_with_work_item": "MOCK: update_status: style-queue Checking style\n",
"process_work_item" : "MOCK: update_status: style-queue Pass\n",
"handle_unexpected_error" : "Mock error message\n",
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/upload.py b/WebKitTools/Scripts/webkitpy/tool/commands/upload.py
index 4797ef6..cf715b9 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/upload.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/upload.py
@@ -168,7 +168,6 @@ class Post(AbstractPatchUploadingCommand):
name = "post"
help_text = "Attach the current working directory diff to a bug as a patch file"
argument_names = "[BUGID]"
- show_in_main_help = True
steps = [
steps.CheckStyle,
steps.ConfirmDiff,
@@ -193,7 +192,6 @@ class Prepare(AbstractSequencedCommand):
name = "prepare"
help_text = "Creates a bug (or prompts for an existing bug) and prepares the ChangeLogs"
argument_names = "[BUGID]"
- show_in_main_help = True
steps = [
steps.PromptForBugOrTitle,
steps.CreateBug,
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/upload_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/upload_unittest.py
index 8f6483a..d52775b 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/upload_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/upload_unittest.py
@@ -55,6 +55,7 @@ class UploadCommandsTest(CommandsTest):
options.description = "MOCK description"
options.request_commit = False
options.review = True
+ options.comment = None
# Rietveld upload code requires a real SCM checkout.
options.fancy_review = False
options.cc = None
@@ -85,6 +86,7 @@ MOCK: user.open_url: http://example.com/42
options.description = "MOCK description"
options.request_commit = False
options.review = True
+ options.comment = None
# Rietveld upload code requires a real SCM checkout.
options.fancy_review = False
options.cc = None
diff --git a/WebKitTools/Scripts/webkitpy/tool/main.py b/WebKitTools/Scripts/webkitpy/tool/main.py
index 2dc177d..1f43145 100755
--- a/WebKitTools/Scripts/webkitpy/tool/main.py
+++ b/WebKitTools/Scripts/webkitpy/tool/main.py
@@ -56,6 +56,7 @@ from webkitpy.common.system.deprecated_logging import log
class WebKitPatch(MultiCommandTool):
global_options = [
+ make_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="enable all logging"),
make_option("--dry-run", action="store_true", dest="dry_run", default=False, help="do not touch remote servers"),
make_option("--status-host", action="store", dest="status_host", type="string", nargs=1, help="Hostname (e.g. localhost or commit.webkit.org) where status updates should be posted."),
make_option("--irc-password", action="store", dest="irc_password", type="string", nargs=1, help="Password to use when communicating via IRC."),
diff --git a/WebKitTools/Scripts/webkitpy/tool/mocktool.py b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
index 47fff1b..2f192d9 100644
--- a/WebKitTools/Scripts/webkitpy/tool/mocktool.py
+++ b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
@@ -477,6 +477,9 @@ class MockStatusServer(object):
def svn_revision(self, svn_revision):
return None
+ def update_work_items(self, queue_name, work_items):
+ log("MOCK: update_work_items: %s %s" % (queue_name, work_items))
+
def update_status(self, queue_name, status, patch=None, results_file=None):
log("MOCK: update_status: %s %s" % (queue_name, status))
return 187
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/options.py b/WebKitTools/Scripts/webkitpy/tool/steps/options.py
index 524a252..186d292 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/options.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/options.py
@@ -36,6 +36,7 @@ class Options(object):
check_style = make_option("--ignore-style", action="store_false", dest="check_style", default=True, help="Don't check to see if the patch has proper style before uploading.")
clean = make_option("--no-clean", action="store_false", dest="clean", default=True, help="Don't check if the working directory is clean before applying patches")
close_bug = make_option("--no-close", action="store_false", dest="close_bug", default=True, help="Leave bug open after landing.")
+ comment = make_option("--comment", action="store", type="string", dest="comment", help="Comment to post to bug.")
component = make_option("--component", action="store", type="string", dest="component", help="Component for the new bug.")
confirm = make_option("--no-confirm", action="store_false", dest="confirm", default=True, help="Skip confirmation steps.")
description = make_option("-m", "--description", action="store", type="string", dest="description", help="Description string for the attachment (default: \"patch\")")
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/postdiff.py b/WebKitTools/Scripts/webkitpy/tool/steps/postdiff.py
index 79739cd..c40b6ff 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/postdiff.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/postdiff.py
@@ -35,6 +35,7 @@ class PostDiff(AbstractStep):
def options(cls):
return AbstractStep.options() + [
Options.description,
+ Options.comment,
Options.review,
Options.request_commit,
Options.open_bug,
@@ -43,7 +44,7 @@ class PostDiff(AbstractStep):
def run(self, state):
diff = self.cached_lookup(state, "diff")
description = self._options.description or "Patch"
- comment_text = None
+ comment_text = self._options.comment
self._tool.bugs.add_patch_to_bug(state["bug_id"], diff, description, comment_text=comment_text, mark_for_review=self._options.review, mark_for_commit_queue=self._options.request_commit)
if self._options.open_bug:
self._tool.user.open_url(self._tool.bugs.bug_url_for_bug_id(state["bug_id"]))
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py b/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py
index 0734d8f..22b9452 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py
@@ -58,9 +58,10 @@ class RunTests(AbstractStep):
args.append("--no-launch-safari")
args.append("--exit-after-n-failures=1")
# FIXME: Hack to work around https://bugs.webkit.org/show_bug.cgi?id=38912
- # when running the commit-queue on a mac leopard machine.
+ # when running the commit-queue on a mac leopard machine since compositing
+ # does not work reliably on Leopard due to various graphics driver/system bugs.
if self.port().name() == "Mac" and self.port().is_leopard():
- args.extend(["--ignore-tests", "compositing/iframes"])
+ args.extend(["--ignore-tests", "compositing"])
if self._options.quiet:
args.append("--quiet")
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py b/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py
index eee183b..1fd2bad 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py
@@ -78,6 +78,6 @@ MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/test-webkitperl']
Running JavaScriptCore tests
MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/run-javascriptcore-tests']
Running run-webkit-tests
-MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/run-webkit-tests', '--no-launch-safari', '--exit-after-n-failures=1', '--ignore-tests', 'compositing/iframes', '--quiet']
+MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/run-webkit-tests', '--no-launch-safari', '--exit-after-n-failures=1', '--ignore-tests', 'compositing', '--quiet']
"""
OutputCapture().assert_outputs(self, step.run, [{}], expected_stderr=expected_stderr)