Bug 1390595 - Exit with jsdoc return code from "mach marionette doc". r?whimboo draft
authorAndreas Tolfsen <ato@sny.no>
Tue, 15 Aug 2017 20:00:42 +0100
changeset 646700 f3e77b2c4cbdd8e76863ceef69d96f1373b251ff
parent 646672 5ab5511100233277a760550ac509283278a0e3d9
child 726339 5da22ab558bf647a87ee85bf1d8410e99ac37dbf
push id74224
push userbmo:ato@sny.no
push dateTue, 15 Aug 2017 19:01:45 +0000
reviewerswhimboo
bugs1390595
milestone57.0a1
Bug 1390595 - Exit with jsdoc return code from "mach marionette doc". r?whimboo The "mach marionette doc" command to generate Marionette server API documentation should exit with jsdoc's return code so the caller can determine whether the operation was successful. MozReview-Commit-ID: BXqGQlN5WPN
testing/marionette/mach_commands.py
--- a/testing/marionette/mach_commands.py
+++ b/testing/marionette/mach_commands.py
@@ -140,22 +140,24 @@ class Marionette(MachCommandBase):
 
         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:
+        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