Bug 1336776 - Part 2: trySetupNode: log error messages if MOZ_NODE_PATH environment variable is not set correctly. r?nwgh draft
authorChris Peterson <cpeterson@mozilla.com>
Sat, 04 Feb 2017 15:54:28 -0800
changeset 479047 7de88bd90e8235f573b27f0e0645c9f32dfadc82
parent 479046 720b2b4bfbc6a7a8624636d0b18e475774693873
child 479048 9b2e653503687f395e95fe7a46783c412ff16394
push id44129
push usercpeterson@mozilla.com
push dateSun, 05 Feb 2017 05:52:04 +0000
reviewersnwgh
bugs1336776
milestone54.0a1
Bug 1336776 - Part 2: trySetupNode: log error messages if MOZ_NODE_PATH environment variable is not set correctly. r?nwgh MozReview-Commit-ID: 72azcBZn85E
testing/xpcshell/runxpcshelltests.py
--- a/testing/xpcshell/runxpcshelltests.py
+++ b/testing/xpcshell/runxpcshelltests.py
@@ -990,18 +990,25 @@ class XPCShellTests(object):
             self.log.info('Assuming required node servers are already running')
             return
 
         nodeBin = None
 
         # We try to find the node executable in the path given to us by the user in
         # the MOZ_NODE_PATH environment variable
         localPath = os.getenv('MOZ_NODE_PATH', None)
-        if localPath and os.path.exists(localPath) and os.path.isfile(localPath):
-            nodeBin = localPath
+        if not localPath:
+            self.log.info('MOZ_NODE_PATH environment variable not set')
+            return
+
+        if not os.path.exists(localPath) or not os.path.isfile(localPath):
+            self.log.error('node not found at MOZ_NODE_PATH %s' % (localPath))
+            return
+
+        nodeBin = localPath
 
         if nodeBin:
             self.log.info('Found node at %s' % (nodeBin,))
 
             def startServer(name, serverJs):
                 if os.path.exists(serverJs):
                     # OK, we found our server, let's try to get it running
                     self.log.info('Found %s at %s' % (name, serverJs))