From b53757e2304cc4b48a0d6e26ef9b0585fbc5382a Mon Sep 17 00:00:00 2001 From: Kent Tamura Date: Fri, 20 Apr 2018 17:54:48 +0000 Subject: [PATCH] Move WebKit/Tools/Scripts/webkit-patch to blink/tools/blink_tool.py The suffix part of the new name is 'tool' instead of 'patch' because this command doesn't handle patches so much. Bug: 829697 Change-Id: I90f34b6260032a7bbaf562d9b58ffc1a55c3922f Reviewed-on: https://chromium-review.googlesource.com/1018700 Commit-Queue: Kent Tamura Reviewed-by: Dirk Pranke Reviewed-by: Quinten Yearsley Cr-Commit-Position: refs/heads/master@{#552382} --- docs/testing/layout_test_baseline_fallback.md | 14 +++---- docs/testing/layout_test_expectations.md | 12 +++--- .../harness/archived-results-dashboard.html | 2 +- .../Scripts/webkitpy/common/checkout/git.py | 3 +- .../controllers/layout_test_runner.py | 3 +- .../layout_tests/controllers/manager.py | 2 +- .../webkitpy/layout_tests/run_webkit_tests.py | 4 +- .../layout_tests/run_webkit_tests_unittest.py | 2 +- .../layout_tests/update_flaky_expectations.py | 3 +- .../update_flaky_expectations_unittest.py | 3 +- .../webkitpy/layout_tests/views/printing.py | 3 +- .../webkitruby/PrettyPatch/PrettyPatch.rb | 2 +- .../tools/blink_tool.py} | 8 ++-- .../tools/blinkpy}/tool/__init__.py | 0 .../tools/blinkpy/tool/blink_tool.py} | 39 +++++++++---------- .../blinkpy/tool/blink_tool_unittest.py} | 16 ++++---- .../tools/blinkpy}/tool/commands/__init__.py | 0 .../commands/abstract_local_server_command.py | 2 +- .../tool/commands/analyze_baselines.py | 2 +- .../commands/analyze_baselines_unittest.py | 4 +- .../tools/blinkpy}/tool/commands/command.py | 2 +- .../blinkpy}/tool/commands/command_test.py | 4 +- .../tool/commands/command_unittest.py | 2 +- .../tool/commands/copy_existing_baselines.py | 2 +- .../copy_existing_baselines_unittest.py | 4 +- .../blinkpy}/tool/commands/data/summary.html | 0 .../blinkpy}/tool/commands/flaky_tests.py | 2 +- .../tool/commands/flaky_tests_unittest.py | 8 ++-- .../blinkpy}/tool/commands/help_command.py | 2 +- .../tool/commands/optimize_baselines.py | 2 +- .../commands/optimize_baselines_unittest.py | 4 +- .../blinkpy}/tool/commands/pretty_diff.py | 2 +- .../tools/blinkpy}/tool/commands/queries.py | 2 +- .../tool/commands/queries_unittest.py | 8 ++-- .../blinkpy}/tool/commands/rebaseline.py | 16 ++++---- .../blinkpy}/tool/commands/rebaseline_cl.py | 9 ++--- .../tool/commands/rebaseline_cl_unittest.py | 12 +++--- .../tool/commands/rebaseline_server.py | 4 +- .../blinkpy}/tool/commands/rebaseline_test.py | 2 +- .../tool/commands/rebaseline_test_unittest.py | 4 +- .../tool/commands/rebaseline_unittest.py | 14 +++---- .../tools/blinkpy}/tool/grammar.py | 0 .../tools/blinkpy}/tool/grammar_unittest.py | 2 +- .../tools/blinkpy}/tool/mock_tool.py | 2 +- .../blinkpy/w3c/wpt_expectations_updater.py | 6 +-- tools/bash-completion | 12 +++--- 46 files changed, 126 insertions(+), 125 deletions(-) rename third_party/{WebKit/Tools/Scripts/webkit-patch => blink/tools/blink_tool.py} (93%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/__init__.py (100%) rename third_party/{WebKit/Tools/Scripts/webkitpy/tool/webkit_patch.py => blink/tools/blinkpy/tool/blink_tool.py} (79%) rename third_party/{WebKit/Tools/Scripts/webkitpy/tool/webkit_patch_unittest.py => blink/tools/blinkpy/tool/blink_tool_unittest.py} (76%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/__init__.py (100%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/abstract_local_server_command.py (98%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/analyze_baselines.py (98%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/analyze_baselines_unittest.py (92%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/command.py (99%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/command_test.py (96%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/command_unittest.py (98%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/copy_existing_baselines.py (98%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/copy_existing_baselines_unittest.py (97%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/data/summary.html (100%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/flaky_tests.py (99%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/flaky_tests_unittest.py (94%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/help_command.py (98%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/optimize_baselines.py (95%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/optimize_baselines_unittest.py (93%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/pretty_diff.py (98%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/queries.py (99%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/queries_unittest.py (97%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/rebaseline.py (98%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/rebaseline_cl.py (97%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/rebaseline_cl_unittest.py (98%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/rebaseline_server.py (95%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/rebaseline_test.py (97%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/rebaseline_test_unittest.py (97%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/commands/rebaseline_unittest.py (99%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/grammar.py (100%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/grammar_unittest.py (98%) rename third_party/{WebKit/Tools/Scripts/webkitpy => blink/tools/blinkpy}/tool/mock_tool.py (98%) diff --git a/docs/testing/layout_test_baseline_fallback.md b/docs/testing/layout_test_baseline_fallback.md index ef458bd7e01174..3c5ca3d8926855 100644 --- a/docs/testing/layout_test_baseline_fallback.md +++ b/docs/testing/layout_test_baseline_fallback.md @@ -86,15 +86,15 @@ document. ## Tooling implementation This section describes the implications the fallback mechanism has on the -implementation details of tooling, namely `webkit-patch`. If you are not hacking -`webkitpy`, you can stop here. +implementation details of tooling, namely `blink_tool.py`. If you are not +hacking `blinkpy`, you can stop here. ### Optimization We can remove a baseline if it is the same as its fallback. An extreme example is that if all platforms have the same result, we can just have a single generic baseline. Here is the algorithm used by -[`webkit-patch optimize-baselines`](../../third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/baseline_optimizer.py) +[`blink_tool.py optimize-baselines`](../../third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/baseline_optimizer.py) to optimize the duplication away. Notice from the previous section that the virtual and non-virtual parts are two @@ -123,7 +123,7 @@ not be found for a platform. ### Rebaseline -The fallback mechanism also affects the rebaseline tool (`webkit-patch +The fallback mechanism also affects the rebaseline tool (`blink_tool.py rebaseline{-cl}`). When asked to rebaseline a test on some platforms, the tool downloads results from corresponding try bots and put them into the respective platform directories. This is potentially problematic. Because of the fallback @@ -134,8 +134,8 @@ The solution is to copy the current baselines from the to-be-rebaselined platforms to all the platforms that immediately fall back to them (i.e. down one level in the fallback tree) before downloading new baselines. This is done in a hidden internal command -[`webkit-patch copy-existing-baselines`](../../third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/copy_existing_baselines.py), -which is always executed by `webkit-patch rebaseline`. +[`blink_tool.py copy-existing-baselines`](../../third_party/blink/tools/blinkpy/tool/commands/copy_existing_baselines.py), +which is always executed by `blink_tool.py rebaseline`. -Finally, `webkit-patch rebaseline{-cl}` also does optimization in the end by +Finally, `blink_tool.py rebaseline{-cl}` also does optimization in the end by default. diff --git a/docs/testing/layout_test_expectations.md b/docs/testing/layout_test_expectations.md index e4cbf9c9f86045..e884cf5de67891 100644 --- a/docs/testing/layout_test_expectations.md +++ b/docs/testing/layout_test_expectations.md @@ -97,17 +97,17 @@ platforms. The recommended way to rebaseline for a currently-in-progress CL is to use results from try jobs, by using the command-tool -`third_party/WebKit/Tools/Scripts/webkit-patch rebaseline-cl`: +`third_party/blink/tools/blink_tool.py rebaseline-cl`: 1. First, upload a CL. -2. Trigger try jobs by running `webkit-patch rebaseline-cl`. This should +2. Trigger try jobs by running `blink_tool.py rebaseline-cl`. This should trigger jobs on [tryserver.blink](https://build.chromium.org/p/tryserver.blink/builders). 3. Wait for all try jobs to finish. -4. Run `webkit-patch rebaseline-cl` again to fetch new baselines. +4. Run `blink_tool.py rebaseline-cl` again to fetch new baselines. By default, this will download new baselines for any failing tests in the try jobs. - (Run `webkit-patch rebaseline-cl --help` for more specific options.) + (Run `blink_tool.py rebaseline-cl --help` for more specific options.) 5. Commit the new baselines and upload a new patch. This way, the new baselines can be reviewed along with the changes, which helps @@ -118,7 +118,7 @@ is no period of time when the layout test results are ignored. ### Rebaselining with try jobs -The tests which `webkit-patch rebaseline-cl` tries to download new baselines for +The tests which `blink_tool.py rebaseline-cl` tries to download new baselines for depends on its arguments. * By default, it tries to download all baselines for tests that failed in the @@ -137,7 +137,7 @@ depends on its arguments. `NeedsManualRebaseline` and comment out the flaky line so that your patch can land without turning the tree red. If the test is not in TestExpectations, you can add a `[ Rebaseline ]` line to TestExpectations. -2. Run `third_party/WebKit/Tools/Scripts/webkit-patch rebaseline-expectations` +2. Run `third_party/blink/tools/blink_tool.py rebaseline-expectations` 3. Post the patch created in step 2 for review. ## Kinds of expectations files diff --git a/third_party/WebKit/LayoutTests/fast/harness/archived-results-dashboard.html b/third_party/WebKit/LayoutTests/fast/harness/archived-results-dashboard.html index 2a4fdf5f9a3ddf..6add0b3cf8197c 100644 --- a/third_party/WebKit/LayoutTests/fast/harness/archived-results-dashboard.html +++ b/third_party/WebKit/LayoutTests/fast/harness/archived-results-dashboard.html @@ -257,7 +257,7 @@ var url ='http://localhost:9630/'; xmlhttp.open('POST', url, true); xmlhttp.onerror = function() { - logText.innerHTML = 'Please run the server using "webkit-patch layout-test-server"'; + logText.innerHTML = 'Please run the server using "blink_tool.py layout-test-server"'; logText.className = 'test-fail'; alert('Server offline'); } diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/git.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/git.py index 853f3f51aed676..b2ed1f4f27dd0f 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/git.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/git.py @@ -113,7 +113,8 @@ def find_checkout_root(self, path): def read_git_config(cls, key, cwd=None, executive=None): # FIXME: This should probably use cwd=self.checkout_root. # Pass --get-all for cases where the config has multiple values - # Pass the cwd if provided so that we can handle the case of running webkit-patch outside of the working directory. + # Pass the cwd if provided so that we can handle the case of running + # blink_tool.py outside of the working directory. # FIXME: This should use an Executive. executive = executive or Executive() return executive.run_command( diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py index 42f86dbc7b2e6a..05faa3601c620c 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py @@ -30,13 +30,14 @@ import math import time +from webkitpy.common import add_blinkpy # pylint: disable=unused-import from webkitpy.common import message_pool from webkitpy.layout_tests.controllers import single_test_runner from webkitpy.layout_tests.models.test_run_results import TestRunResults from webkitpy.layout_tests.models import test_expectations from webkitpy.layout_tests.models import test_failures from webkitpy.layout_tests.models import test_results -from webkitpy.tool import grammar +from blinkpy.tool import grammar _log = logging.getLogger(__name__) diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py index 46bedd7465afc2..50a9ab3a3e4a91 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py @@ -55,7 +55,7 @@ from webkitpy.layout_tests.models import test_failures from webkitpy.layout_tests.models import test_run_results from webkitpy.layout_tests.models.test_input import TestInput -from webkitpy.tool import grammar +from blinkpy.tool import grammar from blinkpy.w3c.wpt_manifest import WPTManifest _log = logging.getLogger(__name__) diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py index eaaea407eb905a..49490fe4d15b5b 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py @@ -135,7 +135,7 @@ def parse_args(args): '--add-platform-exceptions', action='callback', callback=deprecate, - help=('Deprecated. Use "webkit-patch rebaseline*" instead.')), + help=('Deprecated. Use "blink_tool.py rebaseline*" instead.')), optparse.make_option( '--additional-driver-flag', '--additional-drt-flag', @@ -197,7 +197,7 @@ def parse_args(args): '--new-baseline', action='callback', callback=deprecate, - help=('Deprecated. Use "webkit-patch rebaseline*" instead.')), + help=('Deprecated. Use "blink_tool.py rebaseline*" instead.')), optparse.make_option( '--new-flag-specific-baseline', action='callback', diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py index 3e4ef2d1311bbe..a70bfbeb7c2685 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py @@ -1129,7 +1129,7 @@ class RebaselineTest(unittest.TestCase, StreamTestingMixin): """Tests for flags which cause new baselines to be written. When running layout tests, there are several flags which write new - baselines. This is separate from the "webkit-patch rebaseline" commands, + baselines. This is separate from the "blink_tool.py rebaseline" commands, which fetch new baselines from elsewhere rather than generating them. """ diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/update_flaky_expectations.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/update_flaky_expectations.py index 70ec16c1dcfd55..91b903ae93ec0a 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/update_flaky_expectations.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/update_flaky_expectations.py @@ -27,9 +27,10 @@ import logging import webbrowser +from webkitpy.common import add_blinkpy # pylint: disable=unused-import from webkitpy.layout_tests.models.test_expectations import CHROMIUM_BUG_PREFIX from webkitpy.layout_tests.models.test_expectations import TestExpectations -from webkitpy.tool.commands.flaky_tests import FlakyTests +from blinkpy.tool.commands.flaky_tests import FlakyTests _log = logging.getLogger(__name__) diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/update_flaky_expectations_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/update_flaky_expectations_unittest.py index 6720a557b4b3e1..c555b4dafe564b 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/update_flaky_expectations_unittest.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/update_flaky_expectations_unittest.py @@ -6,6 +6,7 @@ from collections import OrderedDict +from webkitpy.common import add_blinkpy # pylint: disable=unused-import from webkitpy.common.host_mock import MockHost from webkitpy.common.system.filesystem_mock import MockFileSystem from webkitpy.common.system.log_testing import LoggingTestCase @@ -14,7 +15,7 @@ from webkitpy.layout_tests.port.test import LAYOUT_TEST_DIR from webkitpy.layout_tests.update_flaky_expectations import main from webkitpy.layout_tests.update_flaky_expectations import RemoveFlakesOMatic -from webkitpy.tool.commands.flaky_tests import FlakyTests +from blinkpy.tool.commands.flaky_tests import FlakyTests class FakeBotTestExpectations(object): diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/views/printing.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/views/printing.py index 2db2454386ef24..bd731628f80ede 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/views/printing.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/views/printing.py @@ -31,9 +31,10 @@ import math import optparse +from webkitpy.common import add_blinkpy # pylint: disable=unused-import from webkitpy.layout_tests.models import test_expectations from webkitpy.layout_tests.views.metered_stream import MeteredStream -from webkitpy.tool import grammar +from blinkpy.tool import grammar NUM_SLOW_TESTS_TO_LOG = 10 diff --git a/third_party/WebKit/Tools/Scripts/webkitruby/PrettyPatch/PrettyPatch.rb b/third_party/WebKit/Tools/Scripts/webkitruby/PrettyPatch/PrettyPatch.rb index 3f46af166fe46d..07e599782e21b9 100644 --- a/third_party/WebKit/Tools/Scripts/webkitruby/PrettyPatch/PrettyPatch.rb +++ b/third_party/WebKit/Tools/Scripts/webkitruby/PrettyPatch/PrettyPatch.rb @@ -19,7 +19,7 @@ def self.prettify(string) str = "#{HEADER}\n" # Just look at the first line to see if it is an SVN revision number as added - # by webkit-patch for git checkouts. + # by blink_tool.py for git checkouts. $svn_revision = 0 string.each_line do |line| match = /^Subversion\ Revision: (\d*)$/.match(line) diff --git a/third_party/WebKit/Tools/Scripts/webkit-patch b/third_party/blink/tools/blink_tool.py similarity index 93% rename from third_party/WebKit/Tools/Scripts/webkit-patch rename to third_party/blink/tools/blink_tool.py index af68cd0ce1e3a9..9881fa55a7cd1d 100755 --- a/third_party/WebKit/Tools/Scripts/webkit-patch +++ b/third_party/blink/tools/blink_tool.py @@ -36,10 +36,10 @@ import signal import sys -import webkitpy.common.version_check - +from blinkpy.common import add_webkitpy # pylint: disable=unused-import +from webkitpy.common import version_check # pylint: disable=unused-import from webkitpy.common.system.log_utils import configure_logging -from webkitpy.tool.webkit_patch import WebKitPatch +from blinkpy.tool.blink_tool import BlinkTool # A StreamWriter will by default try to encode all objects passed # to write(), so when passed a raw string already encoded as utf8, @@ -76,7 +76,7 @@ def main(): else: logging_level = logging.INFO configure_logging(logging_level=logging_level) - WebKitPatch(os.path.abspath(__file__)).main() + BlinkTool(os.path.abspath(__file__)).main() if __name__ == "__main__": diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/__init__.py b/third_party/blink/tools/blinkpy/tool/__init__.py similarity index 100% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/__init__.py rename to third_party/blink/tools/blinkpy/tool/__init__.py diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch.py b/third_party/blink/tools/blinkpy/tool/blink_tool.py similarity index 79% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch.py rename to third_party/blink/tools/blinkpy/tool/blink_tool.py index 95c9ec86084cd5..662a0e676eab50 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch.py +++ b/third_party/blink/tools/blinkpy/tool/blink_tool.py @@ -27,12 +27,9 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -"""Webkit-patch is a tool with multiple sub-commands with different purposes. - -Historically, it had commands related to dealing with bugzilla and posting -and committing patches to WebKit. More recently, it has commands for printing -expectations, fetching new test baselines, etc. +"""blink_tool.py is a tool with multiple sub-commands with different purposes. +It has commands for printing expectations, fetching new test baselines, etc. These commands don't necessarily have anything to do with each other. """ @@ -41,26 +38,26 @@ import sys from webkitpy.common.host import Host -from webkitpy.tool.commands.analyze_baselines import AnalyzeBaselines -from webkitpy.tool.commands.command import HelpPrintingOptionParser -from webkitpy.tool.commands.copy_existing_baselines import CopyExistingBaselines -from webkitpy.tool.commands.flaky_tests import FlakyTests -from webkitpy.tool.commands.help_command import HelpCommand -from webkitpy.tool.commands.optimize_baselines import OptimizeBaselines -from webkitpy.tool.commands.pretty_diff import PrettyDiff -from webkitpy.tool.commands.queries import CrashLog -from webkitpy.tool.commands.queries import PrintBaselines -from webkitpy.tool.commands.queries import PrintExpectations -from webkitpy.tool.commands.rebaseline import Rebaseline -from webkitpy.tool.commands.rebaseline import RebaselineExpectations -from webkitpy.tool.commands.rebaseline_cl import RebaselineCL -from webkitpy.tool.commands.rebaseline_test import RebaselineTest +from blinkpy.tool.commands.analyze_baselines import AnalyzeBaselines +from blinkpy.tool.commands.command import HelpPrintingOptionParser +from blinkpy.tool.commands.copy_existing_baselines import CopyExistingBaselines +from blinkpy.tool.commands.flaky_tests import FlakyTests +from blinkpy.tool.commands.help_command import HelpCommand +from blinkpy.tool.commands.optimize_baselines import OptimizeBaselines +from blinkpy.tool.commands.pretty_diff import PrettyDiff +from blinkpy.tool.commands.queries import CrashLog +from blinkpy.tool.commands.queries import PrintBaselines +from blinkpy.tool.commands.queries import PrintExpectations +from blinkpy.tool.commands.rebaseline import Rebaseline +from blinkpy.tool.commands.rebaseline import RebaselineExpectations +from blinkpy.tool.commands.rebaseline_cl import RebaselineCL +from blinkpy.tool.commands.rebaseline_test import RebaselineTest _log = logging.getLogger(__name__) -class WebKitPatch(Host): +class BlinkTool(Host): # FIXME: It might make more sense if this class had a Host attribute # instead of being a Host subclass. @@ -74,7 +71,7 @@ class WebKitPatch(Host): ] def __init__(self, path): - super(WebKitPatch, self).__init__() + super(BlinkTool, self).__init__() self._path = path self.commands = [ AnalyzeBaselines(), diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch_unittest.py b/third_party/blink/tools/blinkpy/tool/blink_tool_unittest.py similarity index 76% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch_unittest.py rename to third_party/blink/tools/blinkpy/tool/blink_tool_unittest.py index ec891f514a01c9..958a23dfacdfa2 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/webkit_patch_unittest.py +++ b/third_party/blink/tools/blinkpy/tool/blink_tool_unittest.py @@ -5,35 +5,35 @@ import unittest from webkitpy.common.system.output_capture import OutputCapture -from webkitpy.tool.webkit_patch import WebKitPatch +from blinkpy.tool.blink_tool import BlinkTool -class WebKitPatchTest(unittest.TestCase): +class BlinkToolTest(unittest.TestCase): def test_split_args_basic(self): self.assertEqual( - WebKitPatch._split_command_name_from_args(['--global-option', 'command', '--option', 'arg']), + BlinkTool._split_command_name_from_args(['--global-option', 'command', '--option', 'arg']), ('command', ['--global-option', '--option', 'arg'])) def test_split_args_empty(self): self.assertEqual( - WebKitPatch._split_command_name_from_args([]), + BlinkTool._split_command_name_from_args([]), (None, [])) def test_split_args_with_no_options(self): self.assertEqual( - WebKitPatch._split_command_name_from_args(['command', 'arg']), + BlinkTool._split_command_name_from_args(['command', 'arg']), ('command', ['arg'])) def test_command_by_name(self): - tool = WebKitPatch('path') + tool = BlinkTool('path') self.assertEqual(tool.command_by_name('help').name, 'help') self.assertIsNone(tool.command_by_name('non-existent')) def test_help_command(self): oc = OutputCapture() oc.capture_output() - tool = WebKitPatch('path') + tool = BlinkTool('path') tool.main(['tool', 'help']) out, err, logs = oc.restore_output() self.assertTrue(out.startswith('Usage: ')) @@ -43,7 +43,7 @@ def test_help_command(self): def test_help_argument(self): oc = OutputCapture() oc.capture_output() - tool = WebKitPatch('path') + tool = BlinkTool('path') try: tool.main(['tool', '--help']) except SystemExit: diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/__init__.py b/third_party/blink/tools/blinkpy/tool/commands/__init__.py similarity index 100% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/__init__.py rename to third_party/blink/tools/blinkpy/tool/commands/__init__.py diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/abstract_local_server_command.py b/third_party/blink/tools/blinkpy/tool/commands/abstract_local_server_command.py similarity index 98% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/abstract_local_server_command.py rename to third_party/blink/tools/blinkpy/tool/commands/abstract_local_server_command.py index 3a73833b2f8af0..1def94941a67e3 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/abstract_local_server_command.py +++ b/third_party/blink/tools/blinkpy/tool/commands/abstract_local_server_command.py @@ -25,7 +25,7 @@ from optparse import make_option import threading -from webkitpy.tool.commands.command import Command +from blinkpy.tool.commands.command import Command class AbstractLocalServerCommand(Command): diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/analyze_baselines.py b/third_party/blink/tools/blinkpy/tool/commands/analyze_baselines.py similarity index 98% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/analyze_baselines.py rename to third_party/blink/tools/blinkpy/tool/commands/analyze_baselines.py index 0342735636f51e..4bcb933c1f0a4a 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/analyze_baselines.py +++ b/third_party/blink/tools/blinkpy/tool/commands/analyze_baselines.py @@ -30,7 +30,7 @@ import optparse from webkitpy.common.checkout.baseline_optimizer import BaselineOptimizer -from webkitpy.tool.commands.rebaseline import AbstractRebaseliningCommand +from blinkpy.tool.commands.rebaseline import AbstractRebaseliningCommand _log = logging.getLogger(__name__) diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/analyze_baselines_unittest.py b/third_party/blink/tools/blinkpy/tool/commands/analyze_baselines_unittest.py similarity index 92% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/analyze_baselines_unittest.py rename to third_party/blink/tools/blinkpy/tool/commands/analyze_baselines_unittest.py index e88ca147b7c6cb..c2ee23cb3c5260 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/analyze_baselines_unittest.py +++ b/third_party/blink/tools/blinkpy/tool/commands/analyze_baselines_unittest.py @@ -5,8 +5,8 @@ import optparse from webkitpy.common.checkout.baseline_optimizer import BaselineOptimizer -from webkitpy.tool.commands.analyze_baselines import AnalyzeBaselines -from webkitpy.tool.commands.rebaseline_unittest import BaseTestCase +from blinkpy.tool.commands.analyze_baselines import AnalyzeBaselines +from blinkpy.tool.commands.rebaseline_unittest import BaseTestCase class _FakeOptimizer(BaselineOptimizer): diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/command.py b/third_party/blink/tools/blinkpy/tool/commands/command.py similarity index 99% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/command.py rename to third_party/blink/tools/blinkpy/tool/commands/command.py index 4503a58a1567c4..4a5864869c4e15 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/command.py +++ b/third_party/blink/tools/blinkpy/tool/commands/command.py @@ -30,7 +30,7 @@ import logging import sys -from webkitpy.tool.grammar import pluralize +from blinkpy.tool.grammar import pluralize _log = logging.getLogger(__name__) diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/command_test.py b/third_party/blink/tools/blinkpy/tool/commands/command_test.py similarity index 96% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/command_test.py rename to third_party/blink/tools/blinkpy/tool/commands/command_test.py index 18d7d688b9fd9f..8b73a746cbf7cb 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/command_test.py +++ b/third_party/blink/tools/blinkpy/tool/commands/command_test.py @@ -30,14 +30,14 @@ import unittest from webkitpy.common.system.output_capture import OutputCapture -from webkitpy.tool.mock_tool import MockWebKitPatch +from blinkpy.tool.mock_tool import MockBlinkTool class CommandsTest(unittest.TestCase): def assert_execute_outputs( self, command, args=None, expected_stdout='', expected_stderr='', - expected_exception=None, expected_logs=None, options=optparse.Values(), tool=MockWebKitPatch()): + expected_exception=None, expected_logs=None, options=optparse.Values(), tool=MockBlinkTool()): args = args or [] options.blocks = None options.cc = 'MOCK cc' diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/command_unittest.py b/third_party/blink/tools/blinkpy/tool/commands/command_unittest.py similarity index 98% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/command_unittest.py rename to third_party/blink/tools/blinkpy/tool/commands/command_unittest.py index f9cd52ff599fa0..27c86c985608a3 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/command_unittest.py +++ b/third_party/blink/tools/blinkpy/tool/commands/command_unittest.py @@ -30,7 +30,7 @@ import unittest from webkitpy.common.system.output_capture import OutputCapture -from webkitpy.tool.commands.command import Command +from blinkpy.tool.commands.command import Command class TrivialCommand(Command): diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/copy_existing_baselines.py b/third_party/blink/tools/blinkpy/tool/commands/copy_existing_baselines.py similarity index 98% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/copy_existing_baselines.py rename to third_party/blink/tools/blinkpy/tool/commands/copy_existing_baselines.py index 699babfe837a1c..553d8d0b89e114 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/copy_existing_baselines.py +++ b/third_party/blink/tools/blinkpy/tool/commands/copy_existing_baselines.py @@ -7,7 +7,7 @@ from webkitpy.common.memoized import memoized from webkitpy.layout_tests.models.test_expectations import SKIP from webkitpy.layout_tests.models.test_expectations import TestExpectations -from webkitpy.tool.commands.rebaseline import AbstractRebaseliningCommand +from blinkpy.tool.commands.rebaseline import AbstractRebaseliningCommand _log = logging.getLogger(__name__) diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/copy_existing_baselines_unittest.py b/third_party/blink/tools/blinkpy/tool/commands/copy_existing_baselines_unittest.py similarity index 97% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/copy_existing_baselines_unittest.py rename to third_party/blink/tools/blinkpy/tool/commands/copy_existing_baselines_unittest.py index b01f871b6011ab..67ab390297c3dd 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/copy_existing_baselines_unittest.py +++ b/third_party/blink/tools/blinkpy/tool/commands/copy_existing_baselines_unittest.py @@ -4,8 +4,8 @@ import optparse -from webkitpy.tool.commands.rebaseline_unittest import BaseTestCase -from webkitpy.tool.commands.copy_existing_baselines import CopyExistingBaselines +from blinkpy.tool.commands.rebaseline_unittest import BaseTestCase +from blinkpy.tool.commands.copy_existing_baselines import CopyExistingBaselines class TestCopyExistingBaselines(BaseTestCase): diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/data/summary.html b/third_party/blink/tools/blinkpy/tool/commands/data/summary.html similarity index 100% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/data/summary.html rename to third_party/blink/tools/blinkpy/tool/commands/data/summary.html diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/flaky_tests.py b/third_party/blink/tools/blinkpy/tool/commands/flaky_tests.py similarity index 99% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/flaky_tests.py rename to third_party/blink/tools/blinkpy/tool/commands/flaky_tests.py index 77f8e135ff4357..fc283e6233c6aa 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/flaky_tests.py +++ b/third_party/blink/tools/blinkpy/tool/commands/flaky_tests.py @@ -31,7 +31,7 @@ from webkitpy.layout_tests.layout_package.bot_test_expectations import BotTestExpectationsFactory from webkitpy.layout_tests.models.test_expectations import TestExpectations from webkitpy.layout_tests.models.test_expectations import TestExpectationsModel -from webkitpy.tool.commands.command import Command +from blinkpy.tool.commands.command import Command _log = logging.getLogger(__name__) diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/flaky_tests_unittest.py b/third_party/blink/tools/blinkpy/tool/commands/flaky_tests_unittest.py similarity index 94% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/flaky_tests_unittest.py rename to third_party/blink/tools/blinkpy/tool/commands/flaky_tests_unittest.py index 966c7a4ed2646a..d38c5ca871b663 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/flaky_tests_unittest.py +++ b/third_party/blink/tools/blinkpy/tool/commands/flaky_tests_unittest.py @@ -6,9 +6,9 @@ from webkitpy.layout_tests.builder_list import BuilderList from webkitpy.layout_tests.layout_package import bot_test_expectations -from webkitpy.tool.commands import flaky_tests -from webkitpy.tool.commands.command_test import CommandsTest -from webkitpy.tool.mock_tool import MockWebKitPatch +from blinkpy.tool.commands import flaky_tests +from blinkpy.tool.commands.command_test import CommandsTest +from blinkpy.tool.mock_tool import MockBlinkTool class FakeBotTestExpectations(object): @@ -72,7 +72,7 @@ def test_merge_lines(self): def test_integration(self): command = flaky_tests.FlakyTests() - tool = MockWebKitPatch() + tool = MockBlinkTool() tool.builders = self.fake_builders_list() command.expectations_factory = FakeBotTestExpectationsFactory options = optparse.Values({'upload': True}) diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/help_command.py b/third_party/blink/tools/blinkpy/tool/commands/help_command.py similarity index 98% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/help_command.py rename to third_party/blink/tools/blinkpy/tool/commands/help_command.py index fa700b4a326ed7..366b73b4c8d75f 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/help_command.py +++ b/third_party/blink/tools/blinkpy/tool/commands/help_command.py @@ -28,7 +28,7 @@ import optparse -from webkitpy.tool.commands.command import Command +from blinkpy.tool.commands.command import Command class HelpCommand(Command): diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/optimize_baselines.py b/third_party/blink/tools/blinkpy/tool/commands/optimize_baselines.py similarity index 95% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/optimize_baselines.py rename to third_party/blink/tools/blinkpy/tool/commands/optimize_baselines.py index 6fe32143397a96..86ac1d512c88d4 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/optimize_baselines.py +++ b/third_party/blink/tools/blinkpy/tool/commands/optimize_baselines.py @@ -5,7 +5,7 @@ import logging from webkitpy.common.checkout.baseline_optimizer import BaselineOptimizer -from webkitpy.tool.commands.rebaseline import AbstractRebaseliningCommand +from blinkpy.tool.commands.rebaseline import AbstractRebaseliningCommand _log = logging.getLogger(__name__) diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/optimize_baselines_unittest.py b/third_party/blink/tools/blinkpy/tool/commands/optimize_baselines_unittest.py similarity index 93% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/optimize_baselines_unittest.py rename to third_party/blink/tools/blinkpy/tool/commands/optimize_baselines_unittest.py index 26eb0e91ea56df..821ff40d684c48 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/optimize_baselines_unittest.py +++ b/third_party/blink/tools/blinkpy/tool/commands/optimize_baselines_unittest.py @@ -4,8 +4,8 @@ import optparse -from webkitpy.tool.commands.optimize_baselines import OptimizeBaselines -from webkitpy.tool.commands.rebaseline_unittest import BaseTestCase +from blinkpy.tool.commands.optimize_baselines import OptimizeBaselines +from blinkpy.tool.commands.rebaseline_unittest import BaseTestCase class TestOptimizeBaselines(BaseTestCase): diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/pretty_diff.py b/third_party/blink/tools/blinkpy/tool/commands/pretty_diff.py similarity index 98% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/pretty_diff.py rename to third_party/blink/tools/blinkpy/tool/commands/pretty_diff.py index 5622813cc6fdf1..4f92dcfd2f0cf7 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/pretty_diff.py +++ b/third_party/blink/tools/blinkpy/tool/commands/pretty_diff.py @@ -33,7 +33,7 @@ from webkitpy.common.prettypatch import PrettyPatch from webkitpy.common.system.executive import ScriptError -from webkitpy.tool.commands.command import Command +from blinkpy.tool.commands.command import Command _log = logging.getLogger(__name__) diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries.py b/third_party/blink/tools/blinkpy/tool/commands/queries.py similarity index 99% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries.py rename to third_party/blink/tools/blinkpy/tool/commands/queries.py index 3cbc4185a3fbc9..40ec490699599b 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries.py +++ b/third_party/blink/tools/blinkpy/tool/commands/queries.py @@ -34,7 +34,7 @@ from optparse import make_option from webkitpy.common.system.crash_logs import CrashLogs -from webkitpy.tool.commands.command import Command +from blinkpy.tool.commands.command import Command from webkitpy.layout_tests.models.test_expectations import TestExpectations from webkitpy.layout_tests.port.factory import platform_options diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py b/third_party/blink/tools/blinkpy/tool/commands/queries_unittest.py similarity index 97% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py rename to third_party/blink/tools/blinkpy/tool/commands/queries_unittest.py index 49fab77749903c..4f1dd93533b7b6 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py +++ b/third_party/blink/tools/blinkpy/tool/commands/queries_unittest.py @@ -31,8 +31,8 @@ import unittest from webkitpy.common.system.output_capture import OutputCapture -from webkitpy.tool.commands.queries import PrintBaselines, PrintExpectations -from webkitpy.tool.mock_tool import MockWebKitPatch +from blinkpy.tool.commands.queries import PrintBaselines, PrintExpectations +from blinkpy.tool.mock_tool import MockBlinkTool class PrintExpectationsTest(unittest.TestCase): @@ -44,7 +44,7 @@ def run_test(self, tests, expected_stdout, platform='test-win-win7', **kwargs): } options_defaults.update(kwargs) options = optparse.Values(dict(**options_defaults)) - tool = MockWebKitPatch() + tool = MockBlinkTool() tool.port_factory.all_port_names = lambda: [ 'test-linux-trusty', 'test-linux-precise', 'test-mac-mac10.11', 'test-mac-mac10.10', @@ -115,7 +115,7 @@ class PrintBaselinesTest(unittest.TestCase): def setUp(self): self.oc = None - self.tool = MockWebKitPatch() + self.tool = MockBlinkTool() self.test_port = self.tool.port_factory.get('test-win-win7') self.tool.port_factory.get = lambda port_name=None: self.test_port self.tool.port_factory.all_port_names = lambda: [ diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py b/third_party/blink/tools/blinkpy/tool/commands/rebaseline.py similarity index 98% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py rename to third_party/blink/tools/blinkpy/tool/commands/rebaseline.py index 07ee5f815ab835..f3c0aa8cb41702 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py +++ b/third_party/blink/tools/blinkpy/tool/commands/rebaseline.py @@ -37,7 +37,7 @@ from webkitpy.layout_tests.controllers.test_result_writer import TestResultWriter from webkitpy.layout_tests.models.test_expectations import TestExpectations from webkitpy.layout_tests.port import base, factory -from webkitpy.tool.commands.command import Command +from blinkpy.tool.commands.command import Command _log = logging.getLogger(__name__) @@ -54,7 +54,7 @@ class AbstractRebaseliningCommand(Command): no_optimize_option = optparse.make_option( '--no-optimize', dest='optimize', action='store_false', default=True, help=('Do not optimize (de-duplicate) the expectations after rebaselining ' - '(default is to de-dupe automatically). You can use "webkit-patch ' + '(default is to de-dupe automatically). You can use "blink_tool.py ' 'optimize-baselines" to optimize separately.')) platform_options = factory.platform_options(use_globs=True) results_directory_option = optparse.make_option( @@ -262,7 +262,7 @@ def _builders_to_fetch_from(self, builders_to_check): return set(builders_to_fallback_paths) def _rebaseline_commands(self, test_baseline_set, options): - path_to_webkit_patch = self._tool.path() + path_to_blink_tool = self._tool.path() cwd = self._tool.git().checkout_root copy_baseline_commands = [] rebaseline_commands = [] @@ -295,7 +295,7 @@ def _rebaseline_commands(self, test_baseline_set, options): '--port-name', port_name, ]) - copy_command = [self._tool.executable, path_to_webkit_patch, 'copy-existing-baselines-internal'] + args + copy_command = [self._tool.executable, path_to_blink_tool, 'copy-existing-baselines-internal'] + args copy_baseline_commands.append(tuple([copy_command, cwd])) args.extend(['--builder', build.builder_name]) @@ -304,7 +304,7 @@ def _rebaseline_commands(self, test_baseline_set, options): if options.results_directory: args.extend(['--results-directory', options.results_directory]) - rebaseline_command = [self._tool.executable, path_to_webkit_patch, 'rebaseline-test-internal'] + args + rebaseline_command = [self._tool.executable, path_to_blink_tool, 'rebaseline-test-internal'] + args rebaseline_commands.append(tuple([rebaseline_command, cwd])) return copy_baseline_commands, rebaseline_commands, lines_to_remove @@ -346,9 +346,9 @@ def _optimize_baselines(self, test_baseline_set, verbose=False): if verbose: args.append('--verbose') args.extend(['--suffixes', ','.join(suffixes), test]) - path_to_webkit_patch = self._tool.path() + path_to_blink_tool = self._tool.path() cwd = self._tool.git().checkout_root - command = [self._tool.executable, path_to_webkit_patch, 'optimize-baselines'] + args + command = [self._tool.executable, path_to_blink_tool, 'optimize-baselines'] + args optimize_commands.append(tuple([command, cwd])) return optimize_commands @@ -360,7 +360,7 @@ def _update_expectations_files(self, lines_to_remove): # This is so we remove lines for builders that skip this test. # For example, Android skips most tests and we don't want to leave # stray [ Android ] lines in TestExpectations. - # This is only necessary for "webkit-patch rebaseline". + # This is only necessary for "blink_tool.py rebaseline". for port_name in self._tool.port_factory.all_port_names(): port = self._tool.port_factory.get(port_name) for test in tests: diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_cl.py similarity index 97% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py rename to third_party/blink/tools/blinkpy/tool/commands/rebaseline_cl.py index d053b4b9859299..29c840e2d1c1e2 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py +++ b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_cl.py @@ -8,11 +8,10 @@ import logging import optparse -from webkitpy.common import add_blinkpy # pylint: disable=unused-import from webkitpy.common.net.git_cl import GitCL, TryJobStatus from webkitpy.common.path_finder import PathFinder -from webkitpy.tool.commands.rebaseline import AbstractParallelRebaselineCommand -from webkitpy.tool.commands.rebaseline import TestBaselineSet +from blinkpy.tool.commands.rebaseline import AbstractParallelRebaselineCommand +from blinkpy.tool.commands.rebaseline import TestBaselineSet from blinkpy.w3c.wpt_manifest import WPTManifest @@ -81,7 +80,7 @@ def execute(self, options, args, tool): # The WPT manifest is required when iterating through tests # TestBaselineSet if there are any tests in web-platform-tests. - # TODO(qyearsley): Consider calling ensure_manifest in WebKitPatch. + # TODO(qyearsley): Consider calling ensure_manifest in BlinkTool. # See: crbug.com/698294 WPTManifest.ensure_manifest(tool) @@ -180,7 +179,7 @@ def trigger_try_jobs(self, builders): _log.info(' %s', builder) self.git_cl.trigger_try_jobs(builders) _log.info('Once all pending try jobs have finished, please re-run\n' - 'webkit-patch rebaseline-cl to fetch new baselines.') + 'blink_tool.py rebaseline-cl to fetch new baselines.') def _log_jobs(self, jobs): """Logs the current state of the try jobs. diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl_unittest.py b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_cl_unittest.py similarity index 98% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl_unittest.py rename to third_party/blink/tools/blinkpy/tool/commands/rebaseline_cl_unittest.py index db253bb456014e..9ef7a347914fec 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl_unittest.py +++ b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_cl_unittest.py @@ -13,9 +13,9 @@ from webkitpy.common.net.layout_test_results import LayoutTestResults from webkitpy.common.system.log_testing import LoggingTestCase from webkitpy.layout_tests.builder_list import BuilderList -from webkitpy.tool.commands.rebaseline import TestBaselineSet -from webkitpy.tool.commands.rebaseline_cl import RebaselineCL -from webkitpy.tool.commands.rebaseline_unittest import BaseTestCase +from blinkpy.tool.commands.rebaseline import TestBaselineSet +from blinkpy.tool.commands.rebaseline_cl import RebaselineCL +from blinkpy.tool.commands.rebaseline_unittest import BaseTestCase class RebaselineCLTest(BaseTestCase, LoggingTestCase): @@ -193,7 +193,7 @@ def test_execute_no_try_jobs_started_triggers_jobs(self): 'INFO: MOCK Try Mac\n', 'INFO: MOCK Try Win\n', 'INFO: Once all pending try jobs have finished, please re-run\n' - 'webkit-patch rebaseline-cl to fetch new baselines.\n' + 'blink_tool.py rebaseline-cl to fetch new baselines.\n' ]) def test_execute_no_try_jobs_started_and_no_trigger_jobs(self): @@ -223,7 +223,7 @@ def test_execute_one_missing_build(self): 'INFO: Triggering try jobs:\n', 'INFO: MOCK Try Linux\n', 'INFO: Once all pending try jobs have finished, please re-run\n' - 'webkit-patch rebaseline-cl to fetch new baselines.\n', + 'blink_tool.py rebaseline-cl to fetch new baselines.\n', ]) def test_execute_with_unfinished_jobs(self): @@ -400,7 +400,7 @@ def test_trigger_try_jobs(self): 'INFO: MOCK Try Linux\n', 'INFO: MOCK Try Win\n', 'INFO: Once all pending try jobs have finished, please re-run\n' - 'webkit-patch rebaseline-cl to fetch new baselines.\n', + 'blink_tool.py rebaseline-cl to fetch new baselines.\n', ]) def test_execute_missing_results_with_no_fill_missing_prompts(self): diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_server.py b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_server.py similarity index 95% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_server.py rename to third_party/blink/tools/blinkpy/tool/commands/rebaseline_server.py index 00f97fd4b45c5e..93edcf55e5edce 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_server.py +++ b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_server.py @@ -34,8 +34,8 @@ from webkitpy.common.host import Host from webkitpy.common.net.layout_test_results import LayoutTestResults from webkitpy.layout_tests.layout_package import json_results_generator -from webkitpy.tool.commands.abstract_local_server_command import AbstractLocalServerCommand -from webkitpy.tool.servers.rebaseline_server import get_test_baselines, RebaselineHTTPServer, STATE_NEEDS_REBASELINE +from blinkpy.tool.commands.abstract_local_server_command import AbstractLocalServerCommand +from blinkpy.tool.servers.rebaseline_server import get_test_baselines, RebaselineHTTPServer, STATE_NEEDS_REBASELINE class TestConfig(object): diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_test.py b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_test.py similarity index 97% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_test.py rename to third_party/blink/tools/blinkpy/tool/commands/rebaseline_test.py index 66d0305d3ef233..a28db4478534c1 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_test.py +++ b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_test.py @@ -5,7 +5,7 @@ import json import logging -from webkitpy.tool.commands.rebaseline import AbstractRebaseliningCommand +from blinkpy.tool.commands.rebaseline import AbstractRebaseliningCommand _log = logging.getLogger(__name__) diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_test_unittest.py b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_test_unittest.py similarity index 97% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_test_unittest.py rename to third_party/blink/tools/blinkpy/tool/commands/rebaseline_test_unittest.py index 024f43d00b91a1..68eac4eb49b71a 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_test_unittest.py +++ b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_test_unittest.py @@ -6,8 +6,8 @@ from webkitpy.common.system.executive_mock import MockExecutive from webkitpy.common.system.output_capture import OutputCapture -from webkitpy.tool.commands.rebaseline_test import RebaselineTest -from webkitpy.tool.commands.rebaseline_unittest import BaseTestCase +from blinkpy.tool.commands.rebaseline_test import RebaselineTest +from blinkpy.tool.commands.rebaseline_unittest import BaseTestCase class TestRebaselineTest(BaseTestCase): diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_unittest.py similarity index 99% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py rename to third_party/blink/tools/blinkpy/tool/commands/rebaseline_unittest.py index ec6bfaf23f6ab7..7103a79c3b52ad 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py +++ b/third_party/blink/tools/blinkpy/tool/commands/rebaseline_unittest.py @@ -11,11 +11,11 @@ from webkitpy.common.system.executive_mock import MockExecutive from webkitpy.layout_tests.builder_list import BuilderList from webkitpy.layout_tests.port.factory_mock import MockPortFactory -from webkitpy.tool.commands.rebaseline import ( +from blinkpy.tool.commands.rebaseline import ( AbstractParallelRebaselineCommand, Rebaseline, RebaselineExpectations, TestBaselineSet ) -from webkitpy.tool.mock_tool import MockWebKitPatch +from blinkpy.tool.mock_tool import MockBlinkTool class BaseTestCase(unittest.TestCase): @@ -25,7 +25,7 @@ class BaseTestCase(unittest.TestCase): command_constructor = lambda: None def setUp(self): - self.tool = MockWebKitPatch() + self.tool = MockBlinkTool() self.command = self.command_constructor() self.command._tool = self.tool # pylint: disable=protected-access self.tool.builders = BuilderList({ @@ -154,7 +154,7 @@ def test_unstaged_baselines(self): class TestRebaseline(BaseTestCase): - """Tests for the webkit-patch rebaseline command. + """Tests for the blink_tool.py rebaseline command. Also tests some common behaviours of all rebaseline commands. """ @@ -601,7 +601,7 @@ def test_rebaseline_test_passes_unexpectedly_but_on_another_port(self): class TestRebaselineExecute(BaseTestCase): - """Tests for the main execute function of the webkit-patch rebaseline command.""" + """Tests for the main execute function of the blink_tool.py rebaseline command.""" command_constructor = Rebaseline @@ -689,7 +689,7 @@ def test_rebaseline_directory(self): class TestRebaselineExpectations(BaseTestCase): - """Tests for the webkit-patch rebaseline-expectations command.""" + """Tests for the blink_tool.py rebaseline-expectations command.""" command_constructor = RebaselineExpectations @@ -976,7 +976,7 @@ def test_rebaseline_missing(self): class TestBaselineSetTest(unittest.TestCase): def setUp(self): - host = MockWebKitPatch() + host = MockBlinkTool() host.port_factory = MockPortFactory(host) port = host.port_factory.get() base_dir = port.layout_tests_dir() diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/grammar.py b/third_party/blink/tools/blinkpy/tool/grammar.py similarity index 100% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/grammar.py rename to third_party/blink/tools/blinkpy/tool/grammar.py diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/grammar_unittest.py b/third_party/blink/tools/blinkpy/tool/grammar_unittest.py similarity index 98% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/grammar_unittest.py rename to third_party/blink/tools/blinkpy/tool/grammar_unittest.py index 01a8ab07217c94..3e7aa1b9f484ec 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/grammar_unittest.py +++ b/third_party/blink/tools/blinkpy/tool/grammar_unittest.py @@ -28,7 +28,7 @@ import unittest -from webkitpy.tool import grammar +from blinkpy.tool import grammar class GrammarTest(unittest.TestCase): diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/mock_tool.py b/third_party/blink/tools/blinkpy/tool/mock_tool.py similarity index 98% rename from third_party/WebKit/Tools/Scripts/webkitpy/tool/mock_tool.py rename to third_party/blink/tools/blinkpy/tool/mock_tool.py index 47611635f0fdbe..9f94799dc0b689 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/mock_tool.py +++ b/third_party/blink/tools/blinkpy/tool/mock_tool.py @@ -29,7 +29,7 @@ from webkitpy.common.host_mock import MockHost -class MockWebKitPatch(MockHost): +class MockBlinkTool(MockHost): def __init__(self, *args, **kwargs): MockHost.__init__(self, *args, **kwargs) diff --git a/third_party/blink/tools/blinkpy/w3c/wpt_expectations_updater.py b/third_party/blink/tools/blinkpy/w3c/wpt_expectations_updater.py index d87febadf28510..4db14de4510744 100644 --- a/third_party/blink/tools/blinkpy/w3c/wpt_expectations_updater.py +++ b/third_party/blink/tools/blinkpy/w3c/wpt_expectations_updater.py @@ -473,7 +473,7 @@ def write_to_test_expectations(self, line_dict): def download_text_baselines(self, test_results): """Fetches new baseline files for tests that should be rebaselined. - Invokes `webkit-patch rebaseline-cl` in order to download new baselines + Invokes `blink_tool.py rebaseline-cl` in order to download new baselines (-expected.txt files) for testharness.js tests that did not crash or time out. Then, the platform-specific test is removed from the overall failure test dictionary and the resulting dictionary is returned. @@ -495,10 +495,10 @@ def download_text_baselines(self, test_results): for test in tests_to_rebaseline: _log.info(' %s', test) - webkit_patch = self.finder.path_from_tools_scripts('webkit-patch') + blink_tool = self.finder.path_from_blink_tools('blink_tool.py') self.host.executive.run_command([ 'python', - webkit_patch, + blink_tool, 'rebaseline-cl', '--verbose', '--no-trigger-jobs', diff --git a/tools/bash-completion b/tools/bash-completion index 2c5c00f558654f..5645dffe55680a 100644 --- a/tools/bash-completion +++ b/tools/bash-completion @@ -20,8 +20,8 @@ # $ third_party/WebKit/Tools/Scripts/run-webkit-tests --additional-driver-f # $ .../run-webkit-tests --additional-driver-flag=--site-per-pro # -# Blink webkit-patch sub-commands: -# $ third_party/WebKit/Tools/Scripts/webkit-patch reb +# Blink blink_tool.py sub-commands: +# $ third_party/blink/tools/blink_tool.py reb if [ -n "$BASH_SOURCE" ]; then # The $BASH_SOURCE variable returns path of current script in bash. @@ -80,11 +80,11 @@ _layout_test_flag() { return 0 } -_webkit_patch_flag() { +_blink_tool_flag() { local cur targets webkit_scripts_dir cur="${COMP_WORDS[COMP_CWORD]}" - webkit_scripts_dir=$chrome_source/third_party/WebKit/Tools/Scripts - targets=$($webkit_scripts_dir/webkit-patch help | grep '^ [a-z]' | \ + blink_tools_dir=$chrome_source/third_party/blink/tools + targets=$($blink_tools_dir/blink_tool.py help | grep '^ [a-z]' | \ awk '{ print $1 }') COMPREPLY=($(compgen -W "$targets" -- "$cur")) return 0 @@ -105,4 +105,4 @@ for gtest_test_executable in $( done complete -F _layout_test_flag run-webkit-tests -complete -F _webkit_patch_flag webkit-patch +complete -F _blink_tool_flag blink_tool.py