]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
tests: Drop tools tree related options 3091/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 2 Oct 2024 10:16:23 +0000 (12:16 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 2 Oct 2024 16:29:37 +0000 (18:29 +0200)
Let's not build the tools tree as part of running the tests anymore.
Instead, let's just build it manually up front.

.github/workflows/ci.yml
.gitignore
mkosi.conf.d/15-x86-64.conf
tests/__init__.py
tests/conftest.py
tests/test_boot.py

index 4acf226b8bce98b04fa41d88b3fee4c06746292f..ecdd7955ccdde0876540f961fa957bd6e9689941 100644 (file)
@@ -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/
index 6d489f55e15a5c5d213be75c84badabcd12f5dc8..b6e54df8a2066b81e08ce928a965d62ad6641615 100644 (file)
@@ -22,6 +22,7 @@
 /mkosi.rootpw
 mkosi.local
 mkosi.local.conf
+mkosi.tools
 /mkosi.key
 /mkosi.crt
 __pycache__
index c71669238bfc4c11cae90d4cbbb5b14bd4a41afc..929fdb8376453698f7bd1cce87fe969030aa22f3 100644 (file)
@@ -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
index c536be85db961c397e93689c55e7869bed3ff49e..7a7ab89c5a9e2aa76b399f2cedce32b526843792 100644 (file)
@@ -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",
index 19162e796f7125d5a6d4b85ad6288d2ad8690c7a..86e5a5ba019d893c3b2006d8e32667a048b70082 100644 (file)
@@ -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"),
     )
 
index 7e660ad94d38bb7d9d3e0a8cecaf820d740246a1..54cddd1ee3ba5639e7843f0d592599effcc39b47 100644 (file)
@@ -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: