Bug 1409062 - Update mochitest and reftest harnesses for --verify on Android; r=jmaher
authorGeoff Brown <gbrown@mozilla.com>
Tue, 17 Oct 2017 08:00:52 -0600
changeset 386680 ba08f77ec79c235805c606e8963121262bf247bc
parent 386679 137fa515a573967392d02ca445bfcfaed3415f95
child 386681 47fc470d7a9376d8519e15935b362dbd0b7bce1c
push id32699
push userarchaeopteryx@coole-files.de
push dateTue, 17 Oct 2017 21:52:51 +0000
treeherdermozilla-central@f78d59473334 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1409062
milestone58.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 1409062 - Update mochitest and reftest harnesses for --verify on Android; r=jmaher
layout/tools/reftest/remotereftest.py
testing/mochitest/runtests.py
testing/mochitest/runtestsremote.py
--- a/layout/tools/reftest/remotereftest.py
+++ b/layout/tools/reftest/remotereftest.py
@@ -445,17 +445,20 @@ def run_test_harness(parser, options):
         reftest.printDeviceInfo()
 
 # an example manifest name to use on the cli
 # manifest = "http://" + options.remoteWebServer +
 # "/reftests/layout/reftests/reftest-sanity/reftest.list"
     retVal = 0
     try:
         dm.recordLogcat()
-        retVal = reftest.runTests(options.tests, options)
+        if options.verify:
+            retVal = reftest.verifyTests(options.tests, options)
+        else:
+            retVal = reftest.runTests(options.tests, options)
     except:
         print "Automation Error: Exception caught while running tests"
         traceback.print_exc()
         retVal = 1
 
     reftest.stopWebServer(options)
 
     if options.printDeviceInfo:
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -2363,52 +2363,56 @@ toolbar#nav-bar {
         VERIFY_REPEAT_SINGLE_BROWSER = 5
 
         def step1():
             stepOptions = copy.deepcopy(options)
             stepOptions.repeat = VERIFY_REPEAT
             stepOptions.keep_open = False
             stepOptions.runUntilFailure = True
             stepOptions.profilePath = None
+            self.urlOpts = []
             result = self.runTests(stepOptions)
             result = result or (-2 if self.countfail > 0 else 0)
             self.message_logger.finish()
             return result
 
         def step2():
             stepOptions = copy.deepcopy(options)
             stepOptions.repeat = 0
             stepOptions.keep_open = False
             for i in xrange(VERIFY_REPEAT_SINGLE_BROWSER):
                 stepOptions.profilePath = None
+                self.urlOpts = []
                 result = self.runTests(stepOptions)
                 result = result or (-2 if self.countfail > 0 else 0)
                 self.message_logger.finish()
                 if result != 0:
                     break
             return result
 
         def step3():
             stepOptions = copy.deepcopy(options)
             stepOptions.repeat = VERIFY_REPEAT
             stepOptions.keep_open = False
             stepOptions.environment.append("MOZ_CHAOSMODE=3")
             stepOptions.profilePath = None
+            self.urlOpts = []
             result = self.runTests(stepOptions)
             result = result or (-2 if self.countfail > 0 else 0)
             self.message_logger.finish()
             return result
 
         def step4():
             stepOptions = copy.deepcopy(options)
             stepOptions.repeat = 0
             stepOptions.keep_open = False
             stepOptions.environment.append("MOZ_CHAOSMODE=3")
             for i in xrange(VERIFY_REPEAT_SINGLE_BROWSER):
                 stepOptions.profilePath = None
+                self.urlOpts = []
                 result = self.runTests(stepOptions)
                 result = result or (-2 if self.countfail > 0 else 0)
                 self.message_logger.finish()
                 if result != 0:
                     break
             return result
 
         steps = [
--- a/testing/mochitest/runtestsremote.py
+++ b/testing/mochitest/runtestsremote.py
@@ -66,16 +66,17 @@ class MochiRemote(MochitestDesktop):
                 self.remoteLog)
         self._dm.removeDir(self.remoteChromeTestDir)
         self._dm.removeDir(self.remoteProfile)
         self._dm.removeDir(self.remoteCache)
         blobberUploadDir = os.environ.get('MOZ_UPLOAD_DIR', None)
         if blobberUploadDir:
             self._dm.getDirectory(self.remoteMozLog, blobberUploadDir)
         MochitestDesktop.cleanup(self, options)
+        self.localProfile = None
 
     def findPath(self, paths, filename=None):
         for path in paths:
             p = path
             if filename:
                 p = os.path.join(p, filename)
             if os.path.exists(self.getFullPath(p)):
                 return path
@@ -310,16 +311,17 @@ def run_test_harness(parser, options):
     # roboextender is used by mochitest-chrome tests like test_java_addons.html,
     # but not by any plain mochitests
     if options.flavor != 'chrome':
         options.extensionsToExclude.append('roboextender@mozilla.org')
 
     dm = options.dm
     auto.setDeviceManager(dm)
     mochitest = MochiRemote(auto, dm, options)
+    options.dm = None
 
     log = mochitest.log
     message_logger.logger = log
     mochitest.message_logger = message_logger
 
     # Check that Firefox is installed
     expected = options.app.split('/')[-1]
     installed = dm.shellCheckOutput(['pm', 'list', 'packages', expected])
@@ -364,17 +366,20 @@ def run_test_harness(parser, options):
     procName = options.app.split('/')[-1]
     dm.killProcess(procName)
     if dm.processExist(procName):
         log.warning("unable to kill %s before running tests!" % procName)
 
     mochitest.mozLogName = "moz.log"
     try:
         dm.recordLogcat()
-        retVal = mochitest.runTests(options)
+        if options.verify:
+            retVal = mochitest.verifyTests(options)
+        else:
+            retVal = mochitest.runTests(options)
     except:
         log.error("Automation Error: Exception caught while running tests")
         traceback.print_exc()
         mochitest.stopServers()
         try:
             mochitest.cleanup(options)
         except mozdevice.DMError:
             # device error cleaning up... oh well!