Bug 890098 - Follow-up: Always set the plugins dir. r=jgriffin
authorMihnea Dobrescu-Balaur <mihneadb@gmail.com>
Tue, 23 Jul 2013 23:08:46 -0700
changeset 152692 7fa4f478c76dbffc3fde5a2f7f2120bc7f3d79bd
parent 152691 ca0c8e91042669b1151474ce482422208edcc3fa
child 152693 7cd08e2beee18d11bd25c53e726008443d550b02
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgriffin
bugs890098
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 890098 - Follow-up: Always set the plugins dir. r=jgriffin
testing/xpcshell/remotexpcshelltests.py
testing/xpcshell/runxpcshelltests.py
--- a/testing/xpcshell/remotexpcshelltests.py
+++ b/testing/xpcshell/remotexpcshelltests.py
@@ -254,16 +254,19 @@ class XPCShellRemote(xpcshell.XPCShellTe
             self.device.mkDir(self.remoteTmpDir)
 
         self.env["XPCSHELL_TEST_TEMP_DIR"] = self.remoteTmpDir
         if self.interactive:
             self.log.info("TEST-INFO | temp dir is %s" % self.remoteTmpDir)
         return self.remoteTmpDir
 
     def setupPluginsDir(self):
+        if not os.path.isdir(self.pluginsPath):
+            return None
+
         # making sure tmp dir is set up
         self.setupTempDir()
 
         pluginsDir = self.remoteJoin(self.remoteTmpDir, "plugins")
         self.device.pushDir(self.pluginsPath, pluginsDir)
         if self.interactive:
             self.log.info("TEST-INFO | plugins dir is %s" % pluginsDir)
         return pluginsDir
--- a/testing/xpcshell/runxpcshelltests.py
+++ b/testing/xpcshell/runxpcshelltests.py
@@ -233,21 +233,25 @@ class XPCShellTests(object):
                 'const _TESTING_MODULES_DIR = "%s";' % sanitized
             ])
 
         self.xpcsCmd.extend(['-f', os.path.join(self.testharnessdir, 'head.js')])
 
         if self.debuggerInfo:
             self.xpcsCmd = [self.debuggerInfo["path"]] + self.debuggerInfo["args"] + self.xpcsCmd
 
-        if self.pluginsPath:
-            self.pluginsDir = self.setupPluginsDir()
+        # Automation doesn't specify a pluginsPath and xpcshell defaults to
+        # $APPDIR/plugins. We do the same here so we can carry on with
+        # setting up every test with its own plugins directory.
+        if not self.pluginsPath:
+            self.pluginsPath = os.path.join(self.appPath, 'plugins')
+
+        self.pluginsDir = self.setupPluginsDir()
+        if self.pluginsDir:
             self.xpcsCmd.extend(['-p', self.pluginsDir])
-        else:
-            self.pluginsDir = None
 
     def buildTestPath(self):
         """
           If we specifiy a testpath, set the self.testPath variable to be the given directory or file.
 
           |testPath| will be the optional path only, or |None|.
           |singleFile| will be the optional test only, or |None|.
         """
@@ -289,16 +293,19 @@ class XPCShellTests(object):
                     raise Exception('%s file is not a file: %s' % (kind, path))
 
                 yield path
 
         return (list(sanitize_list(test['head'], 'head')),
                 list(sanitize_list(test['tail'], 'tail')))
 
     def setupPluginsDir(self):
+        if not os.path.isdir(self.pluginsPath):
+            return None
+
         pluginsDir = mkdtemp()
         # shutil.copytree requires dst to not exist. Deleting the tempdir
         # would make a race condition possible in a concurrent environment,
         # so we are using dir_utils.copy_tree which accepts an existing dst
         dir_util.copy_tree(self.pluginsPath, pluginsDir)
         if self.interactive:
             self.log.info("TEST-INFO | plugins dir is %s" % pluginsDir)
         return pluginsDir