From bac174a6c68c9155ee404d0adec809b327d6c92d Mon Sep 17 00:00:00 2001 From: Jarred Wilson Date: Thu, 20 Jul 2023 13:32:32 -0400 Subject: [PATCH] Add QT extension --- .../desktop/command-chain/desktop-launch | 2 +- .../command-chain/hooks-configure-fonts | 2 +- schema/snapcraft.json | 2 + snapcraft/extensions/_utils.py | 5 +- snapcraft/extensions/extension.py | 3 +- snapcraft/extensions/qt_framework.py | 227 ++++++++++++++++ snapcraft/extensions/registry.py | 3 + tests/legacy/unit/meta/test_meta.py | 2 +- tests/unit/commands/test_list_extensions.py | 4 + tests/unit/extensions/test_gnome.py | 9 +- tests/unit/extensions/test_kde_neon.py | 9 +- tests/unit/extensions/test_qt_framework.py | 249 ++++++++++++++++++ tests/unit/extensions/test_registry.py | 2 + .../unit/parts/extensions/test_ros2_humble.py | 5 +- .../parts/extensions/test_ros2_humble_meta.py | 6 +- 15 files changed, 520 insertions(+), 10 deletions(-) create mode 100644 snapcraft/extensions/qt_framework.py create mode 100644 tests/unit/extensions/test_qt_framework.py diff --git a/extensions/desktop/command-chain/desktop-launch b/extensions/desktop/command-chain/desktop-launch index f8b3a9cc83a..3843fa6a644 100644 --- a/extensions/desktop/command-chain/desktop-launch +++ b/extensions/desktop/command-chain/desktop-launch @@ -1,5 +1,5 @@ #!/bin/bash -set -- "${SNAP}/gnome-platform/command-chain/desktop-launch" "$@" +set -- "${SNAP_DESKTOP_RUNTIME}/command-chain/desktop-launch" "$@" # shellcheck source=/dev/null source "${SNAP}/snap/command-chain/run" diff --git a/extensions/desktop/command-chain/hooks-configure-fonts b/extensions/desktop/command-chain/hooks-configure-fonts index b6a2f1d3c62..19c5fb67c4f 100644 --- a/extensions/desktop/command-chain/hooks-configure-fonts +++ b/extensions/desktop/command-chain/hooks-configure-fonts @@ -1,5 +1,5 @@ #!/bin/bash -set -- "${SNAP}/gnome-platform/command-chain/hooks-configure-fonts" "$@" +set -- "${SNAP_DESKTOP_RUNTIME}/command-chain/hooks-configure-desktop" "$@" # shellcheck source=/dev/null source "${SNAP}/snap/command-chain/run" diff --git a/schema/snapcraft.json b/schema/snapcraft.json index 3cc20cbaf39..3457ee1bb8b 100644 --- a/schema/snapcraft.json +++ b/schema/snapcraft.json @@ -914,6 +914,8 @@ "gnome-3-34", "gnome-3-38", "kde-neon", + "qt5-15", + "qt6-5", "ros1-noetic", "ros1-noetic-desktop", "ros1-noetic-perception", diff --git a/snapcraft/extensions/_utils.py b/snapcraft/extensions/_utils.py index 3aa885be353..c5b3ba33101 100644 --- a/snapcraft/extensions/_utils.py +++ b/snapcraft/extensions/_utils.py @@ -59,7 +59,10 @@ def apply_extensions( for extension_name in sorted(declared_extensions.keys()): extension_class = get_extension_class(extension_name) extension = extension_class( - yaml_data=copy.deepcopy(yaml_data), arch=arch, target_arch=target_arch + name=extension_name, + yaml_data=copy.deepcopy(yaml_data), + arch=arch, + target_arch=target_arch, ) extension.validate(extension_name=extension_name) _apply_extension(yaml_data, declared_extensions[extension_name], extension) diff --git a/snapcraft/extensions/extension.py b/snapcraft/extensions/extension.py index 52cdfd902e1..6a2f5a54cb5 100644 --- a/snapcraft/extensions/extension.py +++ b/snapcraft/extensions/extension.py @@ -39,9 +39,10 @@ class Extension(abc.ABC): """ def __init__( - self, *, yaml_data: Dict[str, Any], arch: str, target_arch: str + self, *, name: str, yaml_data: Dict[str, Any], arch: str, target_arch: str ) -> None: """Create a new Extension.""" + self.name = name self.yaml_data = yaml_data self.arch = arch self.target_arch = target_arch diff --git a/snapcraft/extensions/qt_framework.py b/snapcraft/extensions/qt_framework.py new file mode 100644 index 00000000000..a39cc88755d --- /dev/null +++ b/snapcraft/extensions/qt_framework.py @@ -0,0 +1,227 @@ +# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- +# +# Copyright 2022 Canonical Ltd. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 3 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +"""Generic QT Framework extension to support core22 and onwards.""" +import dataclasses +import functools +from typing import Any, Dict, List, Optional, Tuple + +from overrides import overrides + +from .extension import Extension, get_extensions_data_dir, prepend_to_env + +_SDK_SNAP = {"core22": "qt-framework-sdk"} + +_CONTENT_SNAP = { + "qt6-5": {"core22": "qt-framework-6-5-core22"}, + "qt5-15": {"core22": "qt-framework-5-15-core22"}, +} + + +@dataclasses.dataclass +class ExtensionInfo: + """Content/SDK build information.""" + + cmake_args: list + + +@dataclasses.dataclass +class QTSnaps: + """A structure of QT related snaps.""" + + sdk: dict + content: str + builtin: bool = True + + +class QTFramework(Extension): + r"""The QT Framework extension. + + This extension makes it easy to assemble QT based applications. + + It configures each application with the following plugs: + + \b + - Common Icon Themes. + - Common Sound Themes. + - The QT Frameworks runtime libraries and utilities. + + For easier desktop integration, it also configures each application + entry with these additional plugs: + + \b + - desktop (https://snapcraft.io/docs/desktop-interface) + - desktop-legacy (https://snapcraft.io/docs/desktop-legacy-interface) + - opengl (https://snapcraft.io/docs/opengl-interface) + - wayland (https://snapcraft.io/docs/wayland-interface) + - x11 (https://snapcraft.io/docs/x11-interface) + """ + + @staticmethod + @overrides + def get_supported_bases() -> Tuple[str, ...]: + return ("core22",) + + @staticmethod + @overrides + def get_supported_confinement() -> Tuple[str, ...]: + return "strict", "devmode" + + @staticmethod + @overrides + def is_experimental(base: Optional[str]) -> bool: + return False + + @overrides + def get_app_snippet(self) -> Dict[str, Any]: + return { + "command-chain": ["snap/command-chain/desktop-launch"], + "plugs": ["desktop", "desktop-legacy", "opengl", "wayland", "x11"], + "environment": { + "QT_PLUGIN_PATH": "$SNAP/qt-framework/usr/plugins:$SNAP/usr/lib/plugins", + }, + } + + @functools.cached_property + def qt_snaps(self) -> QTSnaps: + """Return the QT related snaps to use to construct the environment.""" + base = self.yaml_data["base"] + sdk_snap = _SDK_SNAP[base] + sdk_channel = f"{self.name[2:].replace('-','.')}/stable" + + build_snaps: List[str] = [] + for part in self.yaml_data["parts"].values(): + build_snaps.extend(part.get("build-snaps", [])) + + builtin = True + + for snap in build_snaps: + if sdk_snap == snap.split("/")[0]: + try: + sdk_channel = snap.split("/", 1)[1] + except IndexError: + pass + builtin = False + break + + sdk = {"snap": sdk_snap, "channel": sdk_channel} + + # The same except the trailing -sd + content = _CONTENT_SNAP[self.name][base] + + return QTSnaps(sdk=sdk, content=content, builtin=builtin) + + @functools.cached_property + def ext_info(self) -> ExtensionInfo: + """Return the extension info cmake_args, provider, content, build_snaps.""" + cmake_args = [ + f"-DCMAKE_FIND_ROOT_PATH=/snap/{self.qt_snaps.sdk['snap']}/current", + f"-DCMAKE_PREFIX_PATH=/snap/{self.qt_snaps.sdk['snap']}/current/usr", + "-DZLIB_INCLUDE_DIR=/lib/x86_64-linux-gnu", + ] + + return ExtensionInfo(cmake_args=cmake_args) + + @overrides + def get_root_snippet(self) -> Dict[str, Any]: + return { + "assumes": ["snapd2.43"], # for 'snapctl is-connected' + "compression": "lzo", + "plugs": { + "desktop": {"mount-host-font-cache": False}, + "icon-themes": { + "interface": "content", + "target": "$SNAP/data-dir/icons", + "default-provider": "gtk-common-themes", + }, + "sound-themes": { + "interface": "content", + "target": "$SNAP/data-dir/sounds", + "default-provider": "gtk-common-themes", + }, + "qt-framework": { + "interface": "content", + "default-provider": self.qt_snaps.content, + "target": "$SNAP/qt-framework", + }, + }, + "environment": {"SNAP_DESKTOP_RUNTIME": "$SNAP/qt-framework"}, + "hooks": { + "configure": { + "plugs": ["desktop"], + "command-chain": ["snap/command-chain/hooks-configure-fonts"], + } + }, + "layout": { + "/usr/share/X11": {"symlink": "$SNAP/qt-framework/usr/share/X11"} + }, + } + + @overrides + def get_part_snippet(self, *, plugin_name: str) -> Dict[str, Any]: + sdk_snap = self.qt_snaps.sdk["snap"] + cmake_args = self.ext_info.cmake_args + + return { + "build-environment": [ + { + "PATH": prepend_to_env( + "PATH", [f"/snap/{sdk_snap}/current/usr/bin"] + ), + }, + { + "XDG_DATA_DIRS": prepend_to_env( + "XDG_DATA_DIRS", + [ + f"$CRAFT_STAGE/usr/share:/snap/{sdk_snap}/current/usr/share", + "/usr/share", + ], + ), + }, + { + "SNAPCRAFT_CMAKE_ARGS": prepend_to_env( + "SNAPCRAFT_CMAKE_ARGS", cmake_args + ), + }, + ], + "build-packages": [ + "libgl1-mesa-dev", + ], + } + + @overrides + def get_parts_snippet(self) -> Dict[str, Any]: + source = get_extensions_data_dir() / "desktop" / "command-chain" + sdk_snap = self.qt_snaps.sdk["snap"] + sdk_channel = self.qt_snaps.sdk["channel"] + + if self.qt_snaps.builtin: + return { + f"{self.name}/sdk": { + "source": str(source), + "plugin": "make", + "make-parameters": ["PLATFORM_PLUG=qt-framework"], + "build-snaps": [f"{sdk_snap}/{sdk_channel}"], + }, + } + + return { + f"{self.name}/sdk": { + "source": str(source), + "plugin": "make", + "make-parameters": ["PLATFORM_PLUG=qt-framework"], + }, + } diff --git a/snapcraft/extensions/registry.py b/snapcraft/extensions/registry.py index ae5d69f4636..a580d5022b5 100644 --- a/snapcraft/extensions/registry.py +++ b/snapcraft/extensions/registry.py @@ -22,6 +22,7 @@ from .gnome import GNOME from .kde_neon import KDENeon +from .qt_framework import QTFramework from .ros2_humble import ROS2HumbleExtension from .ros2_humble_desktop import ROS2HumbleDesktopExtension from .ros2_humble_ros_base import ROS2HumbleRosBaseExtension @@ -39,6 +40,8 @@ "ros2-humble-ros-base": ROS2HumbleRosBaseExtension, "ros2-humble-desktop": ROS2HumbleDesktopExtension, "kde-neon": KDENeon, + "qt6-5": QTFramework, + "qt5-15": QTFramework, } diff --git a/tests/legacy/unit/meta/test_meta.py b/tests/legacy/unit/meta/test_meta.py index bf4735e4c7f..97fe12a5f14 100644 --- a/tests/legacy/unit/meta/test_meta.py +++ b/tests/legacy/unit/meta/test_meta.py @@ -1575,7 +1575,7 @@ def make_snapcraft_project(self, common_id): source: . plugin: dump parse-info: ["1.metainfo.xml", "2.metainfo.xml"] - + """ ) diff --git a/tests/unit/commands/test_list_extensions.py b/tests/unit/commands/test_list_extensions.py index 3ea15367960..d1de322481a 100644 --- a/tests/unit/commands/test_list_extensions.py +++ b/tests/unit/commands/test_list_extensions.py @@ -42,6 +42,8 @@ def test_command(emitter, command): gnome-3-34 core18 gnome-3-38 core20 kde-neon core18, core20, core22 + qt5-15 core22 + qt6-5 core22 ros1-noetic core20 ros1-noetic-desktop core20 ros1-noetic-perception core20 @@ -79,6 +81,8 @@ def test_command_extension_dups(emitter, command): gnome-3-34 core18 gnome-3-38 core20 kde-neon core18, core20, core22 + qt5-15 core22 + qt6-5 core22 ros1-noetic core20 ros1-noetic-desktop core20 ros1-noetic-perception core20 diff --git a/tests/unit/extensions/test_gnome.py b/tests/unit/extensions/test_gnome.py index 2e60b752221..083c5aaddf6 100644 --- a/tests/unit/extensions/test_gnome.py +++ b/tests/unit/extensions/test_gnome.py @@ -19,6 +19,8 @@ from snapcraft.extensions import gnome from snapcraft.extensions.extension import get_extensions_data_dir +_EXTENSION_NAME = "gnome" + ############ # Fixtures # ############ @@ -27,13 +29,17 @@ @pytest.fixture def gnome_extension(): return gnome.GNOME( - yaml_data={"base": "core22", "parts": {}}, arch="amd64", target_arch="amd64" + name=_EXTENSION_NAME, + yaml_data={"base": "core22", "parts": {}}, + arch="amd64", + target_arch="amd64", ) @pytest.fixture def gnome_extension_with_build_snap(): return gnome.GNOME( + name=_EXTENSION_NAME, yaml_data={ "base": "core22", "parts": {"part1": {"build-snaps": ["gnome-44-2204-sdk"]}}, @@ -46,6 +52,7 @@ def gnome_extension_with_build_snap(): @pytest.fixture def gnome_extension_with_default_build_snap_from_latest_edge(): return gnome.GNOME( + name=_EXTENSION_NAME, yaml_data={ "base": "core22", "parts": {"part1": {"build-snaps": ["gnome-42-2204-sdk/latest/edge"]}}, diff --git a/tests/unit/extensions/test_kde_neon.py b/tests/unit/extensions/test_kde_neon.py index e7fb8c14aa0..063a70762d9 100644 --- a/tests/unit/extensions/test_kde_neon.py +++ b/tests/unit/extensions/test_kde_neon.py @@ -19,6 +19,8 @@ from snapcraft.extensions import kde_neon from snapcraft.extensions.extension import get_extensions_data_dir +_EXTENSION_NAME = "kde-neon" + ############ # Fixtures # ############ @@ -27,13 +29,17 @@ @pytest.fixture def kde_neon_extension(): return kde_neon.KDENeon( - yaml_data={"base": "core22", "parts": {}}, arch="amd64", target_arch="amd64" + name=_EXTENSION_NAME, + yaml_data={"base": "core22", "parts": {}}, + arch="amd64", + target_arch="amd64", ) @pytest.fixture def kde_neon_extension_with_build_snap(): return kde_neon.KDENeon( + name=_EXTENSION_NAME, yaml_data={ "base": "core22", "parts": { @@ -50,6 +56,7 @@ def kde_neon_extension_with_build_snap(): @pytest.fixture def kde_neon_extension_with_default_build_snap_from_latest_edge(): return kde_neon.KDENeon( + name=_EXTENSION_NAME, yaml_data={ "base": "core22", "parts": { diff --git a/tests/unit/extensions/test_qt_framework.py b/tests/unit/extensions/test_qt_framework.py new file mode 100644 index 00000000000..596a3b84d51 --- /dev/null +++ b/tests/unit/extensions/test_qt_framework.py @@ -0,0 +1,249 @@ +# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- +# +# Copyright 2023 Canonical Ltd. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 3 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import pytest + +from snapcraft.extensions import qt_framework +from snapcraft.extensions.extension import get_extensions_data_dir + +_EXTENSION_NAME = "qt6-5" + +############ +# Fixtures # +############ + + +@pytest.fixture +def qt_framework_extension(): + return qt_framework.QTFramework( + name=_EXTENSION_NAME, + yaml_data={"base": "core22", "parts": {}}, + arch="amd64", + target_arch="amd64", + ) + + +@pytest.fixture +def qt_framework_extension_with_build_snap(): + return qt_framework.QTFramework( + name=_EXTENSION_NAME, + yaml_data={ + "base": "core22", + "parts": {"part1": {"build-snaps": ["qt-framework-sdk/6.5/stable"]}}, + }, + arch="amd64", + target_arch="amd64", + ) + + +@pytest.fixture +def qt_framework_extension_with_default_build_snap_from_latest_edge(): + return qt_framework.QTFramework( + name=_EXTENSION_NAME, + yaml_data={ + "base": "core22", + "parts": {"part1": {"build-snaps": ["qt-framework-sdk/6.5/edge"]}}, + }, + arch="amd64", + target_arch="amd64", + ) + + +################### +# QTFramework Extension # +################### + + +def test_get_supported_bases(qt_framework_extension): + assert qt_framework_extension.get_supported_bases() == ("core22",) + + +def test_get_supported_confinement(qt_framework_extension): + assert qt_framework_extension.get_supported_confinement() == ("strict", "devmode") + + +def test_is_experimental(): + assert qt_framework.QTFramework.is_experimental(base="core22") is False + + +def test_get_app_snippet(qt_framework_extension): + assert qt_framework_extension.get_app_snippet() == { + "command-chain": ["snap/command-chain/desktop-launch"], + "plugs": ["desktop", "desktop-legacy", "opengl", "wayland", "x11"], + "environment": { + "QT_PLUGIN_PATH": "$SNAP/qt-framework/usr/plugins:$SNAP/usr/lib/plugins", + }, + } + + +def test_get_root_snippet(qt_framework_extension): + assert qt_framework_extension.get_root_snippet() == { + "assumes": ["snapd2.43"], + "compression": "lzo", + "environment": {"SNAP_DESKTOP_RUNTIME": "$SNAP/qt-framework"}, + "hooks": { + "configure": { + "plugs": ["desktop"], + "command-chain": ["snap/command-chain/hooks-configure-fonts"], + } + }, + "layout": {"/usr/share/X11": {"symlink": "$SNAP/qt-framework/usr/share/X11"}}, + "plugs": { + "desktop": {"mount-host-font-cache": False}, + "icon-themes": { + "interface": "content", + "target": "$SNAP/data-dir/icons", + "default-provider": "gtk-common-themes", + }, + "sound-themes": { + "interface": "content", + "target": "$SNAP/data-dir/sounds", + "default-provider": "gtk-common-themes", + }, + "qt-framework": { + "interface": "content", + "default-provider": "qt-framework-6-5-core22", + "target": "$SNAP/qt-framework", + }, + }, + } + + +def test_get_root_snippet_with_external_sdk(qt_framework_extension_with_build_snap): + assert qt_framework_extension_with_build_snap.get_root_snippet() == { + "assumes": ["snapd2.43"], + "compression": "lzo", + "environment": {"SNAP_DESKTOP_RUNTIME": "$SNAP/qt-framework"}, + "hooks": { + "configure": { + "plugs": ["desktop"], + "command-chain": ["snap/command-chain/hooks-configure-fonts"], + } + }, + "layout": {"/usr/share/X11": {"symlink": "$SNAP/qt-framework/usr/share/X11"}}, + "plugs": { + "desktop": {"mount-host-font-cache": False}, + "icon-themes": { + "interface": "content", + "target": "$SNAP/data-dir/icons", + "default-provider": "gtk-common-themes", + }, + "sound-themes": { + "interface": "content", + "target": "$SNAP/data-dir/sounds", + "default-provider": "gtk-common-themes", + }, + "qt-framework": { + "interface": "content", + "default-provider": "qt-framework-6-5-core22", + "target": "$SNAP/qt-framework", + }, + }, + } + + +class TestGetPartSnippet: + """Tests for QTFramework.get_part_snippet when using the default sdk snap name.""" + + def test_get_part_snippet(self, qt_framework_extension): + self.assert_get_part_snippet(qt_framework_extension) + + def test_get_part_snippet_latest_edge( + self, qt_framework_extension_with_default_build_snap_from_latest_edge + ): + self.assert_get_part_snippet( + qt_framework_extension_with_default_build_snap_from_latest_edge + ) + + @staticmethod + def assert_get_part_snippet(qt_framework_instance): + assert qt_framework_instance.get_part_snippet(plugin_name="cmake") == { + "build-environment": [ + {"PATH": "/snap/qt-framework-sdk/current/usr/bin${PATH:+:$PATH}"}, + { + "XDG_DATA_DIRS": "$CRAFT_STAGE/usr/share:" + "/snap/qt-framework-sdk/current/usr/share:" + "/usr/share${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}" + }, + { + "SNAPCRAFT_CMAKE_ARGS": "-DCMAKE_FIND_ROOT_PATH=/snap/qt-framework-sdk/current:" + "-DCMAKE_PREFIX_PATH=/snap/qt-framework-sdk/current/usr:" + "-DZLIB_INCLUDE_DIR=/lib/x86_64-linux-gnu" + "${SNAPCRAFT_CMAKE_ARGS:+:$SNAPCRAFT_CMAKE_ARGS}" + }, + ], + "build-packages": ["libgl1-mesa-dev"], + } + + +def test_get_part_snippet_with_external_sdk(qt_framework_extension_with_build_snap): + assert qt_framework_extension_with_build_snap.get_part_snippet( + plugin_name="cmake" + ) == { + "build-environment": [ + {"PATH": "/snap/qt-framework-sdk/current/usr/bin${PATH:+:$PATH}"}, + { + "XDG_DATA_DIRS": "$CRAFT_STAGE/usr/share:" + "/snap/qt-framework-sdk/current/usr/share:" + "/usr/share${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}" + }, + { + "SNAPCRAFT_CMAKE_ARGS": "-DCMAKE_FIND_ROOT_PATH=/snap/qt-framework-sdk/current:" + "-DCMAKE_PREFIX_PATH=/snap/qt-framework-sdk/current/usr:" + "-DZLIB_INCLUDE_DIR=/lib/x86_64-linux-gnu" + "${SNAPCRAFT_CMAKE_ARGS:+:$SNAPCRAFT_CMAKE_ARGS}" + }, + ], + "build-packages": ["libgl1-mesa-dev"], + } + + +def test_get_parts_snippet(qt_framework_extension): + source = get_extensions_data_dir() / "desktop" / "command-chain" + + assert qt_framework_extension.get_parts_snippet() == { + "qt6-5/sdk": { + "source": str(source), + "plugin": "make", + "make-parameters": ["PLATFORM_PLUG=qt-framework"], + "build-snaps": ["qt-framework-sdk/6.5/stable"], + } + } + + +def test_get_parts_snippet_with_external_sdk(qt_framework_extension_with_build_snap): + source = get_extensions_data_dir() / "desktop" / "command-chain" + + assert qt_framework_extension_with_build_snap.get_parts_snippet() == { + "qt6-5/sdk": { + "source": str(source), + "plugin": "make", + "make-parameters": ["PLATFORM_PLUG=qt-framework"], + } + } + + +def test_get_parts_snippet_with_external_sdk_different_channel( + qt_framework_extension_with_default_build_snap_from_latest_edge, +): + source = get_extensions_data_dir() / "desktop" / "command-chain" + assert qt_framework_extension_with_default_build_snap_from_latest_edge.get_parts_snippet() == { + "qt6-5/sdk": { + "source": str(source), + "plugin": "make", + "make-parameters": ["PLATFORM_PLUG=qt-framework"], + } + } diff --git a/tests/unit/extensions/test_registry.py b/tests/unit/extensions/test_registry.py index 1e3c5385db5..9ab4c6c606f 100644 --- a/tests/unit/extensions/test_registry.py +++ b/tests/unit/extensions/test_registry.py @@ -30,6 +30,8 @@ def test_get_extension_names(): "ros2-humble-ros-base", "ros2-humble-desktop", "kde-neon", + "qt6-5", + "qt5-15", "fake-extension-experimental", "fake-extension-extra", "fake-extension", diff --git a/tests/unit/parts/extensions/test_ros2_humble.py b/tests/unit/parts/extensions/test_ros2_humble.py index 53ad5b921b9..03e9a4d877c 100644 --- a/tests/unit/parts/extensions/test_ros2_humble.py +++ b/tests/unit/parts/extensions/test_ros2_humble.py @@ -35,7 +35,10 @@ def _setup_method_fixture(yaml_data=None, arch=None, target_arch=None): target_arch = "amd64" return ROS2HumbleExtension( - yaml_data=yaml_data, arch=arch, target_arch=target_arch + name=_EXTENSION_NAME, + yaml_data=yaml_data, + arch=arch, + target_arch=target_arch, ) yield _setup_method_fixture diff --git a/tests/unit/parts/extensions/test_ros2_humble_meta.py b/tests/unit/parts/extensions/test_ros2_humble_meta.py index 39b5e4827e4..884c1ee380f 100644 --- a/tests/unit/parts/extensions/test_ros2_humble_meta.py +++ b/tests/unit/parts/extensions/test_ros2_humble_meta.py @@ -24,8 +24,10 @@ from snapcraft.extensions.ros2_humble_ros_core import ROS2HumbleRosCoreExtension -def setup_method_fixture(extension, yaml_data=None, arch=None, target_arch=None): - return extension(yaml_data=yaml_data, arch=arch, target_arch=target_arch) +def setup_method_fixture( + extension, name=None, yaml_data=None, arch=None, target_arch=None +): + return extension(name=name, yaml_data=yaml_data, arch=arch, target_arch=target_arch) class TestExtensionROS2HumbleMetaExtensions: