Bug 1678282 - Redirect subprocess output to mozlog in testing/mochitest/runtests.py r=ahal

Differential Revision: https://phabricator.services.mozilla.com/D97559
This commit is contained in:
Andrey Bienkowski 2020-11-19 15:53:58 +00:00
parent bbfaa4e2e8
commit d7875803f2

View File

@ -382,7 +382,18 @@ def call(*args, **kwargs):
"""front-end function to mozprocess.ProcessHandler"""
# TODO: upstream -> mozprocess
# https://bugzilla.mozilla.org/show_bug.cgi?id=791383
process = mozprocess.ProcessHandler(*args, **kwargs)
log = get_proxy_logger("mochitest")
def on_output(line):
log.process_output(
process=process.pid,
data=line.decode("utf8", "replace"),
command=process.commandline,
)
process = mozprocess.ProcessHandlerMixin(
*args, processOutputLine=on_output, **kwargs
)
process.run()
return process.wait()