Bug 1638963 - Run 'mach geckoview-junit' with py3; r=jmaher

Differential Revision: https://phabricator.services.mozilla.com/D84560
This commit is contained in:
Geoff Brown 2020-07-22 18:08:02 +00:00
parent e9a6ea525b
commit 8731a1e19e
4 changed files with 7 additions and 6 deletions

1
mach
View File

@ -20,7 +20,6 @@ py2commands="
firefox-ui-functional
geckodriver
geckodriver-test
geckoview-junit
hazards
jsapi-tests
jsshell-bench

View File

@ -7,7 +7,7 @@ from argparse import ArgumentParser, SUPPRESS
from distutils.util import strtobool
from distutils import spawn
from itertools import chain
from urlparse import urlparse
from six.moves.urllib.parse import urlparse
import json
import os
import tempfile

View File

@ -9,6 +9,7 @@ import os
import posixpath
import re
import shutil
import six
import sys
import tempfile
import traceback
@ -214,7 +215,7 @@ class JUnitTestRunner(MochitestDesktop):
for [key, value] in [p.split('=', 1) for p in self.options.add_env]:
env[key] = value
for (env_count, (env_key, env_val)) in enumerate(env.iteritems()):
for (env_count, (env_key, env_val)) in enumerate(six.iteritems(env)):
cmd = cmd + " -e env%d %s=%s" % (env_count, env_key, env_val)
# runner
cmd = cmd + " %s/%s" % (self.options.app, self.options.runner)
@ -259,6 +260,7 @@ class JUnitTestRunner(MochitestDesktop):
# Output callback: Parse the raw junit log messages, translating into
# treeherder-friendly test start/pass/fail messages.
line = six.ensure_str(line)
self.log.process_output(self.options.app, str(line))
# Expect per-test info like: "INSTRUMENTATION_STATUS: class=something"
match = re.match(r'INSTRUMENTATION_STATUS:\s*class=(.*)', line)

View File

@ -37,7 +37,6 @@ import sys
import tempfile
import time
import traceback
import urllib2
import uuid
import zipfile
import bisection
@ -72,7 +71,6 @@ from mochitest_options import (
from mozprofile import Profile
from mozprofile.cli import parse_preferences, parse_key_value, KeyValueParseError
from mozprofile.permissions import ServerLocations
from urllib import quote_plus as encodeURIComponent
from mozlog.formatters import TbplFormatter
from mozlog import commandline, get_proxy_logger
from mozrunner.utils import get_stack_fixer_function, test_environment
@ -87,6 +85,8 @@ except ImportError:
pass
import six
from six.moves.urllib.parse import quote_plus as encodeURIComponent
from six.moves.urllib_request import urlopen
here = os.path.abspath(os.path.dirname(__file__))
@ -563,7 +563,7 @@ class MochitestServer(object):
def stop(self):
try:
with closing(urllib2.urlopen(self.shutdownURL)) as c:
with closing(urlopen(self.shutdownURL)) as c:
c.read()
# TODO: need ProcessHandler.poll()