Skip to content

Commit

Permalink
Bug 1638963 - Run 'mach geckoview-junit' with py3; r=jmaher
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrownmozilla committed Jul 22, 2020
1 parent e9a6ea5 commit 8731a1e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion mach
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ py2commands="
firefox-ui-functional
geckodriver
geckodriver-test
geckoview-junit
hazards
jsapi-tests
jsshell-bench
Expand Down
2 changes: 1 addition & 1 deletion testing/mochitest/mochitest_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
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
Expand Down
4 changes: 3 additions & 1 deletion testing/mochitest/runjunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import posixpath
import re
import shutil
import six
import sys
import tempfile
import traceback
Expand Down Expand Up @@ -214,7 +215,7 @@ def build_command_line(self, test_filters_file, test_filters):
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)
Expand Down Expand Up @@ -259,6 +260,7 @@ def callback(line):
# 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)
Expand Down
6 changes: 3 additions & 3 deletions testing/mochitest/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import tempfile
import time
import traceback
import urllib2
import uuid
import zipfile
import bisection
Expand Down Expand Up @@ -72,7 +71,6 @@ def reraise(*args, **kwargs):
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
Expand All @@ -87,6 +85,8 @@ def reraise(*args, **kwargs):
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__))

Expand Down Expand Up @@ -563,7 +563,7 @@ def ensureReady(self, timeout):

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()
Expand Down

0 comments on commit 8731a1e

Please sign in to comment.