Bug 1625470 - Part 1: Add --live-sites command line option to Raptor. r=perftest-reviewers,Bebe,AlexandruIonescu

This is the first patch of a multi-part patch to enable live site testing on Google Chrome for Android and Fenix. It adds the `--live-sites` command line option that disables the mozproxy playback (or enables live sites) when it is supplied.

Differential Revision: https://phabricator.services.mozilla.com/D69051
This commit is contained in:
Gregory Mierzwinski 2020-04-23 10:02:06 +00:00
parent 59656c1f31
commit a417067744
8 changed files with 35 additions and 11 deletions

View File

@ -256,6 +256,12 @@ class Raptor(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidMixin):
"default": "settled",
"help": "Name of profile scenario.",
}],
[["--live-sites"], {
"dest": "live_sites",
"action": "store_true",
"default": False,
"help": "Run tests using live sites instead of recorded sites.",
}],
[["--debug-mode"], {
"dest": "debug_mode",
"action": "store_true",
@ -384,6 +390,7 @@ class Raptor(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidMixin):
self.power_test = self.config.get('power_test')
self.memory_test = self.config.get('memory_test')
self.cpu_test = self.config.get('cpu_test')
self.live_sites = self.config.get('live_sites')
self.disable_perf_tuning = self.config.get('disable_perf_tuning')
self.conditioned_profile_scenario = self.config.get('conditioned_profile_scenario',
'settled')
@ -571,6 +578,8 @@ class Raptor(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidMixin):
options.extend(['--memory-test'])
if self.config.get('cpu_test', False):
options.extend(['--cpu-test'])
if self.config.get('live_sites', False):
options.extend(['--live-sites'])
if self.config.get('disable_perf_tuning', False):
options.extend(['--disable-perf-tuning'])
if self.config.get('cold', False):

View File

@ -63,6 +63,7 @@ class RaptorRunner(MozbuildObject):
self.memory_test = kwargs['memory_test']
self.power_test = kwargs['power_test']
self.cpu_test = kwargs['cpu_test']
self.live_sites = kwargs['live_sites']
self.disable_perf_tuning = kwargs['disable_perf_tuning']
self.conditioned_profile_scenario = kwargs['conditioned_profile_scenario']
self.device_name = kwargs['device_name']
@ -163,6 +164,7 @@ class RaptorRunner(MozbuildObject):
'power_test': self.power_test,
'memory_test': self.memory_test,
'cpu_test': self.cpu_test,
'live_sites': self.live_sites,
'disable_perf_tuning': self.disable_perf_tuning,
'conditioned_profile_scenario': self.conditioned_profile_scenario,
'is_release_build': self.is_release_build,

View File

@ -100,6 +100,8 @@ def create_parser(mach_interface=False):
help="Use Raptor to measure memory usage.")
add_arg('--cpu-test', dest="cpu_test", action="store_true",
help="Use Raptor to measure CPU usage. Currently supported for Android only.")
add_arg('--live-sites', dest="live_sites", action="store_true", default=False,
help="Run tests using live sites instead of recorded sites.")
add_arg('--is-release-build', dest="is_release_build", default=False,
action='store_true',
help="Whether the build is a release build which requires workarounds "

View File

@ -327,6 +327,11 @@ def get_raptor_test_list(args, oskey):
# subtest comes from matching test ini file name, so add it
tests_to_run.append(next_test)
# enable live sites if requested with --live-sites
if args.live_sites:
for next_test in tests_to_run:
next_test['use_live_sites'] = "true"
# go through each test and set the page-cycles and page-timeout, and some config flags
# the page-cycles value in the INI can be overriden when debug-mode enabled, when
# gecko-profiling enabled, or when --page-cycles cmd line arg was used (that overrides all)
@ -335,15 +340,6 @@ def get_raptor_test_list(args, oskey):
max_page_cycles = next_test.get('page_cycles', 1)
max_browser_cycles = next_test.get('browser_cycles', 1)
# if using playback, the playback recording info may need to be transformed
if next_test.get('playback') is not None:
next_test['playback_pageset_manifest'] = \
transform_subtest(next_test['playback_pageset_manifest'],
next_test['name'])
next_test['playback_recordings'] = \
transform_subtest(next_test['playback_recordings'],
next_test['name'])
if args.gecko_profile is True:
next_test['gecko_profile'] = True
LOG.info('gecko-profiling enabled')
@ -446,13 +442,20 @@ def get_raptor_test_list(args, oskey):
# when using live sites we want to turn off playback
LOG.info("using live sites so turning playback off!")
next_test['playback'] = None
LOG.info("using live sites so appending '-live' to the test name")
next_test['name'] = next_test['name'] + "-live"
# allow a slightly higher page timeout due to remote page loads
next_test['page_timeout'] = int(
next_test['page_timeout']) * LIVE_SITE_TIMEOUT_MULTIPLIER
LOG.info("using live sites so using page timeout of %dms" % next_test['page_timeout'])
# if using playback, the playback recording info may need to be transformed
if next_test.get('playback') is not None:
next_test['playback_pageset_manifest'] = \
transform_subtest(next_test['playback_pageset_manifest'],
next_test['name'])
next_test['playback_recordings'] = \
transform_subtest(next_test['playback_recordings'],
next_test['name'])
# browsertime doesn't use the 'measure' test ini setting; however just for the sake
# of supporting both webext and browsertime, just provide a dummy 'measure' setting
# here to prevent having to check in multiple places; it has no effect on what

View File

@ -84,6 +84,7 @@ either Raptor or browsertime."""
power_test=False,
cpu_test=False,
memory_test=False,
live_sites=False,
is_release_build=False,
debug_mode=False,
post_startup_delay=POST_DELAY_DEFAULT,
@ -122,6 +123,7 @@ either Raptor or browsertime."""
"power_test": power_test,
"memory_test": memory_test,
"cpu_test": cpu_test,
"live_sites": live_sites,
"is_release_build": is_release_build,
"enable_control_server_wait": memory_test or cpu_test,
"e10s": e10s,

View File

@ -122,6 +122,7 @@ def main(args=sys.argv[1:]):
power_test=args.power_test,
cpu_test=args.cpu_test,
memory_test=args.memory_test,
live_sites=args.live_sites,
is_release_build=args.is_release_build,
debug_mode=args.debug_mode,
post_startup_delay=args.post_startup_delay,

View File

@ -27,6 +27,7 @@ class PerftestResultsHandler(object):
power_test=False,
cpu_test=False,
memory_test=False,
live_sites=False,
app=None,
no_conditioned_profile=False,
**kwargs
@ -35,6 +36,7 @@ class PerftestResultsHandler(object):
self.power_test = power_test
self.cpu_test = cpu_test
self.memory_test = memory_test
self.live_sites = live_sites
self.app = app
self.results = []
self.page_timeout_list = []
@ -596,6 +598,8 @@ class BrowsertimeResultsHandler(PerftestResultsHandler):
new_result["extra_options"].append("nocondprof")
if self.fission_enabled:
new_result["extra_options"].append("fission")
if self.live_sites:
new_result["extra_options"].append("live")
return new_result

View File

@ -98,6 +98,7 @@ def create_args():
run_local=True,
browsertime=True,
cold=False,
live_sites=False,
)
def inner(**kwargs):