Title: [121577] trunk/Tools
Revision
121577
Author
o...@chromium.org
Date
2012-06-29 11:28:36 -0700 (Fri, 29 Jun 2012)

Log Message

Fix rebaselining for Qt and Apple ports
https://bugs.webkit.org/show_bug.cgi?id=90204

Reviewed by Dirk Pranke.

-Apporpriately put wk2 results in the -wk2 directories.
-Since Qt and Apple-Win don't have bots that correspond to the
platform/qt and platform/win directories, we need to fudge it
and always put the results in those directories for those ports.

* Scripts/webkitpy/layout_tests/port/builders.py:
(rebaseline_override_dir):
* Scripts/webkitpy/layout_tests/port/factory.py:
(_builder_options):
Identify webkit2 builders by the WK2 in the builder name.
* Scripts/webkitpy/tool/commands/rebaseline.py:
(RebaselineTest._baseline_directory):
* Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
(TestRebaseline.test_baseline_directory):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (121576 => 121577)


--- trunk/Tools/ChangeLog	2012-06-29 18:27:21 UTC (rev 121576)
+++ trunk/Tools/ChangeLog	2012-06-29 18:28:36 UTC (rev 121577)
@@ -1,3 +1,25 @@
+2012-06-28  Ojan Vafai  <o...@chromium.org>
+
+        Fix rebaselining for Qt and Apple ports
+        https://bugs.webkit.org/show_bug.cgi?id=90204
+
+        Reviewed by Dirk Pranke.
+
+        -Apporpriately put wk2 results in the -wk2 directories.
+        -Since Qt and Apple-Win don't have bots that correspond to the
+        platform/qt and platform/win directories, we need to fudge it
+        and always put the results in those directories for those ports.
+
+        * Scripts/webkitpy/layout_tests/port/builders.py:
+        (rebaseline_override_dir):
+        * Scripts/webkitpy/layout_tests/port/factory.py:
+        (_builder_options):
+        Identify webkit2 builders by the WK2 in the builder name.
+        * Scripts/webkitpy/tool/commands/rebaseline.py:
+        (RebaselineTest._baseline_directory):
+        * Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
+        (TestRebaseline.test_baseline_directory):
+
 2012-06-29  Zoltan Horvath  <zol...@webkit.org>
 
         Add support for --force parameter to run-performance-tests

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/builders.py (121576 => 121577)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/builders.py	2012-06-29 18:27:21 UTC (rev 121576)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/builders.py	2012-06-29 18:28:36 UTC (rev 121577)
@@ -52,20 +52,23 @@
     "Webkit Mac10.7": {"port_name": "chromium-mac-lion", "specifiers": set(["lion"])},
 
     # These builders are on build.webkit.org.
-    "Apple Lion Release WK1 (Tests)": {"port_name": "mac-lion", "specifiers": set(["lion"])},
-    "Apple Lion Debug WK1 (Tests)": {"port_name": "mac-lion", "specifiers": set(["lion", "debug"])},
+    # FIXME: Remove rebaseline_override_dir once there is an Apple buildbot that corresponds to platform/mac (i.e. a Mountain Lion bot).
+    "Apple Lion Release WK1 (Tests)": {"port_name": "mac-lion", "specifiers": set(["lion"]), "rebaseline_override_dir": "mac"},
+    "Apple Lion Debug WK1 (Tests)": {"port_name": "mac-lion", "specifiers": set(["lion", "debug"]), "rebaseline_override_dir": "mac"},
     "Apple Lion Release WK2 (Tests)": {"port_name": "mac-lion", "specifiers": set(["lion", "wk2"])},
     "Apple Lion Debug WK2 (Tests)": {"port_name": "mac-lion", "specifiers": set(["lion", "wk2", "debug"])},
 
     "Apple Win XP Debug (Tests)": {"port_name": "win-xp", "specifiers": set(["win", "debug"])},
-    "Apple Win 7 Release (Tests)": {"port_name": "win-7sp0", "specifiers": set(["win"])},
+    # FIXME: Remove rebaseline_override_dir once there is an Apple buildbot that corresponds to platform/win.
+    "Apple Win 7 Release (Tests)": {"port_name": "win-7sp0", "specifiers": set(["win"]), "rebaseline_override_dir": "win"},
 
     "GTK Linux 32-bit Release": {"port_name": "gtk", "specifiers": set(["gtk", "x86", "release"])},
     "GTK Linux 64-bit Debug": {"port_name": "gtk", "specifiers": set(["gtk", "x86_64", "debug"])},
     "GTK Linux 64-bit Release": {"port_name": "gtk", "specifiers": set(["gtk", "x86_64", "release"])},
     "GTK Linux 64-bit Release WK2 (Tests)": {"port_name": "gtk", "specifiers": set(["gtk", "x86_64", "wk2", "release"])},
 
-    "Qt Linux Release": {"port_name": "qt-linux", "specifiers": set(["win", "linux", "mac"])},
+    # FIXME: Remove rebaseline_override_dir once there are Qt bots for all the platform/qt-* directories.
+    "Qt Linux Release": {"port_name": "qt-linux", "specifiers": set(["win", "linux", "mac"]), "rebaseline_override_dir": "qt"},
 
     "EFL Linux 64-bit Debug": {"port_name": "efl", "specifiers": set(["efl", "debug"])},
     "EFL Linux 64-bit Release": {"port_name": "efl", "specifiers": set(["efl", "release"])},
@@ -111,6 +114,10 @@
     return _exact_matches[builder_name].get("specifiers", set())
 
 
+def rebaseline_override_dir(builder_name):
+    return _exact_matches[builder_name].get("rebaseline_override_dir", None)
+
+
 def port_name_for_builder_name(builder_name):
     if builder_name in _exact_matches:
         return _exact_matches[builder_name]["port_name"]

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/factory.py (121576 => 121577)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/factory.py	2012-06-29 18:27:21 UTC (rev 121576)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/factory.py	2012-06-29 18:28:36 UTC (rev 121577)
@@ -60,8 +60,9 @@
 
 def _builder_options(builder_name):
     configuration = "Debug" if re.search(r"[d|D](ebu|b)g", builder_name) else "Release"
+    is_webkit2 = builder_name.find("WK2") != -1
     builder_name = builder_name
-    return optparse.Values({'builder_name': builder_name, 'configuration': configuration})
+    return optparse.Values({'builder_name': builder_name, 'configuration': configuration, 'webkit_test_runner': is_webkit2})
 
 
 class PortFactory(object):

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py (121576 => 121577)


--- trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py	2012-06-29 18:27:21 UTC (rev 121576)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py	2012-06-29 18:28:36 UTC (rev 121577)
@@ -88,7 +88,10 @@
 
     def _baseline_directory(self, builder_name):
         port = self._tool.port_factory.get_from_builder_name(builder_name)
-        return port.baseline_path()
+        override_dir = builders.rebaseline_override_dir(builder_name)
+        if override_dir:
+            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):
         old_baselines = []

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py (121576 => 121577)


--- trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py	2012-06-29 18:27:21 UTC (rev 121576)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py	2012-06-29 18:28:36 UTC (rev 121577)
@@ -42,6 +42,20 @@
         build = Mock()
         OutputCapture().assert_outputs(self, command._tests_to_update, [build])
 
+    def test_baseline_directory(self):
+        command = RebaselineTest()
+        tool = MockTool()
+        command.bind_to_tool(tool)
+        self.assertEqual(command._baseline_directory("Apple Win XP Debug (Tests)"), "/mock-checkout/LayoutTests/platform/win-xp")
+        self.assertEqual(command._baseline_directory("Apple Win 7 Release (Tests)"), "/mock-checkout/LayoutTests/platform/win")
+        self.assertEqual(command._baseline_directory("Apple Lion Release WK1 (Tests)"), "/mock-checkout/LayoutTests/platform/mac")
+        self.assertEqual(command._baseline_directory("Apple Lion Release WK2 (Tests)"), "/mock-checkout/LayoutTests/platform/mac-wk2")
+        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.6"), "/mock-checkout/LayoutTests/platform/chromium-mac-snowleopard")
+
     def test_rebaseline_updates_expectations_file_noop(self):
         command = RebaselineTest()
         tool = MockTool()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to