Bug 1497566 - Remove logcat functionality from mozrunner; r=automatedtester
authorGeoff Brown <gbrown@mozilla.com>
Thu, 11 Oct 2018 09:47:55 -0600
changeset 440686 11f33f3c73b4d58511d16cc0fbfcf8fa9363084f
parent 440685 d492774b453f8e7ecdd79b71b5092e408ae005b2
child 440687 912784581287a7b736c4ec25d4b85fe562e868fa
push id108833
push usergbrown@mozilla.com
push dateThu, 11 Oct 2018 15:48:15 +0000
treeherdermozilla-inbound@5095c0fdd000 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester
bugs1497566
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1497566 - Remove logcat functionality from mozrunner; r=automatedtester When testing locally, logcat can be run easily; in CI, mozharness scripts manage logcat and save the logcat as a test artifact.
testing/marionette/client/marionette_driver/geckoinstance.py
testing/mozbase/mozrunner/mozrunner/devices/base.py
testing/mozbase/mozrunner/mozrunner/runners.py
testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/fennec.py
--- a/testing/marionette/client/marionette_driver/geckoinstance.py
+++ b/testing/marionette/client/marionette_driver/geckoinstance.py
@@ -438,26 +438,16 @@ class FennecInstance(GeckoInstance):
         try:
             if self.connect_to_running_emulator:
                 self.runner.device.connect()
             self.runner.start()
         except Exception as e:
             exc, val, tb = sys.exc_info()
             message = "Error possibly due to runner or device args: {}"
             reraise(exc, message.format(e.message), tb)
-        # gecko_log comes from logcat when running with device/emulator
-        logcat_args = {
-            "filterspec": "Gecko",
-            "serial": self.runner.device.app_ctx.device_serial
-        }
-        if self.gecko_log == "-":
-            logcat_args["stream"] = sys.stdout
-        else:
-            logcat_args["logfile"] = self.gecko_log
-        self.runner.device.start_logcat(**logcat_args)
 
         # forward marionette port
         self.runner.device.device.forward(
             local="tcp:{}".format(self.marionette_port),
             remote="tcp:{}".format(self.marionette_port))
 
     def _get_runner_args(self):
         process_args = {
--- a/testing/mozbase/mozrunner/mozrunner/devices/base.py
+++ b/testing/mozbase/mozrunner/mozrunner/devices/base.py
@@ -8,22 +8,20 @@ from ConfigParser import (
 import datetime
 import os
 import posixpath
 import shutil
 import tempfile
 import time
 
 from mozdevice import ADBHost, ADBError
-from mozprocess import ProcessHandler
 
 
 class Device(object):
     connected = False
-    logcat_proc = None
 
     def __init__(self, app_ctx, logdir=None, serial=None, restore=True):
         self.app_ctx = app_ctx
         self.device = self.app_ctx.device
         self.restore = restore
         self.serial = serial
         self.logdir = os.path.abspath(os.path.expanduser(logdir))
         self.added_files = set()
@@ -136,38 +134,16 @@ class Device(object):
         online_devices = self._get_online_devices()
         if not online_devices:
             raise IOError("No devices connected. Ensure the device is on and "
                           "remote debugging via adb is enabled in the settings.")
         self.serial = online_devices[0]
 
         self.connected = True
 
-        if self.logdir:
-            # save logcat
-            logcat_log = os.path.join(self.logdir, '%s.log' % self.serial)
-            if os.path.isfile(logcat_log):
-                self._rotate_log(logcat_log)
-            self.logcat_proc = self.start_logcat(self.serial, logfile=logcat_log)
-
-    def start_logcat(self, serial, logfile=None, stream=None, filterspec=None):
-        logcat_args = [self.app_ctx.adb, '-s', '%s' % serial,
-                       'logcat', '-v', 'time', '-b', 'main', '-b', 'radio']
-        # only log filterspec
-        if filterspec:
-            logcat_args.extend(['-s', filterspec])
-        process_args = {}
-        if logfile:
-            process_args['logfile'] = logfile
-        elif stream:
-            process_args['stream'] = stream
-        proc = ProcessHandler(logcat_args, **process_args)
-        proc.run()
-        return proc
-
     def reboot(self):
         """
         Reboots the device via adb.
         """
         self.device.reboot()
 
     def wait_for_net(self):
         active = False
--- a/testing/mozbase/mozrunner/mozrunner/runners.py
+++ b/testing/mozbase/mozrunner/mozrunner/runners.py
@@ -96,17 +96,17 @@ def FennecEmulatorRunner(avd='mozemulato
     """
     Create a Fennec emulator runner. This can either start a new emulator
     (which will use an avd), or connect to  an already-running emulator.
 
     :param avd: name of an AVD available in your environment.
         Typically obtained via tooltool: either 'mozemulator-4.3' or 'mozemulator-x86'.
         Defaults to 'mozemulator-4.3'
     :param avd_home: Path to avd parent directory
-    :param logdir: Path to save logfiles such as logcat and qemu output.
+    :param logdir: Path to save logfiles such as qemu output.
     :param serial: Serial of emulator to connect to as seen in `adb devices`.
         Defaults to the first entry in `adb devices`.
     :param binary: Path to emulator binary.
         Defaults to None, which causes the device_class to guess based on PATH.
     :param app: Name of Fennec app (often org.mozilla.fennec_$USER)
         Defaults to 'org.mozilla.fennec'
     :param cmdargs: Arguments to pass into binary.
     :returns: A DeviceRunner for Android emulators.
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/fennec.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/fennec.py
@@ -215,26 +215,16 @@ class FennecBrowser(FirefoxBrowser):
         self.logger.debug("Starting Fennec")
         # connect to a running emulator
         self.runner.device.connect()
 
         write_hosts_file(self.config, self.runner.device.device)
 
         self.runner.start(debug_args=debug_args, interactive=self.debug_info and self.debug_info.interactive)
 
-        # gecko_log comes from logcat when running with device/emulator
-        logcat_args = {
-            "filterspec": "Gecko",
-            "serial": self.runner.device.app_ctx.device_serial
-        }
-        # TODO setting logcat_args["logfile"] yields an almost empty file
-        # even without filterspec
-        logcat_args["stream"] = sys.stdout
-        self.runner.device.start_logcat(**logcat_args)
-
         self.runner.device.device.forward(
             local="tcp:{}".format(self.marionette_port),
             remote="tcp:{}".format(self.marionette_port))
 
         self.logger.debug("Fennec Started")
 
     def stop(self, force=False):
         if self.runner is not None: