Skip to content

Commit

Permalink
chore: mark gnome-extension experimental for core24 (#4736)
Browse files Browse the repository at this point in the history
gnome-extension will be experimental in core24 until support for
streamlined graphics support is finalized.

See https://forum.snapcraft.io/t/39718

Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
  • Loading branch information
mr-cal committed Apr 16, 2024
1 parent 49ae242 commit 9ba9615
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
5 changes: 5 additions & 0 deletions snapcraft/extensions/gnome.py
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
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
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
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
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"
)

0 comments on commit 9ba9615

Please sign in to comment.