diff --git a/testing/mozharness/mozharness/mozilla/testing/raptor.py b/testing/mozharness/mozharness/mozilla/testing/raptor.py index adcafecfd0e2..a1acd0fa8574 100644 --- a/testing/mozharness/mozharness/mozilla/testing/raptor.py +++ b/testing/mozharness/mozharness/mozilla/testing/raptor.py @@ -243,6 +243,12 @@ class Raptor(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidMixin): "default": False, "help": "Disable performance tuning on android.", }], + [["--conditioned-profile-scenario"], { + "dest": "conditioned_profile_scenario", + "type": "str", + "default": "settled", + "help": "Name of profile scenario.", + }], [["--debug-mode"], { "dest": "debug_mode", "action": "store_true", @@ -366,6 +372,8 @@ class Raptor(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidMixin): self.memory_test = self.config.get('memory_test') self.cpu_test = self.config.get('cpu_test') self.disable_perf_tuning = self.config.get('disable_perf_tuning') + self.conditioned_profile_scenario = self.config.get('conditioned_profile_scenario', + 'settled') self.extra_prefs = self.config.get('extra_prefs') self.is_release_build = self.config.get('is_release_build') self.debug_mode = self.config.get('debug_mode', False) @@ -524,6 +532,9 @@ class Raptor(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidMixin): kw_options['device-name'] = self.config['device_name'] if self.config.get('activity') is not None: kw_options['activity'] = self.config['activity'] + if self.config.get('conditioned_profile_scenario') is not None: + kw_options['conditioned-profile-scenario'] = \ + self.config['conditioned_profile_scenario'] kw_options.update(kw) if self.host: diff --git a/testing/raptor/mach_commands.py b/testing/raptor/mach_commands.py index e545fc494aaf..2ba8e420907d 100644 --- a/testing/raptor/mach_commands.py +++ b/testing/raptor/mach_commands.py @@ -59,6 +59,7 @@ class RaptorRunner(MozbuildObject): self.power_test = kwargs['power_test'] self.cpu_test = kwargs['cpu_test'] self.disable_perf_tuning = kwargs['disable_perf_tuning'] + self.conditioned_profile_scenario = kwargs['conditioned_profile_scenario'] self.device_name = kwargs['device_name'] if Conditions.is_android(self) or kwargs["app"] in ANDROID_BROWSERS: @@ -158,6 +159,7 @@ class RaptorRunner(MozbuildObject): 'memory_test': self.memory_test, 'cpu_test': self.cpu_test, 'disable_perf_tuning': self.disable_perf_tuning, + 'conditioned_profile_scenario': self.conditioned_profile_scenario, 'is_release_build': self.is_release_build, 'device_name': self.device_name, } diff --git a/testing/raptor/raptor/cmdline.py b/testing/raptor/raptor/cmdline.py index 0568af57d56e..8df4f102c376 100644 --- a/testing/raptor/raptor/cmdline.py +++ b/testing/raptor/raptor/cmdline.py @@ -166,6 +166,8 @@ def create_parser(mach_interface=False): help="Location where Android browser APK was extracted to before installation.") add_arg('--disable-perf-tuning', dest='disable_perf_tuning', default=False, action="store_true", help="Disable performance tuning on android.") + add_arg('--conditioned-profile-scenario', dest='conditioned_profile_scenario', + default='settled', type=str, help="Name of profile scenario.") # for browsertime jobs, cold page load is determined by a '--cold' cmd line argument add_arg('--cold', dest="cold", action="store_true", diff --git a/testing/raptor/raptor/perftest.py b/testing/raptor/raptor/perftest.py index 8ca6c59b3de2..726fa40fd251 100644 --- a/testing/raptor/raptor/perftest.py +++ b/testing/raptor/raptor/perftest.py @@ -94,6 +94,7 @@ either Raptor or browsertime.""" no_conditioned_profile=False, device_name=None, disable_perf_tuning=False, + conditioned_profile_scenario='settled', extra_prefs={}, **kwargs ): @@ -125,6 +126,7 @@ either Raptor or browsertime.""" "device_name": device_name, "enable_fission": extra_prefs.get("fission.autostart", False), "disable_perf_tuning": disable_perf_tuning, + "conditioned_profile_scenario": conditioned_profile_scenario, "extra_prefs": extra_prefs, } @@ -214,12 +216,20 @@ either Raptor or browsertime.""" platform = get_current_platform() LOG.info("Platform used: %s" % platform) + profile_scenario = self.config.get("conditioned_profile_scenario", "settled") try: - cond_prof_target_dir = get_profile(temp_download_dir, platform, "settled") + cond_prof_target_dir = get_profile( + temp_download_dir, + platform, + profile_scenario + ) except ProfileNotFoundError: # If we can't find the profile on mozilla-central, we look on try cond_prof_target_dir = get_profile( - temp_download_dir, platform, "settled", repo="try" + temp_download_dir, + platform, + profile_scenario, + repo="try" ) except Exception: # any other error is a showstopper @@ -234,8 +244,11 @@ either Raptor or browsertime.""" if not os.path.exists(cond_prof_target_dir): LOG.critical( "Can't find target_dir {}, from get_profile()" - "temp_download_dir {}, platform {}, settled".format( - cond_prof_target_dir, temp_download_dir, platform + "temp_download_dir {}, platform {}, scenario {}".format( + cond_prof_target_dir, + temp_download_dir, + platform, + profile_scenario ) ) raise OSError diff --git a/testing/raptor/raptor/raptor.py b/testing/raptor/raptor/raptor.py index 862834c76819..24005b905378 100644 --- a/testing/raptor/raptor/raptor.py +++ b/testing/raptor/raptor/raptor.py @@ -133,6 +133,7 @@ def main(args=sys.argv[1:]): device_name=args.device_name, no_conditioned_profile=args.no_conditioned_profile, disable_perf_tuning=args.disable_perf_tuning, + conditioned_profile_scenario=args.conditioned_profile_scenario, ) except Exception: traceback.print_exc()