From 0f4b2c6cd228ba38b298fa9a50cbc3ff1037a06f Mon Sep 17 00:00:00 2001 From: Zeid Zabaneh Date: Mon, 11 Sep 2023 16:13:45 -0400 Subject: [PATCH] fetch_configs, launchers: add Fenix nightlies support (bug 1556042) WORK IN PROGRESS, DO NOT MERGE --- mozregression/.launchers.py.swo | Bin 0 -> 36864 bytes mozregression/cli.py | 33 ++++++++++++++++++++--- mozregression/fetch_configs.py | 45 ++++++++++++++++++++++++++++++++ mozregression/launchers.py | 37 +++++++++++++++++++++++++- tests/unit/test_launchers.py | 22 +++++++++++++--- 5 files changed, 129 insertions(+), 8 deletions(-) create mode 100644 mozregression/.launchers.py.swo diff --git a/mozregression/.launchers.py.swo b/mozregression/.launchers.py.swo new file mode 100644 index 0000000000000000000000000000000000000000..26fb5b70678c86c1b735d754b14bb3c5196adfc8 GIT binary patch literal 36864 zcmeI53y@@0dB-m=K@CDgqM~IkJ>d4>Y|ktU!mc&QvO5b)*qwD|cL}c0+tYn#rrGYk zZQt&hon2Qg^AJ%Gm5PdqqKSxTA|;jyDi}?bV2MO6Q$`^HA-*Ee+3JfUl zTS9?$^LX!7^yO&VpFgqRM|FKa$^LzX{r=Og_s4g=f2iyI3HI+f`+dHxz}0iCeLiKs z-_`a0IQ#r``~AbN_s7`ho9y?~ZHHX>_VM6rK!E`T1{4@jU_gNZ1qKutP+&lT0R;vW z7*Jq9f&Z5jDB2f%G00xd8LUIw;<39t^F1&#)fJoc7o>s58QR4=Uofxpa#wbKl~lf`!x6zcn7!%Tmeo4&j!x|KY6O>{Rj9U zxB*-PUJLeutHBju9as$>eTwHj0`36s12=)UgO`J8a1K}to)4Y`zV&3!dk=UmxDdP; z_~04fCm1fi13m{n25tl|2Seaka3_Y3w}H2UKLU$jH8>SK8GIkZ$-Urq@Fs8rcm-&J zDXxcFjB(^H@Ck4;xDm{NUEmzB7CaZ60FDRW!x-{4@Kx|} z@K@k3!5hKL!6euQ)`Qc)e=_zz1CN6H!3V(yz+1s@QTuR(3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vi2^QDQTI?Qm!KibsN)n-{(b))V{=fxzERTzb8h-s8L2IGryZ2NdrX9lETzzC$d?$ z;%*9-`xBN?9whuVC>sv;Co6H(3#&xKJpWmc34Db1A>Mx@N3!UXoM_voCewPnD8- zRVi_oMFWNqLBo?5?ql-G8@=T}&*s74no&Mc_K7PG;a?qiIX+h^>1@ep~gm8P(Ah?K!nfkms@;FkWV;BOE* z%aT-Tg~X?fh`n2F`s##`XbwvqnR#8s*$W*R9;KY_6ILodUmcU3@=S0EZj3?y30j~ZwPyhe` literal 0 HcmV?d00001 diff --git a/mozregression/cli.py b/mozregression/cli.py index 8392712df..397b47bfc 100644 --- a/mozregression/cli.py +++ b/mozregression/cli.py @@ -276,9 +276,16 @@ def create_parser(defaults): parser.add_argument( "--arch", - choices=("arm", "x86_64", "aarch64"), + choices=( + "aarch64", + "arm", + "arm64-v8a", + "armeabi-v7a", + "x86", + "x86_64", + ), default=None, - help=("Force alternate build (only applies to GVE app). Default: arm"), + help=("Force alternate build (applies to GVE and Fenix)."), ) parser.add_argument( @@ -554,12 +561,32 @@ def validate(self): """ options = self.options + arch_options = { + "gve": [ + "aarch64", + "arm", + "x86_64", + ], + "fenix": [ + "arm64-v8a", + "armeabi-v7a", + "x86", + "x86_64", + ], + } + user_defined_bits = options.bits is not None options.bits = parse_bits(options.bits or mozinfo.bits) if options.arch is not None: - if options.app != "gve": + if options.app not in ("gve", "fenix"): self.logger.warning("--arch ignored for non-GVE app.") options.arch = None + else: + if options.arch not in arch_options[options.app]: + raise MozRegressionError( + f"Invalid arch ({options.arch}) specified for app ({options.app}). " + f"Valid options are: {', '.join(arch_options[options.app])}." + ) fetch_config = create_config( options.app, mozinfo.os, options.bits, mozinfo.processor, options.arch diff --git a/mozregression/fetch_configs.py b/mozregression/fetch_configs.py index fa91b2042..e0f4cbebe 100644 --- a/mozregression/fetch_configs.py +++ b/mozregression/fetch_configs.py @@ -382,6 +382,19 @@ def get_nightly_repo_regex(self, date): return self._get_nightly_repo_regex(date, repo) +class FenixNightlyConfigMixin(NightlyConfigMixin): + nightly_base_repo_name = "fenix" + arch_regex_bits = "" + + def _get_nightly_repo(self, date): + return "fenix" + + def get_nightly_repo_regex(self, date): + repo = self.get_nightly_repo(date) + repo += self.arch_regex_bits # e.g., ".*arm64.*". + return self._get_nightly_repo_regex(date, repo) + + class IntegrationConfigMixin(metaclass=ABCMeta): """ Define the integration-related required configuration. @@ -607,6 +620,38 @@ def available_bits(self): return () +@REGISTRY.register("fenix") +class FenixConfig(CommonConfig, FenixNightlyConfigMixin): + BUILD_TYPES = ("shippable", "opt") + + def build_regex(self): + return r"fenix-.*\.apk" + + def available_bits(self): + return () + + def available_archs(self): + return [ + "arm64-v8a", + "armeabi-v7a", + "x86", + "x86_64", + ] + + def set_arch(self, arch): + CommonConfig.set_arch(self, arch) + mapping = { + "arm64-v8a": "-.+-android-arm64-v8a", + "armeabi-v7a": "-.+-android-armeabi-v7a", + "x86": "-.+-android-x86", + "x86_64": "-.+-android-x86_64", + } + self.arch_regex_bits = mapping[self.arch] + + def should_use_archive(self): + return True + + @REGISTRY.register("gve") class GeckoViewExampleConfig(CommonConfig, FennecNightlyConfigMixin, FennecIntegrationConfigMixin): BUILD_TYPES = ("shippable", "opt", "debug") diff --git a/mozregression/launchers.py b/mozregression/launchers.py index 735ade008..646506706 100644 --- a/mozregression/launchers.py +++ b/mozregression/launchers.py @@ -493,6 +493,31 @@ def _stop(self): if self.adb.exists(self.remote_profile): self.adb.rm(self.remote_profile, recursive=True) + def launch_browser( + self, + app_name, + activity, + intent="android.intent.action.VIEW", + moz_env=None, + url=None, + wait=True, + fail_if_running=True, + timeout=None, + ): + extras = {} + extras["args"] = f"-profile {self.remote_profile}" + + self.adb.launch_application( + app_name, + activity, + intent, + url=url, + extras=extras, + wait=wait, + fail_if_running=fail_if_running, + timeout=timeout, + ) + def get_app_info(self): return self.app_info @@ -504,7 +529,17 @@ def _get_package_name(self): def _launch(self): LOG.debug("Launching fennec") - self.adb.launch_fennec(self.package_name, extra_args=["-profile", self.remote_profile]) + self.launch_browser(self.package_name, "org.mozilla.gecko.BrowserApp") + + +@REGISTRY.register("fenix") +class FenixLauncher(AndroidLauncher): + def _get_package_name(self): + return "org.mozilla.fenix" + + def _launch(self): + LOG.debug("Launching fenix") + self.launch_browser(self.package_name, ".IntentReceiverActivity") @REGISTRY.register("gve") diff --git a/tests/unit/test_launchers.py b/tests/unit/test_launchers.py index 42f9fc2f5..044a4bb0d 100644 --- a/tests/unit/test_launchers.py +++ b/tests/unit/test_launchers.py @@ -371,8 +371,15 @@ def test_start_stop(self, _create_profile): self.adb.exists.assert_called_once_with(self.remote_profile_path) self.adb.rm.assert_called_once_with(self.remote_profile_path, recursive=True) self.adb.push.assert_called_once_with(self.profile.profile, self.remote_profile_path) - self.adb.launch_fennec.assert_called_once_with( - "org.mozilla.fennec", extra_args=["-profile", self.remote_profile_path] + self.adb.launch_application.assert_called_once_with( + "org.mozilla.fennec", + "org.mozilla.gecko.BrowserApp", + "android.intent.action.VIEW", + url=None, + extras={"args": f"-profile {self.remote_profile_path}"}, + wait=True, + fail_if_running=True, + timeout=None, ) # ensure get_app_info returns something self.assertIsNotNone(launcher.get_app_info()) @@ -387,8 +394,15 @@ def test_adb_calls_with_custom_package_name(self, _create_profile): launcher = self.create_launcher(version_value={"package_name": pkg_name}) self.adb.uninstall_app.assert_called_once_with(pkg_name) launcher.start(profile="my_profile") - self.adb.launch_fennec.assert_called_once_with( - pkg_name, extra_args=["-profile", self.remote_profile_path] + self.adb.launch_application.assert_called_once_with( + pkg_name, + "org.mozilla.gecko.BrowserApp", + "android.intent.action.VIEW", + url=None, + extras={"args": f"-profile {self.remote_profile_path}"}, + wait=True, + fail_if_running=True, + timeout=None, ) launcher.stop() self.adb.stop_application.assert_called_once_with(pkg_name)