Bug 1518447 Capture full Mitmproxy logs and have them available as treeherder artifact r=rwood,davehunt,tarek

Differential Revision: https://phabricator.services.mozilla.com/D21923

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Florin Strugariu 2019-03-12 14:57:43 +00:00
Родитель 4626e42237
Коммит 5ee219394c
1 изменённых файлов: 7 добавлений и 2 удалений

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

@ -92,6 +92,8 @@ class Mitmproxy(Playback):
)
self.mozproxy_dir = os.path.join(self.mozproxy_dir, "testing", "mozproxy")
self.upload_dir = os.environ.get("MOZ_UPLOAD_DIR", self.mozproxy_dir)
self.recordings_path = self.mozproxy_dir
LOG.info(
"mozproxy_dir used for mitmproxy downloads and exe files: %s"
@ -191,7 +193,7 @@ class Mitmproxy(Playback):
# mitmproxy needs some DLL's that are a part of Firefox itself, so add to path
env = os.environ.copy()
env["PATH"] = os.path.dirname(browser_path) + ";" + env["PATH"]
command = [mitmdump_path, "-k", "-q"]
command = [mitmdump_path, "-k"]
if "custom_script" in self.config:
# cmd line to start mitmproxy playback using custom playback script is as follows:
@ -210,7 +212,10 @@ class Mitmproxy(Playback):
LOG.info("Starting mitmproxy playback using command: %s" % " ".join(command))
# to turn off mitmproxy log output, use these params for Popen:
# Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env)
mitmproxy_proc = ProcessHandler(command, env=env)
mitmproxy_proc = ProcessHandler(command,
logfile=os.path.join(self.upload_dir,
"mitmproxy.log"),
env=env)
mitmproxy_proc.run()
# XXX replace the code below with a loop with a connection attempt