Bug 1332573 - Always set status in mochitest even if no tests were found, r=pyang

This fixes a regression in bug 1332573 where if no tests are found by the getActiveTests
function, the status variable never gets set. This ensures that we always set status, and
that it will be set to a non-zero return code if any of the calls to runApp fail.

MozReview-Commit-ID: 20M7FcBs0DF

--HG--
extra : rebase_source : d33a1a052986df628a90146e6de29aa415d8a1ad
This commit is contained in:
Andrew Halberstadt 2017-01-20 09:37:52 -05:00
Родитель f040eda61d
Коммит 3eca421290
1 изменённых файлов: 22 добавлений и 17 удалений

Просмотреть файл

@ -322,6 +322,7 @@ def killPid(pid, log):
except Exception as e:
log.info("Failed to kill process %d: %s" % (pid, str(e)))
if mozinfo.isWin:
import ctypes.wintypes
@ -2358,6 +2359,7 @@ toolbar#nav-bar {
self.browserEnv["MOZ_LOG_FILE"] = "{}/moz-pid=%PID-uid={}.log".format(
self.browserEnv["MOZ_UPLOAD_DIR"], str(uuid.uuid4()))
status = 0
try:
self.startServers(options, debuggerInfo)
@ -2417,23 +2419,25 @@ toolbar#nav-bar {
self.log.info("runtests.py | Running with e10s: {}".format(options.e10s))
self.log.info("runtests.py | Running tests: start.\n")
status = self.runApp(testURL,
self.browserEnv,
options.app,
profile=self.profile,
extraArgs=options.browserArgs,
utilityPath=options.utilityPath,
debuggerInfo=debuggerInfo,
valgrindPath=valgrindPath,
valgrindArgs=valgrindArgs,
valgrindSuppFiles=valgrindSuppFiles,
symbolsPath=options.symbolsPath,
timeout=timeout,
detectShutdownLeaks=detectShutdownLeaks,
screenshotOnFail=options.screenshotOnFail,
bisectChunk=options.bisectChunk,
marionette_args=marionette_args,
)
ret = self.runApp(
testURL,
self.browserEnv,
options.app,
profile=self.profile,
extraArgs=options.browserArgs,
utilityPath=options.utilityPath,
debuggerInfo=debuggerInfo,
valgrindPath=valgrindPath,
valgrindArgs=valgrindArgs,
valgrindSuppFiles=valgrindSuppFiles,
symbolsPath=options.symbolsPath,
timeout=timeout,
detectShutdownLeaks=detectShutdownLeaks,
screenshotOnFail=options.screenshotOnFail,
bisectChunk=options.bisectChunk,
marionette_args=marionette_args,
)
status = ret or status
except KeyboardInterrupt:
self.log.info("runtests.py | Received keyboard interrupt.\n")
status = -1
@ -2735,5 +2739,6 @@ def cli(args=sys.argv[1:]):
return run_test_harness(parser, options)
if __name__ == "__main__":
sys.exit(cli())