Bug 1704245 - Dump less device info in android test logs; r=jmaher

Make android test logs simpler and easier to read by removing less helpful diagnostic info.

Differential Revision: https://phabricator.services.mozilla.com/D111526
This commit is contained in:
Geoff Brown 2021-04-12 13:38:28 +00:00
parent 2b7c7fb741
commit c792752b09
5 changed files with 1 additions and 71 deletions

View File

@ -160,7 +160,6 @@ class ReftestRunner(MozbuildObject):
if not args.utilityPath:
args.utilityPath = args.xrePath
args.ignoreWindowSize = True
args.printDeviceInfo = False
from mozrunner.devices.android_device import get_adb_path

View File

@ -68,7 +68,6 @@ def run_reftest_android(context, args):
args.xrePath = context.hostutils
args.httpdPath = context.module_dir
args.ignoreWindowSize = True
args.printDeviceInfo = False
config = context.mozharness_config
if config:

View File

@ -605,14 +605,6 @@ class RemoteArgumentsParser(ReftestArgumentsParser):
help="Path to the httpd.js file.",
)
self.add_argument(
"--no-device-info",
action="store_false",
dest="printDeviceInfo",
default=True,
help="Do not display verbose diagnostics about the remote device.",
)
self.add_argument(
"--no-install",
action="store_true",

View File

@ -18,7 +18,7 @@ from contextlib import closing
from six.moves.urllib_request import urlopen
from mozdevice import ADBDeviceFactory, ADBTimeoutError, RemoteProcessMonitor
from mozdevice import ADBDeviceFactory, RemoteProcessMonitor
import mozcrash
from output import OutputHandler
@ -366,29 +366,6 @@ class RemoteReftest(RefTest):
return profile
def printDeviceInfo(self, printLogcat=False):
try:
if printLogcat:
logcat = self.device.get_logcat()
for l in logcat:
ul = l.decode("utf-8", errors="replace")
sl = ul.encode("iso8859-1", errors="replace")
print("%s\n" % sl)
print("Device info:")
devinfo = self.device.get_info()
for category in devinfo:
if type(devinfo[category]) is list:
print(" %s:" % category)
for item in devinfo[category]:
print(" %s" % item)
else:
print(" %s: %s" % (category, devinfo[category]))
print("Test root: %s" % self.device.test_root)
except ADBTimeoutError:
raise
except Exception as e:
print("WARNING: Error getting device information: %s" % str(e))
def environment(self, env=None, crashreporter=True, **kwargs):
# Since running remote, do not mimic the local env: do not copy os.environ
if env is None:
@ -553,9 +530,6 @@ def run_test_harness(parser, options):
if retVal:
return retVal
if options.printDeviceInfo and not options.verify:
reftest.printDeviceInfo()
retVal = 0
try:
if options.verify:
@ -569,9 +543,6 @@ def run_test_harness(parser, options):
reftest.stopWebServer(options)
if options.printDeviceInfo and not options.verify:
reftest.printDeviceInfo(printLogcat=(retVal != 0))
return retVal

View File

@ -268,29 +268,6 @@ class MochiRemote(MochitestDesktop):
def getLogFilePath(self, logFile):
return logFile
def printDeviceInfo(self, printLogcat=False):
try:
if printLogcat:
logcat = self.device.get_logcat()
for l in logcat:
ul = l.decode("utf-8", errors="replace")
sl = ul.encode("iso8859-1", errors="replace")
self.log.info(sl)
self.log.info("Device info:")
devinfo = self.device.get_info()
for category in devinfo:
if type(devinfo[category]) is list:
self.log.info(" %s:" % category)
for item in devinfo[category]:
self.log.info(" %s" % item)
else:
self.log.info(" %s: %s" % (category, devinfo[category]))
self.log.info("Test root: %s" % self.device.test_root)
except ADBTimeoutError:
raise
except Exception as e:
self.log.warning("Error getting device information: %s" % str(e))
def getGMPPluginPath(self, options):
# TODO: bug 1149374
return None
@ -453,11 +430,7 @@ def run_test_harness(parser, options):
mochitest = MochiRemote(options)
if options.log_mach is None and not options.verify:
mochitest.printDeviceInfo()
try:
device_exception = False
if options.verify:
retVal = mochitest.verifyTests(options)
else:
@ -467,7 +440,6 @@ def run_test_harness(parser, options):
traceback.print_exc()
if isinstance(e, ADBTimeoutError):
mochitest.log.info("Device disconnected. Will not run mochitest.cleanup().")
device_exception = True
else:
try:
mochitest.cleanup(options)
@ -476,9 +448,6 @@ def run_test_harness(parser, options):
traceback.print_exc()
retVal = 1
if not device_exception and options.log_mach is None and not options.verify:
mochitest.printDeviceInfo(printLogcat=(retVal != 0))
mochitest.archiveMozLogs()
mochitest.message_logger.finish()