summaryrefslogtreecommitdiffstats
path: root/Tools/Scripts/webkitpy/tool
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/Scripts/webkitpy/tool')
-rw-r--r--Tools/Scripts/webkitpy/tool/bot/commitqueuetask.py4
-rw-r--r--Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py28
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py1
-rw-r--r--Tools/Scripts/webkitpy/tool/commands/queues.py4
-rwxr-xr-xTools/Scripts/webkitpy/tool/main.py51
5 files changed, 39 insertions, 49 deletions
diff --git a/Tools/Scripts/webkitpy/tool/bot/commitqueuetask.py b/Tools/Scripts/webkitpy/tool/bot/commitqueuetask.py
index 3be2556..b22138d 100644
--- a/Tools/Scripts/webkitpy/tool/bot/commitqueuetask.py
+++ b/Tools/Scripts/webkitpy/tool/bot/commitqueuetask.py
@@ -187,7 +187,9 @@ class CommitQueueTask(object):
first_failing_tests = [result.filename for result in first_results]
first_results_archive = self._delegate.archive_last_layout_test_results(self._patch)
if self._test():
- self._report_flaky_tests(first_results, first_results_archive)
+ # Only report flaky tests if we were successful at archiving results.
+ if first_results_archive:
+ self._report_flaky_tests(first_results, first_results_archive)
return True
second_results = self._failing_results_from_last_run()
diff --git a/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py b/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py
index 26231ae..87d0ab5 100644
--- a/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py
+++ b/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py
@@ -209,6 +209,34 @@ command_passed: success_message='Landed patch' patch='197'
"""
self._run_through_task(commit_queue, expected_stderr)
+ def test_failed_archive(self):
+ commit_queue = MockCommitQueue([
+ None,
+ None,
+ None,
+ None,
+ ScriptError("MOCK tests failure"),
+ ])
+ # It's possible delegate to fail to archive layout tests, don't try to report
+ # flaky tests when that happens.
+ commit_queue.archive_last_layout_test_results = lambda patch: None
+ expected_stderr = """run_webkit_patch: ['clean']
+command_passed: success_message='Cleaned working directory' patch='197'
+run_webkit_patch: ['update']
+command_passed: success_message='Updated working directory' patch='197'
+run_webkit_patch: ['apply-attachment', '--no-update', '--non-interactive', 197]
+command_passed: success_message='Applied patch' patch='197'
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
+command_passed: success_message='Built patch' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive']
+command_failed: failure_message='Patch does not pass tests' script_error='MOCK tests failure' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive']
+command_passed: success_message='Passed tests' patch='197'
+run_webkit_patch: ['land-attachment', '--force-clean', '--ignore-builders', '--non-interactive', '--parent-command=commit-queue', 197]
+command_passed: success_message='Landed patch' patch='197'
+"""
+ self._run_through_task(commit_queue, expected_stderr)
+
_double_flaky_test_counter = 0
def test_double_flaky_test_failure(self):
diff --git a/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py b/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
index 3b53d1a..996ab24 100644
--- a/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
+++ b/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
@@ -122,6 +122,7 @@ class EflEWS(AbstractEarlyWarningSystem):
"leandro@profusion.mobi",
"antognolli@profusion.mobi",
"lucas.demarchi@profusion.mobi",
+ "gyuyoung.kim@samsung.com",
]
diff --git a/Tools/Scripts/webkitpy/tool/commands/queues.py b/Tools/Scripts/webkitpy/tool/commands/queues.py
index 42321cf..9e50dd4 100644
--- a/Tools/Scripts/webkitpy/tool/commands/queues.py
+++ b/Tools/Scripts/webkitpy/tool/commands/queues.py
@@ -323,10 +323,12 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler, CommitQueueTaskD
results_name, _ = os.path.splitext(os.path.basename(results_directory))
# Note: We name the zip with the bug_id instead of patch_id to match work_item_log_path().
zip_path = self._tool.workspace.find_unused_filename(self._log_directory(), "%s-%s" % (patch.bug_id(), results_name), "zip")
+ if not zip_path:
+ return None
archive = self._tool.workspace.create_zip(zip_path, results_directory)
# Remove the results directory to prevent http logs, etc. from getting huge between runs.
# We could have create_zip remove the original, but this is more explicit.
- self._tool.filesystem.remove_tree(results_directory, ignore_errors=True)
+ self._tool.filesystem.rmtree(results_directory)
return archive
def refetch_patch(self, patch):
diff --git a/Tools/Scripts/webkitpy/tool/main.py b/Tools/Scripts/webkitpy/tool/main.py
index 76d5bef..6b07615 100755
--- a/Tools/Scripts/webkitpy/tool/main.py
+++ b/Tools/Scripts/webkitpy/tool/main.py
@@ -36,6 +36,7 @@ import threading
from webkitpy.common.checkout.api import Checkout
from webkitpy.common.checkout.scm import default_scm
from webkitpy.common.config.ports import WebKitPort
+from webkitpy.common.host import Host
from webkitpy.common.net.bugzilla import Bugzilla
from webkitpy.common.net.buildbot import BuildBot
from webkitpy.common.net.irc.ircproxy import IRCProxy
@@ -46,7 +47,7 @@ from webkitpy.tool.multicommandtool import MultiCommandTool
import webkitpy.tool.commands as commands
-class WebKitPatch(MultiCommandTool):
+class WebKitPatch(MultiCommandTool, Host):
global_options = [
make_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="enable all logging"),
make_option("-d", "--directory", action="append", dest="patch_directories", default=[], help="Directory to look at for changed files"),
@@ -59,58 +60,14 @@ class WebKitPatch(MultiCommandTool):
def __init__(self, path):
MultiCommandTool.__init__(self)
+ Host.__init__(self)
self._path = path
self.wakeup_event = threading.Event()
- # FIXME: All of these shared objects should move off onto a
- # separate "Tool" object. WebKitPatch should inherit from
- # "Tool" and all these objects should use getters/setters instead of
- # manual getter functions (e.g. scm()).
- self.bugs = Bugzilla()
- self.buildbot = BuildBot()
- self.executive = executive.Executive()
- self._irc = None
- self.filesystem = filesystem.FileSystem()
- self.workspace = workspace.Workspace(self.filesystem, self.executive)
- self._port = None
- self.user = user.User()
- self._scm = None
- self._checkout = None
- self.status_server = StatusServer()
- self.port_factory = port.factory
- self.platform = platforminfo.PlatformInfo()
-
- def scm(self):
- # Lazily initialize SCM to not error-out before command line parsing (or when running non-scm commands).
- if not self._scm:
- self._scm = default_scm(self._options.patch_directories)
- return self._scm
-
- def checkout(self):
- if not self._checkout:
- self._checkout = Checkout(self.scm())
- return self._checkout
-
- def port(self):
- return self._port
-
- def ensure_irc_connected(self, irc_delegate):
- if not self._irc:
- self._irc = IRCProxy(irc_delegate)
-
- def irc(self):
- # We don't automatically construct IRCProxy here because constructing
- # IRCProxy actually connects to IRC. We want clients to explicitly
- # connect to IRC.
- return self._irc
def path(self):
return self._path
- def command_completed(self):
- if self._irc:
- self._irc.disconnect()
-
def should_show_in_main_help(self, command):
if not command.show_in_main_help:
return False
@@ -120,7 +77,7 @@ class WebKitPatch(MultiCommandTool):
# FIXME: This may be unnecessary since we pass global options to all commands during execute() as well.
def handle_global_options(self, options):
- self._options = options
+ self._initialize_scm(options.patch_directories)
if options.dry_run:
self.scm().dryrun = True
self.bugs.dryrun = True