diff --git a/mozregression/cli.py b/mozregression/cli.py index a48adcc6f..2c11216e0 100644 --- a/mozregression/cli.py +++ b/mozregression/cli.py @@ -285,7 +285,7 @@ def create_parser(defaults): "x86_64", ), default=None, - help=("Force alternate build (applies to GVE and Fenix)."), + help=("Force alternate build (applies to GVE, Fenix, and Focus)."), ) parser.add_argument( @@ -573,12 +573,18 @@ def validate(self): "x86", "x86_64", ], + "focus": [ + "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 not in ("gve", "fenix"): + if options.app not in ("gve", "fenix", "focus"): self.logger.warning("--arch ignored for non Android apps.") options.arch = None elif options.arch not in arch_options[options.app]: diff --git a/mozregression/fetch_configs.py b/mozregression/fetch_configs.py index a88e7ef34..f5dfe31af 100644 --- a/mozregression/fetch_configs.py +++ b/mozregression/fetch_configs.py @@ -395,6 +395,13 @@ def get_nightly_repo_regex(self, date): return self._get_nightly_repo_regex(date, repo) +class FocusNightlyConfigMixin(FenixNightlyConfigMixin): + nightly_base_repo_name = "focus" + + def _get_nightly_repo(self, date): + return "focus" + + class IntegrationConfigMixin(metaclass=ABCMeta): """ Define the integration-related required configuration. @@ -623,7 +630,7 @@ def available_bits(self): @REGISTRY.register("fenix") class FenixConfig(CommonConfig, FenixNightlyConfigMixin): def build_regex(self): - return r"fenix-.*\.apk" + return r"fenix-.+\.apk" def available_bits(self): return () @@ -651,6 +658,12 @@ def should_use_archive(self): return True +@REGISTRY.register("focus") +class FocusConfig(FenixConfig, FocusNightlyConfigMixin): + def build_regex(self): + return r"focus-.+\.apk" + + @REGISTRY.register("gve") class GeckoViewExampleConfig(CommonConfig, FennecNightlyConfigMixin, FennecIntegrationConfigMixin): BUILD_TYPES = ("shippable", "opt", "debug") diff --git a/mozregression/launchers.py b/mozregression/launchers.py index 646506706..ea0d36ed2 100644 --- a/mozregression/launchers.py +++ b/mozregression/launchers.py @@ -542,6 +542,19 @@ def _launch(self): self.launch_browser(self.package_name, ".IntentReceiverActivity") +@REGISTRY.register("focus") +class FocusLauncher(AndroidLauncher): + def _get_package_name(self): + return "org.mozilla.focus.nightly" + + def _launch(self): + LOG.debug("Launching focus") + self.launch_browser( + self.package_name, + "org.mozilla.focus.activity.IntentReceiverActivity", + ) + + @REGISTRY.register("gve") class GeckoViewExampleLauncher(AndroidLauncher): def _get_package_name(self): diff --git a/tests/unit/test_fetch_configs.py b/tests/unit/test_fetch_configs.py index 0b4595e1c..f13b53094 100644 --- a/tests/unit/test_fetch_configs.py +++ b/tests/unit/test_fetch_configs.py @@ -190,7 +190,7 @@ def test_nightly_repo_regex_before_2009_01_09(self): TestThunderbirdConfig.test_nightly_repo_regex_before_2009_01_09(self) -@pytest.mark.parametrize("app_name", ["fennec", "fenix"]) +@pytest.mark.parametrize("app_name", ["fennec", "fenix", "focus"]) class TestExtendedAndroidConfig: def test_get_nightly_repo_regex(self, app_name): if app_name == "fennec": diff --git a/tests/unit/test_launchers.py b/tests/unit/test_launchers.py index 6531d6842..3b7b82d2f 100644 --- a/tests/unit/test_launchers.py +++ b/tests/unit/test_launchers.py @@ -344,6 +344,11 @@ def test_firefox_install( [ (launchers.FennecLauncher, "org.mozilla.fennec", "org.mozilla.gecko.BrowserApp"), (launchers.FenixLauncher, "org.mozilla.fenix", ".IntentReceiverActivity"), + ( + launchers.FocusLauncher, + "org.mozilla.focus.nightly", + "org.mozilla.focus.activity.IntentReceiverActivity", + ), ], ) class TestExtendedAndroidLauncher: