Bug 1441019 - Remove "./mach marionette doc" command. r?whimboo draft
authorAndreas Tolfsen <ato@sny.no>
Mon, 26 Feb 2018 11:48:48 +0000
changeset 759869 a3584197968ccb7a449c856dec472292cd1ef9ac
parent 759868 b9a8eccece23f3877000bff2c9ae64a264d3e031
child 759870 37ca7d04de5f7a1003fe82e7c6a4c0c03507d9c8
push id100500
push userbmo:ato@sny.no
push dateMon, 26 Feb 2018 19:31:26 +0000
reviewerswhimboo
bugs1441019
milestone60.0a1
Bug 1441019 - Remove "./mach marionette doc" command. r?whimboo This removes the "./mach marionette doc" command in favour of the Sphinx-powered "./mach doc". MozReview-Commit-ID: IODqDR4O1Dr
testing/marionette/mach_commands.py
--- a/testing/marionette/mach_commands.py
+++ b/testing/marionette/mach_commands.py
@@ -114,46 +114,8 @@ class Marionette(MachCommandBase):
             tests = []
             for obj in kwargs["test_objects"]:
                 tests.append(obj["file_relpath"])
             del kwargs["test_objects"]
 
         if not kwargs.get("binary") and conditions.is_firefox(self):
             kwargs["binary"] = self.get_binary_path("app")
         return run_marionette(tests, topsrcdir=self.topsrcdir, **kwargs)
-
-    @SubCommand("marionette", "doc",
-                description="Generate Marionette server API documentation in testing/marionette/doc.")
-    @CommandArgument("--http",
-                     help='HTTP service address (e.g. "127.0.0.1:6060" or just ":6060".'
-                     )
-    def marionette_doc(self, http, **kwargs):
-        import subprocess
-
-        def is_marionette_source_file(filename):
-            path = os.path.join(self.srcdir, filename)
-            return (os.path.isfile(path)
-                    and filename.endswith(".js")
-                    and not filename.startswith("test_"))
-
-        srcs = [f for f in os.listdir(
-            self.srcdir) if is_marionette_source_file(f)]
-
-        proc = subprocess.Popen(
-            ["jsdoc", "-c", ".jsdoc.js"] + srcs, cwd=self.srcdir)
-        proc.wait()
-
-        if http and proc.returncode == 0:
-            import SimpleHTTPServer
-            import SocketServer
-
-            host, port = http.split(":")
-            host = host or "127.0.0.1"
-            port = int(port)
-
-            handler = SimpleHTTPServer.SimpleHTTPRequestHandler
-            httpd = SocketServer.TCPServer((host, int(port)), handler)
-
-            print("serving at %s:%s" % (host, port))
-            os.chdir(os.path.join(self.srcdir, "doc"))
-            httpd.serve_forever()
-
-        return proc.returncode