Bug 1336776 - Part 2: trySetupNode: log error messages if MOZ_NODE_PATH environment variable is not set correctly. r?nwgh
MozReview-Commit-ID: 72azcBZn85E
--- 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))