Backed out changeset 1995ec00c434 (bug 1428714) for lint failure at mozrunner/utils.py on a CLOSED TREE

This commit is contained in:
Andreea Pavel 2019-02-20 16:19:58 +02:00
parent 86ca08bb6b
commit 41802224f4
8 changed files with 20 additions and 27 deletions

View File

@ -87,7 +87,6 @@ class GeckoRuntimeRunner(BaseRunner):
class BlinkRuntimeRunner(BaseRunner):
"""A base runner class for running apps like Google Chrome or Chromium."""
def __init__(self, binary, cmdargs=None, **runner_args):
super(BlinkRuntimeRunner, self).__init__(**runner_args)
self.binary = binary

View File

@ -5,16 +5,14 @@
from __future__ import absolute_import
from abc import ABCMeta, abstractproperty
import os
import subprocess
import sys
import traceback
from abc import ABCMeta, abstractproperty
import sys
from mozlog import get_default_logger
from mozprocess import ProcessHandler
from six import string_types
try:
import mozcrash
except ImportError:
@ -45,7 +43,7 @@ class BaseRunner(object):
dump_save_path=None, addons=None):
self.app_ctx = app_ctx or DefaultContext()
if isinstance(profile, string_types):
if isinstance(profile, basestring):
self.profile = self.app_ctx.profile_class(profile=profile,
addons=addons)
else:

View File

@ -8,6 +8,7 @@ import fileinput
import glob
import os
import platform
import psutil
import re
import shutil
import signal
@ -15,13 +16,12 @@ import subprocess
import sys
import telnetlib
import time
import urlparse
import urllib2
from distutils.spawn import find_executable
import psutil
import six.moves.urllib as urllib
from mozdevice import ADBHost, ADBDevice
from mozprocess import ProcessHandler
from six.moves.urllib.parse import urlparse
EMULATOR_HOME_DIR = os.path.join(os.path.expanduser('~'), '.mozbuild', 'android-device')
@ -431,6 +431,7 @@ def grant_runtime_permissions(build_obj, app, device_serial=None):
class AndroidEmulator(object):
"""
Support running the Android emulator with an AVD from Mozilla
test automation.
@ -546,7 +547,6 @@ class AndroidEmulator(object):
self.emulator_log.write("<%s>\n" % line)
if "Invalid value for -gpu" in line or "Invalid GPU mode" in line:
self.gpu = False
env = os.environ
env['ANDROID_AVD_HOME'] = os.path.join(EMULATOR_HOME_DIR, "avd")
command = [self.emulator_path, "-avd", self.avd_info.name]
@ -692,7 +692,7 @@ class AndroidEmulator(object):
def _verify_emulator(self):
telnet_ok = False
tn = None
while (not telnet_ok):
while(not telnet_ok):
try:
tn = telnetlib.Telnet('localhost', 5554, 10)
if tn is not None:
@ -827,7 +827,7 @@ def _log_info(text):
def _download_file(url, filename, path):
_log_debug("Download %s to %s/%s..." % (url, path, filename))
f = urllib.urlopen(url)
f = urllib2.urlopen(url)
if not os.path.isdir(path):
try:
os.makedirs(path)
@ -863,7 +863,6 @@ def _get_tooltool_manifest(substs, src_path, dst_path, filename):
def _tooltool_fetch():
def outputHandler(line):
_log_debug(line)
_download_file(TOOLTOOL_URL, 'tooltool.py', EMULATOR_HOME_DIR)
command = [sys.executable, 'tooltool.py',
'fetch', '-o', '-m', 'releng.manifest']

View File

@ -1,9 +1,10 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, print_function
from ConfigParser import (
ConfigParser,
RawConfigParser
)
import datetime
import os
import posixpath
@ -12,7 +13,6 @@ import tempfile
import time
from mozdevice import ADBHost, ADBError
from six.moves.configparser import ConfigParser, RawConfigParser
class Device(object):

View File

@ -8,18 +8,17 @@
from __future__ import absolute_import, print_function
import mozinfo
import os
import sys
import mozinfo
__all__ = ['findInPath', 'get_metadata_from_egg']
# python package method metadata by introspection
try:
import pkg_resources
def get_metadata_from_egg(module):
ret = {}
try:

View File

@ -1,2 +0,0 @@
[bdist_wheel]
universal = 1

View File

@ -7,7 +7,7 @@ from __future__ import absolute_import
from setuptools import setup, find_packages
PACKAGE_NAME = 'mozrunner'
PACKAGE_VERSION = '7.4.0'
PACKAGE_VERSION = '7.3.0'
desc = """Reliable start/stop/configuration of Mozilla Applications (Firefox, Thunderbird, etc.)"""
@ -23,6 +23,7 @@ deps = [
EXTRAS_REQUIRE = {'crash': ['mozcrash >= 1.0']}
setup(name=PACKAGE_NAME,
version=PACKAGE_VERSION,
description=desc,
@ -32,8 +33,7 @@ setup(name=PACKAGE_NAME,
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords='mozilla',

View File

@ -2,7 +2,7 @@
subsuite = mozbase
# We skip these tests in automated Windows builds because they trigger crashes
# in sh.exe; see bug 1489277.
skip-if = automation && os == "win"
skip-if = python == 3 || (automation && os == "win")
[test_crash.py]
[test_interactive.py]
[test_start.py]