forked from mirrors/gecko-dev
Bug 1883374 - screenshot-on-failure working on android performance tests r=perftest-reviewers,kshampur
This patch will take a screenshot on android when a performance test fails. It will be very useful for debugging. Differential Revision: https://phabricator.services.mozilla.com/D208466
This commit is contained in:
parent
8af4083dd5
commit
1ccd64df3d
1 changed files with 17 additions and 13 deletions
|
|
@ -16,7 +16,7 @@ from copy import deepcopy
|
||||||
import mozprocess
|
import mozprocess
|
||||||
import six
|
import six
|
||||||
from benchmark import Benchmark
|
from benchmark import Benchmark
|
||||||
from cmdline import CHROME_ANDROID_APPS, DESKTOP_APPS
|
from cmdline import CHROME_ANDROID_APPS, DESKTOP_APPS, FIREFOX_ANDROID_APPS
|
||||||
from logger.logger import RaptorLogger
|
from logger.logger import RaptorLogger
|
||||||
from manifestparser.util import evaluate_list_from_string
|
from manifestparser.util import evaluate_list_from_string
|
||||||
from perftest import GECKO_PROFILER_APPS, TRACE_APPS, Perftest
|
from perftest import GECKO_PROFILER_APPS, TRACE_APPS, Perftest
|
||||||
|
|
@ -830,26 +830,30 @@ class Browsertime(Perftest):
|
||||||
proc.wait()
|
proc.wait()
|
||||||
|
|
||||||
def get_failure_screenshot(self):
|
def get_failure_screenshot(self):
|
||||||
if not (
|
if not self.config.get("screenshot_on_failure"):
|
||||||
self.config.get("screenshot_on_failure")
|
|
||||||
and self.config["app"] in DESKTOP_APPS
|
|
||||||
):
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# Bug 1884178
|
# Bug 1884178
|
||||||
# Temporarily disable on Windows + Chrom* applications.
|
# Temporarily disable on Windows + Chrom* applications.
|
||||||
if self.config["app"] in TRACE_APPS and "win" in self.config["platform"]:
|
if self.config["app"] in TRACE_APPS and "win" in self.config["platform"]:
|
||||||
return
|
return
|
||||||
|
if self.config["app"] in DESKTOP_APPS:
|
||||||
|
from mozscreenshot import dump_screen
|
||||||
|
|
||||||
from mozscreenshot import dump_screen
|
obj_dir = os.environ.get("MOZ_DEVELOPER_OBJ_DIR", None)
|
||||||
|
if obj_dir is None:
|
||||||
|
build_dir = pathlib.Path(os.environ.get("MOZ_UPLOAD_DIR")).parent
|
||||||
|
utility_path = pathlib.Path(build_dir, "tests", "bin")
|
||||||
|
else:
|
||||||
|
utility_path = os.path.join(obj_dir, "dist", "bin")
|
||||||
|
dump_screen(utility_path, LOG)
|
||||||
|
|
||||||
obj_dir = os.environ.get("MOZ_DEVELOPER_OBJ_DIR", None)
|
elif self.config["app"] in FIREFOX_ANDROID_APPS + CHROME_ANDROID_APPS:
|
||||||
if obj_dir is None:
|
from mozdevice import ADBDeviceFactory
|
||||||
build_dir = pathlib.Path(os.environ.get("MOZ_UPLOAD_DIR")).parent
|
from mozscreenshot import dump_device_screen
|
||||||
utility_path = pathlib.Path(build_dir, "tests", "bin")
|
|
||||||
else:
|
device = ADBDeviceFactory(verbose=True)
|
||||||
utility_path = os.path.join(obj_dir, "dist", "bin")
|
dump_device_screen(device, LOG)
|
||||||
dump_screen(utility_path, LOG)
|
|
||||||
|
|
||||||
def run_extra_profiler_run(
|
def run_extra_profiler_run(
|
||||||
self, test, timeout, proc_timeout, output_timeout, line_handler, env
|
self, test, timeout, proc_timeout, output_timeout, line_handler, env
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue