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

chore: mark gnome-extension experimental for core24 #4736

Merged
merged 2 commits into from
Apr 16, 2024
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
5 changes: 5 additions & 0 deletions snapcraft/extensions/gnome.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ def get_supported_confinement() -> Tuple[str, ...]:
@staticmethod
@overrides
def is_experimental(base: Optional[str]) -> bool:
# core24 is experimental until streamlined graphics support is finalized
# see https://forum.snapcraft.io/t/39718
if base == "core24":
return True

return False

@overrides
Expand Down
6 changes: 6 additions & 0 deletions snapcraft/services/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ def setup(self) -> None:
self.environment["SNAPCRAFT_BUILD_INFO"] = build_info
if image_info := os.getenv("SNAPCRAFT_IMAGE_INFO"):
self.environment["SNAPCRAFT_IMAGE_INFO"] = image_info
if experimental_extensions := os.getenv(
"SNAPCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS"
):
self.environment["SNAPCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS"] = (
experimental_extensions
)
2 changes: 2 additions & 0 deletions tests/spread/core24/linters-pack/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ environment:
SNAP/library_ignored_mixed: library-ignored-mixed
SNAP/library_missing: library-missing
SNAP/library_unused: library-unused
# gnome-extension core24 is experimental
SNAPCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS: "1"

restore: |
cd "${SNAP}"
Expand Down
12 changes: 9 additions & 3 deletions tests/unit/extensions/test_gnome.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,15 @@ def test_get_supported_confinement():
assert gnome.GNOME.get_supported_confinement() == ("strict", "devmode")


@pytest.mark.parametrize("base", ["core22", "core24"])
def test_is_experimental(base):
assert gnome.GNOME.is_experimental(base=base) is False
@pytest.mark.parametrize(
("base", "is_experimental"),
[
("core22", False),
("core24", True),
],
)
def test_is_experimental(base, is_experimental):
assert gnome.GNOME.is_experimental(base=base) is is_experimental


def test_get_app_snippet(gnome_extension):
Expand Down
5 changes: 5 additions & 0 deletions tests/unit/services/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
def test_provider(provider_service, monkeypatch):
monkeypatch.setenv("SNAPCRAFT_BUILD_INFO", "foo")
monkeypatch.setenv("SNAPCRAFT_IMAGE_INFO", "bar")
monkeypatch.setenv("SNAPCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS", "baz")
provider_service.setup()
assert provider_service.environment["SNAPCRAFT_BUILD_INFO"] == "foo"
assert provider_service.environment["SNAPCRAFT_IMAGE_INFO"] == "bar"
assert (
provider_service.environment["SNAPCRAFT_ENABLE_EXPERIMENTAL_EXTENSIONS"]
== "baz"
)
Loading