Bug 1196814 - Fail Android mochitest, robocop, reftests when Fennec is not installed; r=jmaher
authorGeoff Brown <gbrown@mozilla.com>
Wed, 02 Sep 2015 14:20:01 -0600
changeset 260623 5f0d28eff4786909d957b08345d6ad5e0f8d18c2
parent 260622 1dbf8850f7ed7a3181a09ec1adeda7c4716ccb6c
child 260624 656880a5febe554231e320936e8d88c8bd0c2c38
push id29318
push usercbook@mozilla.com
push dateThu, 03 Sep 2015 11:15:07 +0000
treeherdermozilla-central@74fbd245369c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1196814
milestone43.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 1196814 - Fail Android mochitest, robocop, reftests when Fennec is not installed; r=jmaher
layout/tools/reftest/remotereftest.py
testing/mochitest/runrobocop.py
testing/mochitest/runtestsremote.py
--- a/layout/tools/reftest/remotereftest.py
+++ b/layout/tools/reftest/remotereftest.py
@@ -508,16 +508,23 @@ def main(args):
     if not options.ignoreWindowSize:
         parts = dm.getInfo('screen')['screen'][0].split()
         width = int(parts[0].split(':')[1])
         height = int(parts[1].split(':')[1])
         if (width < 1050 or height < 1050):
             print "ERROR: Invalid screen resolution %sx%s, please adjust to 1366x1050 or higher" % (width, height)
             return 1
 
+    # Check that Firefox is installed
+    expected = options.app.split('/')[-1]
+    installed = dm.shellCheckOutput(['pm', 'list', 'packages', expected])
+    if expected not in installed:
+        print "%s is not installed on this device" % expected
+        return 1
+
     automation.setAppName(options.app)
     automation.setRemoteProfile(options.remoteProfile)
     automation.setRemoteLog(options.remoteLogFile)
     reftest = RemoteReftest(automation, dm, options, SCRIPT_DIRECTORY)
     options = parser.verifyCommonOptions(options, reftest)
 
     if mozinfo.info['debug']:
         print "changing timeout for remote debug reftests from %s to 600 seconds" % options.timeout
--- a/testing/mochitest/runrobocop.py
+++ b/testing/mochitest/runrobocop.py
@@ -516,16 +516,24 @@ def run_test_harness(options):
         raise ValueError(
             "Invalid options specified, use --help for a list of valid options")
     message_logger = MessageLogger(logger=None)
     process_args = {'messageLogger': message_logger}
     auto = RemoteAutomation(None, "fennec", processArgs=process_args)
     auto.setDeviceManager(options.dm)
     runResult = -1
     robocop = RobocopTestRunner(auto, options.dm, options)
+
+    # Check that Firefox is installed
+    expected = options.app.split('/')[-1]
+    installed = options.dm.shellCheckOutput(['pm', 'list', 'packages', expected])
+    if expected not in installed:
+        robocop.log.error("%s is not installed on this device" % expected)
+        return 1
+
     try:
         message_logger.logger = robocop.log
         message_logger.buffering = False
         robocop.message_logger = message_logger
         robocop.log.debug("options=%s" % vars(options))
         runResult = robocop.runTests()
     except KeyboardInterrupt:
         robocop.log.info("runrobocop.py | Received keyboard interrupt")
--- a/testing/mochitest/runtestsremote.py
+++ b/testing/mochitest/runtestsremote.py
@@ -288,16 +288,23 @@ def run_test_harness(options):
     dm = options.dm
     auto.setDeviceManager(dm)
     mochitest = MochiRemote(auto, dm, options)
 
     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])
+    if expected not in installed:
+        log.error("%s is not installed on this device" % expected)
+        return 1
+
     productPieces = options.remoteProductName.split('.')
     if (productPieces is not None):
         auto.setProduct(productPieces[0])
     else:
         auto.setProduct(options.remoteProductName)
     auto.setAppName(options.remoteappname)
 
     logParent = os.path.dirname(options.remoteLogFile)