Bug 1359288 - Enable Android reftest to resume from crashes. r?jmaher
MozReview-Commit-ID: EqTOdEwfTWi
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -580,14 +580,14 @@ class Automation(object):
crashed = self.checkForCrashes(os.path.join(profileDir, "minidumps"), symbolsPath)
if crashed or zombieProcesses:
status = 1
if os.path.exists(processLog):
os.unlink(processLog)
- return status
+ return status, self.lastTestSeen
def elf_arm(self, filename):
data = open(filename, 'rb').read(20)
return data[:4] == "\x7fELF" and ord(data[18]) == 40 # EM_ARM
--- a/layout/tools/reftest/remotereftest.py
+++ b/layout/tools/reftest/remotereftest.py
@@ -307,26 +307,26 @@ class RemoteReftest(RefTest):
if "XPCOM_MEM_BLOAT_LOG" in browserEnv:
del browserEnv["XPCOM_MEM_BLOAT_LOG"]
return browserEnv
def runApp(self, profile, binary, cmdargs, env,
timeout=None, debuggerInfo=None,
symbolsPath=None, options=None,
valgrindPath=None, valgrindArgs=None, valgrindSuppFiles=None):
- status = self.automation.runApp(None, env,
- binary,
- profile.profile,
- cmdargs,
- utilityPath=options.utilityPath,
- xrePath=options.xrePath,
- debuggerInfo=debuggerInfo,
- symbolsPath=symbolsPath,
- timeout=timeout)
- return status, None
+ status, lastTestSeen = self.automation.runApp(None, env,
+ binary,
+ profile.profile,
+ cmdargs,
+ utilityPath=options.utilityPath,
+ xrePath=options.xrePath,
+ debuggerInfo=debuggerInfo,
+ symbolsPath=symbolsPath,
+ timeout=timeout)
+ return status, lastTestSeen
def cleanup(self, profileDir):
# Pull results back from device
if self.remoteLogFile and \
self._devicemanager.fileExists(self.remoteLogFile):
self._devicemanager.getFile(self.remoteLogFile, self.localLogName)
else:
print "WARNING: Unable to retrieve log file (%s) from remote " \
--- a/testing/mochitest/runrobocop.py
+++ b/testing/mochitest/runrobocop.py
@@ -454,17 +454,17 @@ class RobocopTestRunner(MochitestDesktop
self.log.info("")
result = -1
log_result = -1
try:
self.dm.recordLogcat()
timeout = self.options.timeout
if not timeout:
timeout = self.NO_OUTPUT_TIMEOUT
- result = self.auto.runApp(
+ result, _ = self.auto.runApp(
None, browserEnv, "am", self.localProfile, browserArgs,
timeout=timeout, symbolsPath=self.options.symbolsPath)
self.log.debug("runApp completes with status %d" % result)
if result != 0:
self.log.error("runApp() exited with code %s" % result)
if self.dm.fileExists(self.remoteLog):
self.dm.getFile(self.remoteLog, self.localLog)
self.dm.removeFile(self.remoteLog)
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -2163,17 +2163,17 @@ toolbar#nav-bar {
status = 1
finally:
# cleanup
if os.path.exists(processLog):
os.remove(processLog)
self.urlOpts = []
- return status
+ return status, self.lastTestSeen
def initializeLooping(self, options):
"""
This method is used to clear the contents before each run of for loop.
This method is used for --run-by-dir and --bisect-chunk.
"""
self.expectedError.clear()
self.result.clear()
@@ -2483,17 +2483,17 @@ toolbar#nav-bar {
testURL = self.buildTestURL(options, scheme=scheme)
self.buildURLOptions(options, self.browserEnv)
if self.urlOpts:
testURL += "?" + "&".join(self.urlOpts)
self.log.info("runtests.py | Running with e10s: {}".format(options.e10s))
self.log.info("runtests.py | Running tests: start.\n")
- ret = self.runApp(
+ ret, _ = self.runApp(
testURL,
self.browserEnv,
options.app,
profile=self.profile,
extraArgs=options.browserArgs,
utilityPath=options.utilityPath,
debuggerInfo=debuggerInfo,
valgrindPath=valgrindPath,
--- a/testing/mochitest/runtestsremote.py
+++ b/testing/mochitest/runtestsremote.py
@@ -281,17 +281,18 @@ class MochiRemote(MochitestDesktop):
# automation.py/remoteautomation `runApp` takes the profile path,
# whereas runtest.py's `runApp` takes a mozprofile object.
if 'profileDir' not in kwargs and 'profile' in kwargs:
kwargs['profileDir'] = kwargs.pop('profile').profile
# remove args not supported by automation.py
kwargs.pop('marionette_args', None)
- return self._automation.runApp(*args, **kwargs)
+ ret, _ = self._automation.runApp(*args, **kwargs)
+ return ret, None
def run_test_harness(parser, options):
parser.validate(options)
message_logger = MessageLogger(logger=None)
process_args = {'messageLogger': message_logger}
auto = RemoteAutomation(None, "fennec", processArgs=process_args)