backout d459cc1b5a94 for robocop failures (bug 912243)
authorJoel Maher <jmaher@mozilla.com>
Mon, 07 Apr 2014 08:45:15 -0400
changeset 177287 7c107142a477a242a5730a1074e494d17b56f43f
parent 177286 84abb773cdefff107254901213c16b33a21a9325
child 177288 974c4db3003e6fe413f607e73e518a2a6d9d4f92
push id41972
push userjmaher@mozilla.com
push dateMon, 07 Apr 2014 12:45:31 +0000
treeherdermozilla-inbound@7c107142a477 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs912243
milestone31.0a1
backs outd459cc1b5a94e94a75ac2add622a236dc0af486e
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
backout d459cc1b5a94 for robocop failures (bug 912243)
testing/mochitest/mochitest_options.py
testing/mochitest/runtests.py
--- a/testing/mochitest/mochitest_options.py
+++ b/testing/mochitest/mochitest_options.py
@@ -477,17 +477,17 @@ class MochitestOptions(optparse.OptionPa
             if not os.path.exists(mochitest.vmwareHelperPath):
                 self.error("%s not found, cannot automate VMware recording." %
                            mochitest.vmwareHelperPath)
 
         if options.testManifest and options.runOnlyTests:
             self.error("Please use --test-manifest only and not --run-only-tests")
 
         if options.runOnlyTests:
-            if not os.path.exists(os.path.abspath(os.path.join(here, options.runOnlyTests))):
+            if not os.path.exists(os.path.abspath(options.runOnlyTests)):
                 self.error("unable to find --run-only-tests file '%s'" % options.runOnlyTests)
             options.runOnly = True
             options.testManifest = options.runOnlyTests
             options.runOnlyTests = None
 
         if options.manifestFile and options.testManifest:
             self.error("Unable to support both --manifest and --test-manifest/--run-only-tests at the same time")
 
@@ -508,17 +508,17 @@ class MochitestOptions(optparse.OptionPa
 
         # Try to guess the testing modules directory.
         # This somewhat grotesque hack allows the buildbot machines to find the
         # modules directory without having to configure the buildbot hosts. This
         # code should never be executed in local runs because the build system
         # should always set the flag that populates this variable. If buildbot ever
         # passes this argument, this code can be deleted.
         if options.testingModulesDir is None:
-            possible = os.path.join(here, os.path.pardir, 'modules')
+            possible = os.path.join(os.getcwd(), os.path.pardir, 'modules')
 
             if os.path.isdir(possible):
                 options.testingModulesDir = possible
 
         # Even if buildbot is updated, we still want this, as the path we pass in
         # to the app must be absolute and have proper slashes.
         if options.testingModulesDir is not None:
             options.testingModulesDir = os.path.normpath(options.testingModulesDir)
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -133,17 +133,17 @@ class MochitestServer(object):
     self.webServer = options['webServer']
     self.httpPort = options['httpPort']
     self.shutdownURL = "http://%(server)s:%(port)s/server/shutdown" % { "server" : self.webServer, "port" : self.httpPort }
     self.testPrefix = "'webapprt_'" if options.get('webapprtContent') else "undefined"
 
     if options.get('httpdPath'):
         self._httpdPath = options['httpdPath']
     else:
-        self._httpdPath = SCRIPT_DIR
+        self._httpdPath = '.'
     self._httpdPath = os.path.abspath(self._httpdPath)
 
   def start(self):
     "Run the Mochitest server, returning the process ID of the server."
 
     # get testing environment
     env = environment(xrePath=self._xrePath)
     env["XPCOM_DEBUG_BREAK"] = "warn"
@@ -154,26 +154,26 @@ class MochitestServer(object):
     # features.
     env["ASAN_OPTIONS"] = "quarantine_size=1:redzone=32:malloc_context_size=5"
 
     if mozinfo.isWin:
       env["PATH"] = env["PATH"] + ";" + str(self._xrePath)
 
     args = ["-g", self._xrePath,
             "-v", "170",
-            "-f", os.path.join(self._httpdPath, "httpd.js"),
+            "-f", self._httpdPath + "/httpd.js",
             "-e", """const _PROFILE_PATH = '%(profile)s'; const _SERVER_PORT = '%(port)s'; const _SERVER_ADDR = '%(server)s'; const _TEST_PREFIX = %(testPrefix)s; const _DISPLAY_RESULTS = %(displayResults)s;""" %
                    {"profile" : self._profileDir.replace('\\', '\\\\'), "port" : self.httpPort, "server" : self.webServer,
                     "testPrefix" : self.testPrefix, "displayResults" : str(not self._closeWhenDone).lower() },
-            "-f", os.path.join(SCRIPT_DIR, "server.js")]
+            "-f", "./" + "server.js"]
 
     xpcshell = os.path.join(self._utilityPath,
                             "xpcshell" + mozinfo.info['bin_suffix'])
     command = [xpcshell] + args
-    self._process = mozprocess.ProcessHandler(command, cwd=SCRIPT_DIR, env=env)
+    self._process = mozprocess.ProcessHandler(command, env=env)
     self._process.run()
     log.info("%s : launching %s", self.__class__.__name__, command)
     pid = self._process.pid
     log.info("runtests.py | Server pid: %d", pid)
 
   def ensureReady(self, timeout):
     assert timeout >= 0
 
@@ -228,17 +228,17 @@ class WebSocketServer(object):
 
     cmd = [sys.executable, script]
     if self.debuggerInfo and self.debuggerInfo['interactive']:
         cmd += ['--interactive']
     cmd += ['-p', str(self.port), '-w', self._scriptdir, '-l',      \
            os.path.join(self._scriptdir, "websock.log"),            \
            '--log-level=debug', '--allow-handlers-outside-root-dir']
     # start the process
-    self._process = mozprocess.ProcessHandler(cmd, cwd=SCRIPT_DIR)
+    self._process = mozprocess.ProcessHandler(cmd)
     self._process.run()
     pid = self._process.pid
     log.info("runtests.py | Websocket server pid: %d", pid)
 
   def stop(self):
     self._process.kill()
 
 class MochitestUtilsMixin(object):
@@ -256,16 +256,17 @@ class MochitestUtilsMixin(object):
   jarDir = 'mochijar'
 
   # Path to the test script on the server
   TEST_PATH = "tests"
   CHROME_PATH = "redirect.html"
   urlOpts = []
 
   def __init__(self):
+    os.chdir(SCRIPT_DIR)
     self.update_mozinfo()
 
   def update_mozinfo(self):
     """walk up directories to find mozinfo.json update the info"""
     # TODO: This should go in a more generic place, e.g. mozinfo
 
     path = SCRIPT_DIR
     dirs = set()
@@ -577,17 +578,17 @@ toolbar#nav-bar {
 }
 """
     with open(os.path.join(options.profilePath, "userChrome.css"), "a") as chromeFile:
       chromeFile.write(chrome)
 
     manifest = os.path.join(options.profilePath, "tests.manifest")
     with open(manifest, "w") as manifestFile:
       # Register chrome directory.
-      chrometestDir = os.path.join(os.path.abspath("."), SCRIPT_DIR) + "/"
+      chrometestDir = os.path.abspath(".") + "/"
       if mozinfo.isWin:
         chrometestDir = "file:///" + chrometestDir.replace("\\", "/")
       manifestFile.write("content mochitests %s contentaccessible=yes\n" % chrometestDir)
 
       if options.testingModulesDir is not None:
         manifestFile.write("resource testing-common file:///%s\n" %
           options.testingModulesDir)
 
@@ -936,17 +937,17 @@ class Mochitest(MochitestUtilsMixin):
                                                    xrePath)
         if certificateStatus:
           log.info("TEST-UNEXPECTED-FAIL | runtests.py | Certificate integration failed")
           return certificateStatus
 
         # start ssltunnel to provide https:// URLs capability
         ssltunnel = os.path.join(utilityPath, "ssltunnel" + bin_suffix)
         ssltunnel_cfg = os.path.join(self.profile.profile, "ssltunnel.cfg")
-        ssltunnelProcess = mozprocess.ProcessHandler([ssltunnel, ssltunnel_cfg], cwd=SCRIPT_DIR,
+        ssltunnelProcess = mozprocess.ProcessHandler([ssltunnel, ssltunnel_cfg],
                                                       env=environment(xrePath=xrePath))
         ssltunnelProcess.run()
         log.info("INFO | runtests.py | SSL tunnel pid: %d", ssltunnelProcess.pid)
       else:
         ssltunnelProcess = None
 
       if interactive:
         # If an interactive debugger is attached,
@@ -979,17 +980,16 @@ class Mochitest(MochitestUtilsMixin):
                                          shutdownLeaks=shutdownLeaks,
         )
 
       def timeoutHandler():
         outputHandler.log_output_buffer()
         browserProcessId = outputHandler.browserProcessId
         self.handleTimeout(timeout, proc, utilityPath, debuggerInfo, browserProcessId)
       kp_kwargs = {'kill_on_timeout': False,
-                   'cwd': SCRIPT_DIR,
                    'onTimeout': [timeoutHandler]}
       kp_kwargs['processOutputLine'] = [outputHandler]
 
       # create mozrunner instance and start the system under test process
       self.lastTestSeen = self.test_name
       startTime = datetime.now()
 
       # b2g desktop requires FirefoxRunner even though appname is b2g