Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetch_configs, launchers: add Focus nightlies support (bug 1852620) #1452

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions mozregression/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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]:
Expand Down
15 changes: 14 additions & 1 deletion mozregression/fetch_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 ()
Expand Down Expand Up @@ -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")
Expand Down
13 changes: 13 additions & 0 deletions mozregression/launchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_fetch_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
5 changes: 5 additions & 0 deletions tests/unit/test_launchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down