Title: [90527] trunk/Tools
Revision
90527
Author
[email protected]
Date
2011-07-06 19:49:47 -0700 (Wed, 06 Jul 2011)

Log Message

2011-07-06  Dirk Pranke  <[email protected]>

        nrwt: remove --use-apache from the command line
        https://bugs.webkit.org/show_bug.cgi?id=63358

        Reviewed by Adam Barth.

        Re-land the fix in bug 63358 - the prior fix was flawed in that
        we were trying to start the http server during check_sys_deps()
        but not actually setting up the environment properly. This
        broken prior to this change, but exposed by it, since the patch
        changes the chromium port to call the base class's checks.

        * Scripts/webkitpy/common/system/executive.py:
        * Scripts/webkitpy/layout_tests/port/base.py:
        * Scripts/webkitpy/layout_tests/port/chromium.py:
        * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
        * Scripts/webkitpy/layout_tests/port/chromium_win.py:
        * Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py:
        * Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py:
        * Scripts/webkitpy/layout_tests/port/port_testcase.py:
        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:

Modified Paths

Property Changed

Diff

Modified: trunk/Tools/ChangeLog (90526 => 90527)


--- trunk/Tools/ChangeLog	2011-07-07 02:45:58 UTC (rev 90526)
+++ trunk/Tools/ChangeLog	2011-07-07 02:49:47 UTC (rev 90527)
@@ -1,3 +1,26 @@
+2011-07-06  Dirk Pranke  <[email protected]>
+
+        nrwt: remove --use-apache from the command line
+        https://bugs.webkit.org/show_bug.cgi?id=63358
+
+        Reviewed by Adam Barth.
+
+        Re-land the fix in bug 63358 - the prior fix was flawed in that
+        we were trying to start the http server during check_sys_deps()
+        but not actually setting up the environment properly. This
+        broken prior to this change, but exposed by it, since the patch
+        changes the chromium port to call the base class's checks.
+
+        * Scripts/webkitpy/common/system/executive.py:
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py:
+        * Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py:
+        * Scripts/webkitpy/layout_tests/port/port_testcase.py:
+        * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
 2011-07-06  Adam Barth  <[email protected]>
 
         Move view-related code out of layout_package and into views

Modified: trunk/Tools/Scripts/webkitpy/common/system/executive.py (90526 => 90527)


--- trunk/Tools/Scripts/webkitpy/common/system/executive.py	2011-07-07 02:45:58 UTC (rev 90526)
+++ trunk/Tools/Scripts/webkitpy/common/system/executive.py	2011-07-07 02:49:47 UTC (rev 90527)
@@ -399,6 +399,7 @@
     def run_command(self,
                     args,
                     cwd=None,
+                    env=None,
                     input=None,
                     error_handler=None,
                     return_exit_code=False,
@@ -418,6 +419,7 @@
                              stdout=self.PIPE,
                              stderr=stderr,
                              cwd=cwd,
+                             env=env,
                              close_fds=self._should_close_fds())
         output = process.communicate(string_to_communicate)[0]
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py (90526 => 90527)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2011-07-07 02:45:58 UTC (rev 90526)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2011-07-07 02:49:47 UTC (rev 90527)
@@ -138,7 +138,6 @@
         self._test_configuration = None
         self._multiprocessing_is_available = (multiprocessing is not None)
         self._results_directory = None
-        self.set_option_default('use_apache', self._default_to_apache())
 
     def executive(self):
         return self._executive
@@ -225,13 +224,14 @@
         return True
 
     def check_httpd(self):
-        if self.get_option('use_apache'):
+        if self._uses_apache():
             path = self._path_to_apache()
         else:
             path = self._path_to_lighttpd()
 
         try:
-            return self._executive.run_command([path, "-v"], return_exit_code=True) == 0
+            env = self.setup_environ_for_server()
+            return self._executive.run_command([path, "-v"], env=env, return_exit_code=True) == 0
         except OSError, e:
             _log.error("No httpd found. Cannot run http tests.")
             return False
@@ -661,7 +661,7 @@
         Ports can stub this out if they don't need a web server to be running."""
         assert not self._http_server, 'Already running an http server.'
 
-        if self.get_option('use_apache'):
+        if self._uses_apache():
             server = apache_http_server.LayoutTestApacheHttpd(self, self.results_directory())
         else:
             server = http_server.Lighttpd(self, self.results_directory())
@@ -850,10 +850,7 @@
     def _webkit_build_directory(self, args):
         return self._config.build_directory(args[0])
 
-    def _default_to_apache(self):
-        """Override if the port should use LigHTTPd instead of Apache by default.
-
-        Ports that override start_http_server() ignore this method."""
+    def _uses_apache(self):
         return True
 
     def _path_to_apache(self):

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py (90526 => 90527)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py	2011-07-07 02:45:58 UTC (rev 90526)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py	2011-07-07 02:49:47 UTC (rev 90527)
@@ -118,6 +118,8 @@
         return result
 
     def check_sys_deps(self, needs_http):
+        result = super(ChromiumPort, self).check_sys_deps(needs_http)
+
         cmd = [self._path_to_driver(), '--check-layout-test-sys-deps']
 
         local_error = executive.ScriptError()
@@ -132,7 +134,7 @@
             _log.error('')
             _log.error(output)
             return False
-        return True
+        return result
 
     def check_image_diff(self, override_step=None, logging=True):
         image_diff_path = self._path_to_image_diff()
Property changes on: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
___________________________________________________________________

Added: svn:executable

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py (90526 => 90527)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py	2011-07-07 02:45:58 UTC (rev 90526)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py	2011-07-07 02:49:47 UTC (rev 90527)
@@ -94,11 +94,6 @@
 
     def check_build(self, needs_http):
         result = chromium.ChromiumPort.check_build(self, needs_http)
-        if needs_http:
-            if self.get_option('use_apache'):
-                result = self._check_apache_install() and result
-            else:
-                result = self._check_lighttpd_install() and result
         result = self.check_wdiff() and result
 
         if not result:

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py (90526 => 90527)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py	2011-07-07 02:45:58 UTC (rev 90526)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py	2011-07-07 02:49:47 UTC (rev 90527)
@@ -55,6 +55,7 @@
 
 class ChromiumWinPort(chromium.ChromiumPort):
     """Chromium Win implementation of the Port class."""
+
     # FIXME: Figure out how to unify this with base.TestConfiguration.all_systems()?
     SUPPORTED_VERSIONS = ('xp', 'vista', 'win7')
 
@@ -129,7 +130,7 @@
             return p
         return self._filesystem.join(self.path_from_webkit_base(), 'Source', 'WebKit', 'chromium', *comps)
 
-    def _default_to_apache(self):
+    def _uses_apache(self):
         return False
 
     def _lighttpd_path(self, *comps):

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py (90526 => 90527)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py	2011-07-07 02:45:58 UTC (rev 90526)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py	2011-07-07 02:49:47 UTC (rev 90527)
@@ -58,6 +58,13 @@
     def _mock_path_from_chromium_base(self, *comps):
         return self._port._filesystem.join("/chromium/src", *comps)
 
+    def test_uses_apache(self):
+        port = self.make_port()
+        if not port:
+            return
+
+        self.assertFalse(port._uses_apache())
+
     def test_setup_environ_for_server(self):
         port = self.make_port()
         if not port:

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py (90526 => 90527)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py	2011-07-07 02:45:58 UTC (rev 90526)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py	2011-07-07 02:49:47 UTC (rev 90527)
@@ -40,8 +40,7 @@
 from webkitpy.layout_tests.port import test
 
 from webkitpy.tool import mocktool
-mock_options = mocktool.MockOptions(use_apache=True,
-                                    configuration='Release')
+mock_options = mocktool.MockOptions(configuration='Release')
 
 
 class MockDRTPortTest(port_testcase.PortTestCase):

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py (90526 => 90527)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py	2011-07-07 02:45:58 UTC (rev 90526)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py	2011-07-07 02:49:47 UTC (rev 90527)
@@ -89,6 +89,13 @@
         self.assertTrue('--foo=bar' in cmd_line)
         self.assertTrue('--foo=baz' in cmd_line)
 
+    def test_uses_apache(self):
+        port = self.make_port()
+        if not port:
+            return
+
+        self.assertTrue(port._uses_apache())
+
     def assert_servers_are_down(self, host, ports):
         for port in ports:
             try:

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py (90526 => 90527)


--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2011-07-07 02:45:58 UTC (rev 90526)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2011-07-07 02:49:47 UTC (rev 90527)
@@ -147,9 +147,6 @@
     if options.pixel_tests is None:
         options.pixel_tests = True
 
-    if not options.use_apache:
-        options.use_apache = sys.platform.startswith('linux') or sys.platform == 'darwin'
-
     if not options.time_out_ms:
         if options.configuration == "Debug":
             options.time_out_ms = str(2 * Manager.DEFAULT_TEST_TIMEOUT_MS)
@@ -375,8 +372,6 @@
         # instead of --force:
         optparse.make_option("--force", action="" default=False,
             help="Run all tests, even those marked SKIP in the test list"),
-        optparse.make_option("--use-apache", action=""
-            default=False, help="Whether to use apache instead of lighttpd."),
         optparse.make_option("--time-out-ms",
             help="Set the timeout for each test"),
         # old-run-webkit-tests calls --randomize-order --random:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to