diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-22 15:40:17 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-22 15:40:17 +0200 |
commit | 43a42f108af6bcbd91f2672731c3047c26213af1 (patch) | |
tree | 7fa092e5f5d873c72f2486a70e26be26f7a38bec /Tools/Scripts | |
parent | d9cf437c840c6eb7417bdd97e6c40979255d3158 (diff) | |
download | qtwebkit-43a42f108af6bcbd91f2672731c3047c26213af1.tar.gz |
Imported WebKit commit 302e7806bff028bd1167a1ec7c86a1ee00ecfb49 (http://svn.webkit.org/repository/webkit/trunk@132067)
New snapshot that fixes build without QtWidgets
Diffstat (limited to 'Tools/Scripts')
-rwxr-xr-x | Tools/Scripts/export-w3c-performance-wg-tests | 80 | ||||
-rwxr-xr-x | Tools/Scripts/prepare-ChangeLog | 6 | ||||
-rwxr-xr-x | Tools/Scripts/run-gtk-tests | 1 | ||||
-rwxr-xr-x | Tools/Scripts/run-javascriptcore-tests | 1 | ||||
-rw-r--r-- | Tools/Scripts/webkitperl/FeatureList.pm | 10 | ||||
-rw-r--r-- | Tools/Scripts/webkitpy/common/config/committers.py | 2 | ||||
-rwxr-xr-x | Tools/Scripts/webkitpy/common/config/watchlist | 10 | ||||
-rw-r--r-- | Tools/Scripts/webkitpy/layout_tests/port/builders.py | 27 | ||||
-rwxr-xr-x | Tools/Scripts/webkitpy/layout_tests/port/chromium.py | 3 | ||||
-rw-r--r-- | Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py | 4 | ||||
-rw-r--r-- | Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py | 13 | ||||
-rw-r--r-- | Tools/Scripts/webkitpy/tool/commands/rebaseline.py | 18 | ||||
-rw-r--r-- | Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py | 67 | ||||
-rw-r--r-- | Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py | 9 |
14 files changed, 208 insertions, 43 deletions
diff --git a/Tools/Scripts/export-w3c-performance-wg-tests b/Tools/Scripts/export-w3c-performance-wg-tests new file mode 100755 index 000000000..aaa865915 --- /dev/null +++ b/Tools/Scripts/export-w3c-performance-wg-tests @@ -0,0 +1,80 @@ +#!/usr/bin/env python +# Copyright (C) 2012 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. + +# This script exports newly added tests to the W3C Web Performance WG's test +# suite. +# +# You must have checked out the 'webperf' repository from https://dvcs.w3.org/hg/ +# +# This script will export the LayoutTests/http/tests/w3c/submission directory +# to a local 'webperf' repository. +# +# The main step in exporting the tests is updating all of the URLs to account +# for the differences in directory layout. + +import os +import shutil +import sys + +if len(sys.argv) != 3: + print 'USAGE: %s path_to_webkit_checkout_root path_to_webperf_checkout_root' + sys.exit(1) + +source_directory = os.path.join(sys.argv[1], 'LayoutTests', 'http', 'tests', 'w3c', 'webperf') +destination_directory = os.path.join(sys.argv[2], 'tests') + +directories_to_copy = ['resources', 'submission'] +replacements = [ + ('localhost:8000', 'www.w3c-test.org'), # This is the alternate host for cross-server requests. + ('127.0.0.1:8000', 'w3c-test.org'), # This is the primary test server. + ('w3c/webperf', 'webperf/tests'), # We prepend /w3c to all of our paths. + ('/w3c/resources/testharness', '/resources/testharness'), + ('\n', '\r\n'), # Convert from *NIX format. +] + +for directory_to_copy in directories_to_copy: + destination_subdirectory = os.path.join(destination_directory, directory_to_copy) + if not os.path.exists(destination_subdirectory): + os.makedirs(destination_subdirectory) + for root, dirs, files in os.walk(os.path.join(source_directory, directory_to_copy)): + print root, dirs, files + root = os.path.relpath(root, source_directory) + for dirname in dirs: + destination_subdirectory = os.path.join(destination_directory, root, dirname) + if not os.path.exists(destination_subdirectory): + os.makedirs(destination_subdirectory) + for filename in files: + if filename.endswith('-expected.txt'): + continue + with open(os.path.join(source_directory, root, filename), 'r') as in_file: + with open(os.path.join(destination_directory, root, filename), 'w') as out_file: + for line in in_file: + for to_find, replace_with in replacements: + line = line.replace(to_find, replace_with) + out_file.write(line) diff --git a/Tools/Scripts/prepare-ChangeLog b/Tools/Scripts/prepare-ChangeLog index cb91c598c..a3816e2dc 100755 --- a/Tools/Scripts/prepare-ChangeLog +++ b/Tools/Scripts/prepare-ChangeLog @@ -1218,7 +1218,7 @@ sub get_function_line_ranges_for_javascript($$) } # Find function names. - while (m-(\w+|[(){}=:;])-g) { + while (m-(\w+|[(){}=:;,])-g) { # Open parenthesis. if ($1 eq '(') { $parenthesesDepth++; @@ -1259,8 +1259,8 @@ sub get_function_line_ranges_for_javascript($$) next; } - # Semicolon. - if ($1 eq ';') { + # Semicolon or comma. + if ($1 eq ';' or $1 eq ',') { @currentIdentifiers = (); next; } diff --git a/Tools/Scripts/run-gtk-tests b/Tools/Scripts/run-gtk-tests index 9bc10a481..1276596f1 100755 --- a/Tools/Scripts/run-gtk-tests +++ b/Tools/Scripts/run-gtk-tests @@ -68,7 +68,6 @@ class TestRunner: SkippedTest("WebKit2APITests/TestWebKitWebView", "/webkit2/WebKitWebView/mouse-target", "Test is flaky in GTK Linux 32-bit Release bot", 82866), SkippedTest("WebKit2APITests/TestResources", "/webkit2/WebKitWebView/resources", "Test is flaky in GTK Linux 32-bit Release bot", 82868), SkippedTest("WebKit2APITests/TestWebKitFindController", "/webkit2/WebKitFindController/hide", "Test always fails in Xvfb", 89810), - SkippedTest("WebKit2APITests/TestCookieManager", "/webkit2/WebKitCookieManager/accept-policy", "Test fails", 98738), SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.WKConnection", "Tests fail and time out out", 84959), SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.RestoreSessionStateContainingFormData", "Session State is not implemented in GTK+ port", 84960), SkippedTest("TestWebKitAPI/TestWebKit2", "WebKit2.SpacebarScrolling", "Test fails", 84961), diff --git a/Tools/Scripts/run-javascriptcore-tests b/Tools/Scripts/run-javascriptcore-tests index ca58ab3ec..9cb4c483b 100755 --- a/Tools/Scripts/run-javascriptcore-tests +++ b/Tools/Scripts/run-javascriptcore-tests @@ -50,6 +50,7 @@ my @testsToSkip = ( "ecma/Date/15.9.2.2-5.js", "ecma/Date/15.9.2.2-6.js", # ecma_3/Date/15.9.5.7.js fails on Mac (but not Windows) https://bugs.webkit.org/show_bug.cgi?id=25161 + "ecma_3/Date/15.9.5.6.js", "ecma_3/Date/15.9.5.7.js", # These three fail on Linux in certain time zones, at certain times # of the year (!): https://bugs.webkit.org/show_bug.cgi?id=71371 diff --git a/Tools/Scripts/webkitperl/FeatureList.pm b/Tools/Scripts/webkitperl/FeatureList.pm index cb53b2517..5a77bf117 100644 --- a/Tools/Scripts/webkitperl/FeatureList.pm +++ b/Tools/Scripts/webkitperl/FeatureList.pm @@ -49,7 +49,8 @@ my ( $blobSupport, $channelMessagingSupport, $cspNextSupport, - $css3TextDecorationSupport, + $css3ConditionalRulesSupport, + $css3TextSupport, $cssBoxDecorationBreakSupport, $cssExclusionsSupport, $cssFiltersSupport, @@ -168,8 +169,11 @@ my @features = ( { option => "css-filters", desc => "Toggle CSS Filters support", define => "ENABLE_CSS_FILTERS", default => isAppleWebKit() || isBlackBerry(), value => \$cssFiltersSupport }, - { option => "css3-text-decoration", desc => "Toggle CSS3 Text Decoration support", - define => "ENABLE_CSS3_TEXT_DECORATION", default => isEfl(), value => \$css3TextDecorationSupport }, + { option => "css3-conditional-rules", desc => "Toggle CSS3 Conditional Rules support (i.e. \@supports)", + define => "ENABLE_CSS3_CONDITIONAL_RULES", default => 0, value => \$css3ConditionalRulesSupport }, + + { option => "css3-text", desc => "Toggle CSS3 Text support", + define => "ENABLE_CSS3_TEXT", default => isEfl(), value => \$css3TextSupport }, { option => "css-hierarchies", desc => "Toggle CSS Hierarchy support", define => "ENABLE_CSS_HIERARCHIES", default => 0, value => \$cssHierarchiesSupport }, diff --git a/Tools/Scripts/webkitpy/common/config/committers.py b/Tools/Scripts/webkitpy/common/config/committers.py index 73e18b36b..06f0d04b3 100644 --- a/Tools/Scripts/webkitpy/common/config/committers.py +++ b/Tools/Scripts/webkitpy/common/config/committers.py @@ -390,7 +390,7 @@ committers_unable_to_review = [ Committer("Trey Matteson", "trey@usa.net", "trey"), Committer("Tristan O'Tierney", ["tristan@otierney.net", "tristan@apple.com"]), Committer("Vangelis Kokkevis", "vangelis@chromium.org", "vangelis"), - Committer("Viatcheslav Ostapenko", "ostapenko.viatcheslav@nokia.com", "ostap"), + Committer("Viatcheslav Ostapenko", ["ostap73@gmail.com", "v.ostapenko@samsung.com", "v.ostapenko@sisa.samsung.com"], "ostap"), Committer("Victor Carbune", "victor@rosedu.org", "vcarbune"), Committer("Victor Wang", "victorw@chromium.org", "victorw"), Committer("Victoria Kirst", ["vrk@chromium.org", "vrk@google.com"], "vrk"), diff --git a/Tools/Scripts/webkitpy/common/config/watchlist b/Tools/Scripts/webkitpy/common/config/watchlist index 813cee5b4..941f9b2b9 100755 --- a/Tools/Scripts/webkitpy/common/config/watchlist +++ b/Tools/Scripts/webkitpy/common/config/watchlist @@ -269,6 +269,12 @@ "filename": r"Source/WebCore/accessibility" r"|LayoutTests/.*accessibility", }, + "Cairo": { + "filename": r"Source/WebCore/platform/graphics/cairo", + }, + "Harfbuzz": { + "filename": r"Source/WebCore/platform/graphics/harfbuzz", + } }, "CC_RULES": { # Note: All email addresses listed must be registered with bugzilla. @@ -278,6 +284,7 @@ "AppleMacPublicApi": [ "timothy@apple.com" ], "Battery": [ "gyuyoung.kim@samsung.com" ], "BlackBerry": [ "mifenton@rim.com", "rwlbuis@gmail.com", "tonikitoo@webkit.org" ], + "Cairo": [ "dominik.rottsches@intel.com" ], "CMake": [ "rakuco@webkit.org", "gyuyoung.kim@samsung.com" ], "CSS": [ "alexis@webkit.org", "macpherson@chromium.org", "cmarcelo@webkit.org", "allan.jensen@digia.com" ], "ChromiumGraphics": [ "jamesr@chromium.org", "cc-bugs@chromium.org" ], @@ -292,6 +299,7 @@ "FrameLoader": [ "abarth@webkit.org", "japhet@chromium.org" ], "GStreamerGraphics": [ "alexis@webkit.org", "pnormand@igalia.com", "gns@gnome.org", "mrobinson@webkit.org" ], "GtkWebKit2PublicAPI": [ "cgarcia@igalia.com", "gns@gnome.org", "mrobinson@webkit.org" ], + "Harfbuzz": [ "dominik.rottsches@intel.com" ], "Loader": [ "japhet@chromium.org" ], "MathML": [ "dbarton@mathscribe.com" ], "Media": [ "feature-media-reviews@chromium.org", "eric.carlson@apple.com" ], @@ -303,7 +311,7 @@ "QtWebKit2PlatformSpecific": [ "alexis@webkit.org", "cmarcelo@webkit.org", "abecsi@webkit.org" ], "QtWebKit2PublicAPI": [ "alexis@webkit.org", "cmarcelo@webkit.org", "abecsi@webkit.org" ], "Rendering": [ "eric@webkit.org" ], - "SVG": ["schenney@chromium.org", "pdr@google.com", "fmalita@chromium.org" ], + "SVG": ["schenney@chromium.org", "pdr@google.com", "fmalita@chromium.org", "dominik.rottsches@intel.com" ], "SVNScripts": [ "dbates@webkit.org" ], "ScrollingCoordinator": [ "andersca@apple.com", "jamesr@chromium.org", "tonikitoo@webkit.org" ], "SecurityCritical": [ "abarth@webkit.org" ], diff --git a/Tools/Scripts/webkitpy/layout_tests/port/builders.py b/Tools/Scripts/webkitpy/layout_tests/port/builders.py index 605b8cccc..74af7b4b7 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/builders.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/builders.py @@ -35,18 +35,29 @@ from webkitpy.common.memoized import memoized # In this dictionary, each item stores: # * port_name -- a fully qualified port name # * specifiers -- a set of specifiers, representing configurations covered by this builder. +# * move_overwritten_baselines_to -- (optional) list of platform directories that we will copy an existing +# baseline to before pulling down a new baseline during rebaselining. This is useful +# for bringing up a new port, for example when adding a Lion was the most recent Mac version and +# we wanted to bring up Mountain Lion, we would want to copy an existing baseline in platform/mac +# to platform/mac-mountainlion before updating the platform/mac entry. +# * rebaseline_override_dir -- (optional) directory to put baselines in instead of where you would normally put them. +# This is useful when we don't have bots that cover particular configurations; so, e.g., you might +# support mac-mountainlion but not have a mac-mountainlion bot yet, so you'd want to put the mac-lion +# results into platform/mac temporarily. + _exact_matches = { # These builders are on build.chromium.org. "WebKit XP": {"port_name": "chromium-win-xp", "specifiers": set(["xp", "release"])}, - "WebKit Win7": {"port_name": "chromium-win-win7", "specifiers": set(["win7"])}, - "WebKit Win7 (dbg)(1)": {"port_name": "chromium-win-xp", "specifiers": set(["win", "debug"])}, - "WebKit Win7 (dbg)(2)": {"port_name": "chromium-win-xp", "specifiers": set(["win", "debug"])}, + "WebKit Win7": {"port_name": "chromium-win-win7", "specifiers": set(["win7", "release"])}, + "WebKit Win7 (dbg)(1)": {"port_name": "chromium-win-win7", "specifiers": set(["win7", "debug"])}, + "WebKit Win7 (dbg)(2)": {"port_name": "chromium-win-win7", "specifiers": set(["win7", "debug"])}, "WebKit Linux": {"port_name": "chromium-linux-x86_64", "specifiers": set(["linux", "x86_64", "release"])}, "WebKit Linux 32": {"port_name": "chromium-linux-x86", "specifiers": set(["linux", "x86"])}, "WebKit Linux (dbg)": {"port_name": "chromium-linux-x86_64", "specifiers": set(["linux", "debug"])}, "WebKit Mac10.6": {"port_name": "chromium-mac-snowleopard", "specifiers": set(["snowleopard"])}, "WebKit Mac10.6 (dbg)": {"port_name": "chromium-mac-snowleopard", "specifiers": set(["snowleopard", "debug"])}, - "WebKit Mac10.7": {"port_name": "chromium-mac-lion", "specifiers": set(["lion"])}, + "WebKit Mac10.7": {"port_name": "chromium-mac-lion", "specifiers": set(["lion", "release"])}, + "WebKit Mac10.8": {"port_name": "chromium-mac-mountainlion", "specifiers": set(["mountainlion", "release"])}, # These builders are on build.webkit.org. "Apple MountainLion Release WK1 (Tests)": {"port_name": "mac-mountainlion", "specifiers": set(["mountainlion"]), "rebaseline_override_dir": "mac"}, @@ -117,6 +128,10 @@ def rebaseline_override_dir(builder_name): return _exact_matches[builder_name].get("rebaseline_override_dir", None) +def move_overwritten_baselines_to(builder_name): + return _exact_matches[builder_name].get("move_overwritten_baselines_to", []) + + def port_name_for_builder_name(builder_name): if builder_name in _exact_matches: return _exact_matches[builder_name]["port_name"] @@ -135,7 +150,3 @@ def builder_name_for_port_name(target_port_name): def builder_path_for_port_name(port_name): builder_path_from_name(builder_name_for_port_name(port_name)) - - -def fallback_port_names_for_new_port(builder_name): - return _exact_matches[builder_name].get("move_overwritten_baselines_to", []) diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py index c310eb15b..a69f5a822 100755 --- a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py @@ -390,6 +390,9 @@ class ChromiumPort(Port): VirtualTestSuite('platform/chromium/virtual/softwarecompositing', 'compositing', ['--enable-software-compositing']), + VirtualTestSuite('platform/chromium/virtual/deferred/fast/images', + 'fast/images', + ['--enable-deferred-image-decoding', '--enable-per-tile-painting', '--force-compositing-mode']), ] # diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py index 47eb4ea0c..21b7e317f 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py @@ -45,14 +45,16 @@ class ChromiumMacPort(chromium.ChromiumPort): FALLBACK_PATHS = { 'snowleopard': [ 'chromium-mac-snowleopard', + 'chromium-mac-lion', 'chromium-mac', 'chromium', ], 'lion': [ + 'chromium-mac-lion', 'chromium-mac', 'chromium', ], - 'mountainlion': [ # FIXME: we don't treat ML different from Lion yet. + 'mountainlion': [ 'chromium-mac', 'chromium', ], diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py index 14e5a2b84..b02af5ca1 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py @@ -44,7 +44,7 @@ class ChromiumMacPortTest(chromium_port_testcase.ChromiumPortTestCase): self.assertEquals(expected, port.name()) def test_versions(self): - self.assertTrue(self.make_port().name() in ('chromium-mac-snowleopard', 'chromium-mac-lion', 'chromium-mac-future')) + self.assertTrue(self.make_port().name() in ('chromium-mac-snowleopard', 'chromium-mac-lion', 'chromium-mac-mountainlion', 'chromium-mac-future')) self.assert_name(None, 'snowleopard', 'chromium-mac-snowleopard') self.assert_name('chromium-mac', 'snowleopard', 'chromium-mac-snowleopard') @@ -52,12 +52,13 @@ class ChromiumMacPortTest(chromium_port_testcase.ChromiumPortTestCase): self.assert_name('chromium-mac-snowleopard', 'snowleopard', 'chromium-mac-snowleopard') self.assert_name(None, 'lion', 'chromium-mac-lion') + self.assert_name(None, 'mountainlion', 'chromium-mac-mountainlion') self.assert_name(None, 'future', 'chromium-mac-future') + self.assert_name('chromium-mac', 'lion', 'chromium-mac-lion') - self.assert_name('chromium-mac-future', 'tiger', 'chromium-mac-future') - self.assert_name('chromium-mac-future', 'leopard', 'chromium-mac-future') self.assert_name('chromium-mac-future', 'snowleopard', 'chromium-mac-future') self.assert_name('chromium-mac-future', 'lion', 'chromium-mac-future') + self.assert_name('chromium-mac-future', 'mountainlion', 'chromium-mac-future') self.assertRaises(AssertionError, self.assert_name, None, 'tiger', 'should-raise-assertion-so-this-value-does-not-matter') @@ -66,6 +67,12 @@ class ChromiumMacPortTest(chromium_port_testcase.ChromiumPortTestCase): self.assertEquals(port.baseline_path(), port._webkit_baseline_path('chromium-mac-snowleopard')) port = self.make_port(port_name='chromium-mac-lion') + self.assertEquals(port.baseline_path(), port._webkit_baseline_path('chromium-mac-lion')) + + port = self.make_port(port_name='chromium-mac-mountainlion') + self.assertEquals(port.baseline_path(), port._webkit_baseline_path('chromium-mac')) + + port = self.make_port(port_name='chromium-mac-future') self.assertEquals(port.baseline_path(), port._webkit_baseline_path('chromium-mac')) def test_operating_system(self): diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py index cb8fa001f..859963261 100644 --- a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py +++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py @@ -74,7 +74,8 @@ class RebaselineTest(AbstractRebaseliningCommand): def __init__(self): options = [ optparse.make_option("--builder", help="Builder to pull new baselines from"), - optparse.make_option("--platform-to-move-to", help="Platform to move existing baselines to before rebaselining. This is for dealing with bringing up new ports that interact with non-tree portions of the fallback graph."), + optparse.make_option("--move-overwritten-baselines-to", action="append", default=[], + help="Platform to move existing baselines to before rebaselining. This is for bringing up new ports."), optparse.make_option("--test", help="Test to rebaseline"), ] AbstractRebaseliningCommand.__init__(self, options=options) @@ -90,13 +91,13 @@ class RebaselineTest(AbstractRebaseliningCommand): return self._tool.filesystem.join(port.layout_tests_dir(), 'platform', override_dir) return port.baseline_version_dir() - def _copy_existing_baseline(self, platforms_to_move_existing_baselines_to, test_name, suffix): + def _copy_existing_baseline(self, move_overwritten_baselines_to, test_name, suffix): old_baselines = [] new_baselines = [] # Need to gather all the baseline paths before modifying the filesystem since # the modifications can affect the results of port.expected_filename. - for platform in platforms_to_move_existing_baselines_to: + for platform in move_overwritten_baselines_to: port = self._tool.port_factory.get(platform) old_baseline = port.expected_filename(test_name, "." + suffix) if not self._tool.filesystem.exists(old_baseline): @@ -152,15 +153,15 @@ class RebaselineTest(AbstractRebaseliningCommand): def _file_name_for_expected_result(self, test_name, suffix): return "%s-expected.%s" % (self._test_root(test_name), suffix) - def _rebaseline_test(self, builder_name, test_name, platforms_to_move_existing_baselines_to, suffix): + def _rebaseline_test(self, builder_name, test_name, move_overwritten_baselines_to, suffix): results_url = self._results_url(builder_name) baseline_directory = self._baseline_directory(builder_name) source_baseline = "%s/%s" % (results_url, self._file_name_for_actual_result(test_name, suffix)) target_baseline = self._tool.filesystem.join(baseline_directory, self._file_name_for_expected_result(test_name, suffix)) - if platforms_to_move_existing_baselines_to: - self._copy_existing_baseline(platforms_to_move_existing_baselines_to, test_name, suffix) + if move_overwritten_baselines_to: + self._copy_existing_baseline(move_overwritten_baselines_to, test_name, suffix) _log.info("Retrieving %s." % source_baseline) self._save_baseline(self._tool.web.get_binary(source_baseline, convert_404_to_None=True), target_baseline) @@ -172,7 +173,7 @@ class RebaselineTest(AbstractRebaseliningCommand): def execute(self, options, args, tool): self._baseline_suffix_list = options.suffixes.split(',') - self._rebaseline_test_and_update_expectations(options.builder, options.test, options.platform_to_move_to) + self._rebaseline_test_and_update_expectations(options.builder, options.test, options.move_overwritten_baselines_to) print json.dumps(self._scm_changes) @@ -269,6 +270,9 @@ class AbstractParallelRebaselineCommand(AbstractDeclarativeCommand): for builder in self._builders_to_fetch_from(test_list[test]): suffixes = ','.join(test_list[test][builder]) cmd_line = [path_to_webkit_patch, 'rebaseline-test-internal', '--suffixes', suffixes, '--builder', builder, '--test', test] + move_overwritten_baselines_to = builders.move_overwritten_baselines_to(builder) + for platform in move_overwritten_baselines_to: + cmd_line.extend(['--move-overwritten-baselines-to', platform]) commands.append(tuple([cmd_line, cwd])) return commands diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py index 4b63f2f67..35394245f 100644 --- a/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py +++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py @@ -54,7 +54,7 @@ class TestRebaseline(unittest.TestCase): self.assertEqual(command._baseline_directory("GTK Linux 32-bit Release"), "/mock-checkout/LayoutTests/platform/gtk") self.assertEqual(command._baseline_directory("EFL Linux 64-bit Debug"), "/mock-checkout/LayoutTests/platform/efl") self.assertEqual(command._baseline_directory("Qt Linux Release"), "/mock-checkout/LayoutTests/platform/qt") - self.assertEqual(command._baseline_directory("WebKit Mac10.7"), "/mock-checkout/LayoutTests/platform/chromium-mac") + self.assertEqual(command._baseline_directory("WebKit Mac10.7"), "/mock-checkout/LayoutTests/platform/chromium-mac-lion") self.assertEqual(command._baseline_directory("WebKit Mac10.6"), "/mock-checkout/LayoutTests/platform/chromium-mac-snowleopard") def test_rebaseline_updates_expectations_file_noop(self): @@ -167,9 +167,7 @@ Retrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-resu lion_port = tool.port_factory.get_from_builder_name("WebKit Mac10.7") tool.filesystem.write_text_file(os.path.join(lion_port.baseline_path(), "userscripts/another-test-expected.txt"), "Dummy expected result") - expected_logs = """Copying baseline from /mock-checkout/LayoutTests/platform/chromium-mac/userscripts/another-test-expected.txt to /mock-checkout/LayoutTests/platform/chromium-mac-snowleopard/userscripts/another-test-expected.txt. -Retrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results/userscripts/another-test-actual.txt. -""" + expected_logs = "Copying baseline from /mock-checkout/LayoutTests/platform/chromium-mac-lion/userscripts/another-test-expected.txt to /mock-checkout/LayoutTests/platform/chromium-mac-snowleopard/userscripts/another-test-expected.txt.\nRetrieving http://example.com/f/builders/WebKit Mac10.7/results/layout-test-results/userscripts/another-test-actual.txt.\n" OutputCapture().assert_outputs(self, command._rebaseline_test, ["WebKit Mac10.7", "userscripts/another-test.html", ["chromium-mac-snowleopard"], "txt"], expected_logs=expected_logs) def test_rebaseline_and_copy_no_overwrite_test(self): @@ -239,9 +237,9 @@ MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt', 'user-scri tool.executive.run_in_parallel = run_in_parallel - expected_logs = "Retrieving results for chromium-linux-x86 from WebKit Linux 32.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-linux-x86_64 from WebKit Linux.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-mac-lion from WebKit Mac10.7.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-mac-snowleopard from WebKit Mac10.6.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-win-win7 from WebKit Win7.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-win-xp from WebKit XP.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for efl from EFL Linux 64-bit Release.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for gtk from GTK Linux 64-bit Release.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for mac-lion from Apple Lion Release WK1 (Tests).\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for mac-mountainlion from Apple MountainLion Release WK1 (Tests).\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for qt-linux from Qt Linux Release.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for win-7sp0 from Apple Win 7 Release (Tests).\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\n" + expected_logs = "Retrieving results for chromium-linux-x86 from WebKit Linux 32.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-linux-x86_64 from WebKit Linux.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-mac-lion from WebKit Mac10.7.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-mac-mountainlion from WebKit Mac10.8.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-mac-snowleopard from WebKit Mac10.6.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-win-win7 from WebKit Win7.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for chromium-win-xp from WebKit XP.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for efl from EFL Linux 64-bit Release.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for gtk from GTK Linux 64-bit Release.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for mac-lion from Apple Lion Release WK1 (Tests).\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for mac-mountainlion from Apple MountainLion Release WK1 (Tests).\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for qt-linux from Qt Linux Release.\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\nRetrieving results for win-7sp0 from Apple Win 7 Release (Tests).\n userscripts/another-test.html (txt)\n userscripts/images.svg (png)\n" - expected_stdout = "[(['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Linux 32', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Linux', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Mac10.6', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Mac10.7', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Win7', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple Win 7 Release (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'EFL Linux 64-bit Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'GTK Linux 64-bit Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Qt Linux Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple Lion Release WK1 (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit XP', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple MountainLion Release WK1 (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Linux 32', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Linux', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Mac10.6', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Mac10.7', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Win7', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple Win 7 Release (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'EFL Linux 64-bit Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'GTK Linux 64-bit Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Qt Linux Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple Lion Release WK1 (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit XP', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple MountainLion Release WK1 (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout')]\n" + expected_stdout = "[(['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Linux 32', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Linux', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Mac10.6', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Mac10.7', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Win7', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple Win 7 Release (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'EFL Linux 64-bit Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit Mac10.8', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'GTK Linux 64-bit Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Qt Linux Release', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple Lion Release WK1 (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'WebKit XP', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'txt', '--builder', 'Apple MountainLion Release WK1 (Tests)', '--test', 'userscripts/another-test.html'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Linux 32', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Linux', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Mac10.6', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Mac10.7', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Win7', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple Win 7 Release (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'EFL Linux 64-bit Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit Mac10.8', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'GTK Linux 64-bit Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Qt Linux Release', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple Lion Release WK1 (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'WebKit XP', '--test', 'userscripts/images.svg'], '/mock-checkout'), (['echo', 'rebaseline-test-internal', '--suffixes', 'png', '--builder', 'Apple MountainLion Release WK1 (Tests)', '--test', 'userscripts/images.svg'], '/mock-checkout')]\n" expected_stderr = """MOCK run_command: ['qmake', '-v'], cwd=None MOCK run_command: ['qmake', '-v'], cwd=None @@ -458,3 +456,60 @@ MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'wav,txt,png', 'm finally: builders._exact_matches = old_exact_matches + + def test_rebaseline_json_with_move_overwritten_baselines_to(self): + old_exact_matches = builders._exact_matches + try: + builders._exact_matches = { + "MOCK builder": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier"])}, + "MOCK builder2": {"port_name": "test-mac-snowleopard", "specifiers": set(["mock-specifier2"]), + "move_overwritten_baselines_to": ["test-mac-leopard"]}, + } + + command = Rebaseline() + tool = MockTool() + tool.executive = MockExecutive(should_log=True) + command.bind_to_tool(tool) + + expected_stdout = """rebaseline-json: {'mock/path/to/test.html': {'MOCK builder2': ['txt', 'png']}}\n""" + expected_stderr = """MOCK run_command: ['echo', 'rebaseline-test-internal', '--suffixes', 'txt,png', '--builder', 'MOCK builder2', '--test', 'mock/path/to/test.html', '--move-overwritten-baselines-to', 'test-mac-leopard'], cwd=/mock-checkout +MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt,png', 'mock/path/to/test.html'], cwd=/mock-checkout +""" + + options = MockOptions(optimize=True, builders=["MOCK builder2"], suffixes=["txt,png"], verbose=True) + OutputCapture().assert_outputs(self, command.execute, [options, ["mock/path/to/test.html"], tool], + expected_stdout=expected_stdout, expected_stderr=expected_stderr) + finally: + builders._exact_matches = old_exact_matches + + def test_rebaseline_test_internal_with_move_overwritten_baselines_to(self): + old_exact_matches = builders._exact_matches + try: + builders._exact_matches = { + "MOCK Leopard": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier"])}, + "MOCK SnowLeopard": {"port_name": "test-mac-snowleopard", "specifiers": set(["mock-specifier"])}, + } + + command = RebaselineTest() + tool = MockTool() + tool.executive = MockExecutive(should_log=True) + command.bind_to_tool(tool) + + port = tool.port_factory.get('test-mac-snowleopard') + tool.filesystem.write_text_file(tool.filesystem.join(port.baseline_version_dir(), 'failures', 'expected', 'image-expected.txt'), '') + + options = MockOptions(optimize=True, builder="MOCK SnowLeopard", suffixes="txt", + move_overwritten_baselines_to=["test-mac-leopard"], verbose=True, test="failures/expected/image.html") + + oc = OutputCapture() + oc.capture_output() + try: + logs = '' + command.execute(options, [], tool) + finally: + _, _, logs = oc.restore_output() + + self.assertTrue("Copying baseline from /test.checkout/LayoutTests/platform/test-mac-snowleopard/failures/expected/image-expected.txt to /test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.txt.\n" in logs) + + finally: + builders._exact_matches = old_exact_matches diff --git a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py index 6c64bdd7e..a2f3fabc8 100644 --- a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py +++ b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py @@ -91,9 +91,6 @@ class BuildCoverageExtrapolatorTest(unittest.TestCase): converter = TestConfigurationConverter(port.all_test_configurations(), port.configuration_specifier_macros()) extrapolator = BuildCoverageExtrapolator(converter) self.assertEquals(extrapolator.extrapolate_test_configurations("WebKit XP"), set([TestConfiguration(version='xp', architecture='x86', build_type='release')])) - self.assertEquals(extrapolator.extrapolate_test_configurations("WebKit Win7"), set([ - TestConfiguration(version='win7', architecture='x86', build_type='debug'), - TestConfiguration(version='win7', architecture='x86', build_type='release')])) self.assertRaises(KeyError, extrapolator.extrapolate_test_configurations, "Potato") @@ -124,9 +121,3 @@ class GardeningServerTest(unittest.TestCase): self._post_to_path("/rebaselineall", body='{"user-scripts/another-test.html":{"MOCK builder": ["txt","png"]}}', expected_stderr=expected_stderr % ('MOCK builder', '"txt","png"'), expected_stdout=expected_stdout, server=server) self._post_to_path("/rebaselineall", body='{"user-scripts/another-test.html":{"MOCK builder (Debug)": ["txt","png"]}}', expected_stderr=expected_stderr % ('MOCK builder (Debug)', '"txt","png"'), expected_stdout=expected_stdout) - - def test_rebaseline_new_port(self): - builders._exact_matches = {"MOCK builder": {"port_name": "test-mac-leopard", "specifiers": set(["mock-specifier"]), "move_overwritten_baselines_to": ["mock-port-fallback", "mock-port-fallback2"]}} - expected_stderr = 'MOCK run_command: [\'echo\', \'rebaseline-json\'], cwd=/mock-checkout, input={"user-scripts/another-test.html":{"MOCK builder": ["txt","png"]}}\n' - expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n" - self._post_to_path("/rebaselineall", body='{"user-scripts/another-test.html":{"MOCK builder": ["txt","png"]}}', expected_stderr=expected_stderr, expected_stdout=expected_stdout) |