Title: [202780] trunk/Tools
Revision
202780
Author
[email protected]
Date
2016-07-02 10:45:57 -0700 (Sat, 02 Jul 2016)

Log Message

Make it straightforward to start the Web Platform Tests HTTP server using run-webkit-httpd
https://bugs.webkit.org/show_bug.cgi?id=152486

Patch by Youenn Fablet <[email protected]> on 2016-07-02
Reviewed by Daniel Bates.

Add launch of web-platform-tests server by run-webkit-httpd.
Add two options to disable starting httpd and web-platform-tests servers.

* Scripts/run-webkit-httpd:
(parse_args):
(main):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (202779 => 202780)


--- trunk/Tools/ChangeLog	2016-07-02 17:44:42 UTC (rev 202779)
+++ trunk/Tools/ChangeLog	2016-07-02 17:45:57 UTC (rev 202780)
@@ -1,3 +1,17 @@
+2016-07-02  Youenn Fablet  <[email protected]>
+
+        Make it straightforward to start the Web Platform Tests HTTP server using run-webkit-httpd
+        https://bugs.webkit.org/show_bug.cgi?id=152486
+
+        Reviewed by Daniel Bates.
+
+        Add launch of web-platform-tests server by run-webkit-httpd.
+        Add two options to disable starting httpd and web-platform-tests servers.
+
+        * Scripts/run-webkit-httpd:
+        (parse_args):
+        (main):
+
 2016-07-01  Myles C. Maxfield  <[email protected]>
 
         REGRESSION(r189668): Notification tests are flakey

Modified: trunk/Tools/Scripts/run-webkit-httpd (202779 => 202780)


--- trunk/Tools/Scripts/run-webkit-httpd	2016-07-02 17:44:42 UTC (rev 202779)
+++ trunk/Tools/Scripts/run-webkit-httpd	2016-07-02 17:45:57 UTC (rev 202780)
@@ -35,6 +35,7 @@
 import time
 
 from webkitpy.common.host import Host
+from webkitpy.layout_tests.servers import web_platform_test_server
 from webkitpy.port import platform_options
 
 def parse_args(args):
@@ -41,6 +42,8 @@
     parser = optparse.OptionParser()
     parser.add_option("-a", "--all-interfaces", help="Bind to all interfaces", action="" dest="http_all_interfaces")
     parser.add_option("-p", "--port", help="Bind to port NNNN", action="" type="int", dest="http_port")
+    parser.add_option("--no-httpd", help="Do not start httpd server", action="" default=True, dest="httpd_server")
+    parser.add_option("--no-wpt", help="Do not start web-platform-tests server", action="" default=True, dest="web_platform_test_server")
     return parser.parse_args(args)
 
 def main(argv, stdout, stderr):
@@ -58,23 +61,32 @@
         print >> stderr, str(e)
         return EXCEPTIONAL_EXIT_STATUS
 
-    # FIXME(154294): somehow retrieve the actual ports and interfaces bound by the httpd server
-    http_port = options.http_port if options.http_port is not None else "8000"
-    if options.http_all_interfaces is not None:
-        print "Starting httpd on port %s (all interfaces)" % http_port
-    else:
-        print "Starting httpd on <http://127.0.0.1:%s>" % http_port
+    if options.web_platform_test_server:
+        print "Starting web-platform-tests server on <%s>" % web_platform_test_server.base_url(port)
+        port.start_web_platform_test_server()
 
-    port.start_http_server()
-    port.start_websocket_server()
+    if options.httpd_server:
+        # FIXME(154294): somehow retrieve the actual ports and interfaces bound by the httpd server
+        http_port = options.http_port if options.http_port is not None else "8000"
+        if options.http_all_interfaces is not None:
+            print "Starting httpd on port %s (all interfaces)" % http_port
+        else:
+            print "Starting httpd on <http://127.0.0.1:%s>" % http_port
 
+        port.start_http_server()
+        port.start_websocket_server()
+
     try:
         tail = subprocess.Popen(['tail', '-F', log_file.name], stdout=subprocess.PIPE)
         while True:
             sys.stdout.write(tail.stdout.readline())
     except KeyboardInterrupt:
-        port.stop_websocket_server()
-        port.stop_http_server()
+        if options.web_platform_test_server:
+            port.stop_web_platform_test_server()
+        if options.httpd_server:
+            port.stop_websocket_server()
+            port.stop_http_server()
 
+
 if __name__ == '__main__':
     sys.exit(main(sys.argv[1:], sys.stdout, sys.stderr))
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to