[WinCairo] httpd service install needs to precede server start
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jul 2018 19:20:12 +0000 (19:20 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jul 2018 19:20:12 +0000 (19:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=187283

Patch by Ross Kirsling <rkirsling@gmail.com> on 2018-07-09
Reviewed by Daniel Bates.

* Scripts/webkitpy/port/base.py:
(Port.check_build):
Remove unused parameter `needs_http`.

(Port.check_sys_deps):
(Port.start_http_server):
Move `check_httpd` call.

* Scripts/webkitpy/port/win.py:
(WinPort.check_httpd): Added.
(WinCairoPort.check_httpd): Deleted.
Move `httpd -k install` logic to common Windows location.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager._set_up_run):
* Scripts/webkitpy/performance_tests/perftestsrunner.py:
* Scripts/webkitpy/port/gtk.py:
(GtkPort.check_sys_deps):
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort.check_sys_deps):
* Scripts/webkitpy/port/mock_drt.py:
(MockDRTPort.check_build):
(MockDRTPort.check_sys_deps):
* Scripts/webkitpy/port/port_testcase.py:
(PortTestCase.integration_test_check_sys_deps):
(test_check_build):
* Scripts/webkitpy/port/test.py:
* Scripts/webkitpy/port/wpe.py:
(WPEPort.check_sys_deps):
* Scripts/webkitpy/tool/commands/perfalizer.py:
(PerfalizerTask.run):
Remove `needs_http` arguments.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233651 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Tools/ChangeLog
Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py
Tools/Scripts/webkitpy/port/base.py
Tools/Scripts/webkitpy/port/gtk.py
Tools/Scripts/webkitpy/port/ios_simulator.py
Tools/Scripts/webkitpy/port/mock_drt.py
Tools/Scripts/webkitpy/port/port_testcase.py
Tools/Scripts/webkitpy/port/test.py
Tools/Scripts/webkitpy/port/win.py
Tools/Scripts/webkitpy/port/wpe.py
Tools/Scripts/webkitpy/tool/commands/perfalizer.py

index 640fe06..92710a1 100644 (file)
@@ -1,3 +1,43 @@
+2018-07-09  Ross Kirsling  <rkirsling@gmail.com>
+
+        [WinCairo] httpd service install needs to precede server start
+        https://bugs.webkit.org/show_bug.cgi?id=187283
+
+        Reviewed by Daniel Bates.
+
+        * Scripts/webkitpy/port/base.py:
+        (Port.check_build):
+        Remove unused parameter `needs_http`.
+        
+        (Port.check_sys_deps):
+        (Port.start_http_server):
+        Move `check_httpd` call.
+
+        * Scripts/webkitpy/port/win.py:
+        (WinPort.check_httpd): Added.
+        (WinCairoPort.check_httpd): Deleted.
+        Move `httpd -k install` logic to common Windows location.
+
+        * Scripts/webkitpy/layout_tests/controllers/manager.py:
+        (Manager._set_up_run):
+        * Scripts/webkitpy/performance_tests/perftestsrunner.py:
+        * Scripts/webkitpy/port/gtk.py:
+        (GtkPort.check_sys_deps):
+        * Scripts/webkitpy/port/ios_simulator.py:
+        (IOSSimulatorPort.check_sys_deps):
+        * Scripts/webkitpy/port/mock_drt.py:
+        (MockDRTPort.check_build):
+        (MockDRTPort.check_sys_deps):
+        * Scripts/webkitpy/port/port_testcase.py:
+        (PortTestCase.integration_test_check_sys_deps):
+        (test_check_build):
+        * Scripts/webkitpy/port/test.py:
+        * Scripts/webkitpy/port/wpe.py:
+        (WPEPort.check_sys_deps):
+        * Scripts/webkitpy/tool/commands/perfalizer.py:
+        (PerfalizerTask.run):
+        Remove `needs_http` arguments.
+
 2018-07-09  Philippe Normand  <pnormand@igalia.com>
 
         [Flatpak] Unreviewed, switch to https for the gst-libav tarball.
index cb10dba..14f9559 100644 (file)
@@ -161,7 +161,7 @@ class Manager(object):
 
     def _set_up_run(self, test_names, device_class=None):
         self._printer.write_update("Checking build ...")
-        if not self._port.check_build(self.needs_servers(test_names)):
+        if not self._port.check_build():
             _log.error("Build check failed")
             return False
 
@@ -179,7 +179,7 @@ class Manager(object):
         # Check that the system dependencies (themes, fonts, ...) are correct.
         if not self._options.nocheck_sys_deps:
             self._printer.write_update("Checking system dependencies ...")
-            if not self._port.check_sys_deps(self.needs_servers(test_names)):
+            if not self._port.check_sys_deps():
                 self._port.stop_helper()
                 return False
 
index b79fe3e..c7895db 100644 (file)
@@ -192,12 +192,12 @@ class PerfTestsRunner(object):
 * WARNING: run-perf-tests is running in DEBUG mode *
 ****************************************************""")
 
-        if not self._port.check_build(needs_http=False):
+        if not self._port.check_build():
             _log.error("Build not up to date for %s" % self._port._path_to_driver())
             return self.EXIT_CODE_BAD_BUILD
 
         # Check that the system dependencies (themes, fonts, ...) are correct.
-        if not self._port.check_sys_deps(needs_http=False):
+        if not self._port.check_sys_deps():
             _log.error("Failed to check system dependencies.")
             self._port.stop_helper()
             return self.EXIT_CODE_BAD_PREPARATION
index 1d2b5c6..d607cbe 100644 (file)
@@ -223,7 +223,7 @@ class Port(object):
             return factory.get(target_port).default_baseline_search_path()
         return []
 
-    def check_build(self, needs_http):
+    def check_build(self):
         """This routine is used to ensure that the build is up to date
         and all the needed binaries are present."""
         # If we're using a pre-built copy of WebKit (--root), we assume it also includes a build of DRT.
@@ -272,14 +272,12 @@ class Port(object):
         # Ports can override this method to do additional checks.
         return True
 
-    def check_sys_deps(self, needs_http):
+    def check_sys_deps(self):
         """If the port needs to do some runtime checks to ensure that the
         tests can be run successfully, it should override this routine.
         This step can be skipped with --nocheck-sys-deps.
 
         Returns whether the system is properly configured."""
-        if needs_http:
-            return self.check_httpd()
         return True
 
     def check_image_diff(self, override_step=None, logging=True):
@@ -994,6 +992,9 @@ class Port(object):
 
         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 not self.check_httpd():
+            return
+
         http_port = self.get_option('http_port')
         if self._uses_apache():
             server = apache_http_server.LayoutTestApacheHttpd(self, self.results_directory(), additional_dirs=additional_dirs, port=http_port)
index 4964299..3a43bef 100644 (file)
@@ -228,8 +228,8 @@ class GtkPort(Port):
     def show_results_html_file(self, results_filename):
         self._run_script("run-minibrowser", [path.abspath_to_uri(self.host.platform, results_filename)])
 
-    def check_sys_deps(self, needs_http):
-        return super(GtkPort, self).check_sys_deps(needs_http) and self._driver_class().check_driver(self)
+    def check_sys_deps(self):
+        return super(GtkPort, self).check_sys_deps() and self._driver_class().check_driver(self)
 
     def _get_crash_log(self, name, pid, stdout, stderr, newer_than, target_host=None):
         return GDBCrashLogGenerator(self._executive, name, pid, newer_than,
index 547e096..6dd7416 100644 (file)
@@ -137,11 +137,11 @@ class IOSSimulatorPort(IOSPort):
     def operating_system(self):
         return 'ios-simulator'
 
-    def check_sys_deps(self, needs_http):
+    def check_sys_deps(self):
         target_device_type = DeviceType(software_variant='iOS', software_version=self.ios_version())
         for device in SimulatedDeviceManager.available_devices(self.host):
             if device.platform_device.device_type in target_device_type:
-                return super(IOSSimulatorPort, self).check_sys_deps(needs_http)
+                return super(IOSSimulatorPort, self).check_sys_deps()
         _log.error('No Simulated device matching "{}" defined in Xcode iOS SDK'.format(str(target_device_type)))
         return False
 
index 2f314cd..c3e25b4 100644 (file)
@@ -68,10 +68,10 @@ class MockDRTPort(object):
     def __getattr__(self, name):
         return getattr(self.__delegate, name)
 
-    def check_build(self, needs_http):
+    def check_build(self):
         return True
 
-    def check_sys_deps(self, needs_http):
+    def check_sys_deps(self):
         return True
 
     def create_driver(self, worker_number, no_timeout=False):
index 03c703a..2d68e5b 100644 (file)
@@ -168,7 +168,7 @@ class PortTestCase(unittest.TestCase):
     def integration_test_check_sys_deps(self):
         port = self.make_port()
         # Only checking that no exception is raised.
-        port.check_sys_deps(True)
+        port.check_sys_deps()
 
     def integration_test_helper(self):
         port = self.make_port()
@@ -666,19 +666,19 @@ MOCK output of child process
             return True
 
         port._build_driver = build_driver_called
-        port.check_build(False)
+        port.check_build()
         self.assertTrue(self.build_called)
 
         port = self.make_port(options=MockOptions(root='/tmp', build=True))
         self.build_called = False
         port._build_driver = build_driver_called
-        port.check_build(False)
+        port.check_build()
         self.assertFalse(self.build_called, None)
 
         port = self.make_port(options=MockOptions(build=False))
         self.build_called = False
         port._build_driver = build_driver_called
-        port.check_build(False)
+        port.check_build()
         self.assertFalse(self.build_called, None)
 
     def test_additional_platform_directory(self):
index 334e24b..df5e67d 100644 (file)
@@ -408,10 +408,10 @@ class TestPort(Port):
     def worker_startup_delay_secs(self):
         return 0
 
-    def check_build(self, needs_http):
+    def check_build(self):
         return True
 
-    def check_sys_deps(self, needs_http):
+    def check_sys_deps(self):
         return True
 
     def default_configuration(self):
index f0e8f8b..510b6e7 100644 (file)
@@ -452,6 +452,23 @@ class WinPort(ApplePort):
                 crash_logs[test_name] = crash_log
         return crash_logs
 
+    def check_httpd(self):
+        if not super(WinPort, self).check_httpd():
+            return False
+
+        path = self._path_to_apache()
+        if not path:
+            return False
+
+        # To launch Apache as a daemon, service installation is required.
+        exit_code = self._executive.run_command([path, '-k', 'install', '-T'], return_exit_code=True)
+        # 0=success, 2=already installed, 720005=permission error, etc.
+        if exit_code not in (0, 2):
+            _log.error('Could not install httpd as a service. Perhaps you forgot to run as adminstrator? (exit code={})'.format(exit_code))
+            return False
+
+        return True
+
 
 class WinCairoPort(WinPort):
     port_name = "wincairo"
@@ -470,19 +487,3 @@ class WinCairoPort(WinPort):
         fallback_names = ['wincairo-' + version_name_map.to_name(version, platform=self.port_name).lower().replace(' ', '') for version in fallback_versions]
         fallback_names.append('wincairo')
         return map(self._webkit_baseline_path, fallback_names)
-
-    def check_httpd(self):
-        if not super(WinCairoPort, self).check_httpd():
-            return False
-
-        path = self._path_to_apache()
-        if not path:
-            return False
-
-        # To launch Apache as a daemon, service installation is required.
-        exit_code = self._executive.run_command([path, '-k', 'install', '-T'], return_exit_code=True)
-        # 0=success, 2=already installed, 720005=permission error, etc.
-        if exit_code == 0 or exit_code == 2:
-            return True
-        _log.error('Httpd cannot run as a service. Perhaps you forgot to log in as an adminstrator user? (exit code=%s)' % exit_code)
-        return False
index 4c4e23d..bacba5f 100644 (file)
@@ -84,8 +84,8 @@ class WPEPort(Port):
         self._copy_value_from_environ_if_set(environment, 'GST_DEBUG_FILE')
         return environment
 
-    def check_sys_deps(self, needs_http):
-        return super(WPEPort, self).check_sys_deps(needs_http) and self._driver_class().check_driver(self)
+    def check_sys_deps(self):
+        return super(WPEPort, self).check_sys_deps() and self._driver_class().check_driver(self)
 
     def _generate_all_test_configurations(self):
         configurations = []
index cff98d5..69a906d 100644 (file)
@@ -80,7 +80,7 @@ class PerfalizerTask(PatchAnalysisTask):
         if not self._build_without_patch():
             return False
 
-        if not self._port.check_build(needs_http=False):
+        if not self._port.check_build():
             self._logger('Failed to build DumpRenderTree.')
             return False
 
@@ -92,7 +92,7 @@ class PerfalizerTask(PatchAnalysisTask):
         if not self._apply() or not self._build():
             return False
 
-        if not self._port.check_build(needs_http=False):
+        if not self._port.check_build():
             self._logger('Failed to build DumpRenderTree.')
             return False