From: Daan De Meyer Date: Wed, 2 Oct 2024 10:16:23 +0000 (+0200) Subject: tests: Drop tools tree related options X-Git-Tag: v25~245^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3091%2Fhead;p=thirdparty%2Fmkosi.git tests: Drop tools tree related options Let's not build the tools tree as part of running the tests anymore. Instead, let's just build it manually up front. --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4acf226b8..ecdd7955c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -202,6 +202,16 @@ jobs: chmod +x "mkosi.${script}" done + - name: Build tools tree + run: | + # TODO: Remove grub2 hack when https://bugzilla.opensuse.org/show_bug.cgi?id=1227464 is resolved. + sudo --preserve-env \ + mkosi \ + --directory "" \ + --distribution ${{ matrix.tools }} \ + --include mkosi-tools \ + $( [[ ${{ matrix.tools }} == opensuse ]] && echo --package=grub2) + - name: Run integration tests run: | sudo --preserve-env \ @@ -211,5 +221,4 @@ jobs: --verbose \ -m integration \ --distribution ${{ matrix.distro }} \ - --tools-tree-distribution ${{ matrix.tools }} \ tests/ diff --git a/.gitignore b/.gitignore index 6d489f55e..b6e54df8a 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ /mkosi.rootpw mkosi.local mkosi.local.conf +mkosi.tools /mkosi.key /mkosi.crt __pycache__ diff --git a/mkosi.conf.d/15-x86-64.conf b/mkosi.conf.d/15-x86-64.conf index c71669238..929fdb837 100644 --- a/mkosi.conf.d/15-x86-64.conf +++ b/mkosi.conf.d/15-x86-64.conf @@ -2,10 +2,6 @@ [Match] Architecture=x86-64 -# We cannot install the grub tools in the OpenSUSE tools tree due to -# https://bugzilla.opensuse.org/show_bug.cgi?id=1227464. -# TODO: Remove this again when the above bug is resolved. -ToolsTreeDistribution=!opensuse [Content] BiosBootloader=grub diff --git a/tests/__init__.py b/tests/__init__.py index c536be85d..7a7ab89c5 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -24,8 +24,6 @@ from mkosi.types import _FILE, CompletedProcess, PathString class ImageConfig: distribution: Distribution release: str - tools_tree_distribution: Optional[Distribution] - tools_tree_release: Optional[str] debug_shell: bool @@ -94,13 +92,6 @@ class Image: opt: list[PathString] = [ "--distribution", str(self.config.distribution), "--release", self.config.release, - *(["--tools-tree=default"] if self.config.tools_tree_distribution else []), - *( - ["--tools-tree-distribution", str(self.config.tools_tree_distribution)] - if self.config.tools_tree_distribution - else [] - ), - *(["--tools-tree-release", self.config.tools_tree_release] if self.config.tools_tree_release else []), # noqa *(f"--kernel-command-line={i}" for i in kcl), "--force", "--incremental", diff --git a/tests/conftest.py b/tests/conftest.py index 19162e796..86e5a5ba0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -28,19 +28,6 @@ def pytest_addoption(parser: Any) -> None: metavar="RELEASE", help="Run the integration tests for the given release.", ) - parser.addoption( - "-T", - "--tools-tree-distribution", - metavar="DISTRIBUTION", - help="Use the given tools tree distribution to build the integration test images", - type=Distribution, - choices=[Distribution(d) for d in Distribution.values()], - ) - parser.addoption( - "--tools-tree-release", - metavar="RELEASE", - help="Use the given tools tree release instead of the default one", - ) parser.addoption( "--debug-shell", help="Pass --debug-shell when running mkosi", @@ -60,8 +47,6 @@ def config(request: Any) -> ImageConfig: return ImageConfig( distribution=distribution, release=release, - tools_tree_distribution=cast(Distribution, request.config.getoption("--tools-tree-distribution")), - tools_tree_release=request.config.getoption("--tools-tree-release"), debug_shell=request.config.getoption("--debug-shell"), ) diff --git a/tests/test_boot.py b/tests/test_boot.py index 7e660ad94..54cddd1ee 100644 --- a/tests/test_boot.py +++ b/tests/test_boot.py @@ -61,9 +61,7 @@ def test_format(config: ImageConfig, format: OutputFormat) -> None: if have_vmspawn() and format in (OutputFormat.disk, OutputFormat.directory): image.vmspawn() - # TODO: Remove the opensuse check again when https://bugzilla.opensuse.org/show_bug.cgi?id=1227464 is - # resolved and we install the grub tools in the openSUSE tools tree again. - if format != OutputFormat.disk or config.tools_tree_distribution == Distribution.opensuse: + if format != OutputFormat.disk: return image.qemu(["--qemu-firmware=bios"]) @@ -74,11 +72,6 @@ def test_bootloader(config: ImageConfig, bootloader: Bootloader) -> None: if config.distribution == Distribution.rhel_ubi: return - # TODO: Remove this again when https://bugzilla.opensuse.org/show_bug.cgi?id=1227464 is resolved and we - # install the grub tools in the openSUSE tools tree again. - if bootloader == Bootloader.grub and config.tools_tree_distribution == Distribution.opensuse: - return - firmware = QemuFirmware.linux if bootloader == Bootloader.none else QemuFirmware.auto with Image(config) as image: