]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Make tools tree available in tests 3109/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 7 Oct 2024 08:39:38 +0000 (10:39 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 7 Oct 2024 13:00:39 +0000 (15:00 +0200)
For use with find_binary() to check if binaries exist in the tools
tree.

tests/__init__.py
tests/conftest.py

index 7a7ab89c5a9e2aa76b399f2cedce32b526843792..419138b0073ada7530b18bc42ad38e5ab19e2174 100644 (file)
@@ -25,6 +25,7 @@ class ImageConfig:
     distribution: Distribution
     release: str
     debug_shell: bool
+    tools: Optional[Path]
 
 
 class Image:
@@ -64,6 +65,7 @@ class Image:
         return run(
             [
                 "python3", "-m", "mkosi",
+                *(["--tools-tree", os.fspath(self.config.tools)] if self.config.tools else []),
                 "--debug",
                 *options,
                 verb,
index 86e5a5ba019d893c3b2006d8e32667a048b70082..86ae99a202341fc021bbb18afd45c74065a3aa6b 100644 (file)
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 from collections.abc import Iterator
+from pathlib import Path
 from typing import Any, cast
 
 import pytest
@@ -48,6 +49,7 @@ def config(request: Any) -> ImageConfig:
         distribution=distribution,
         release=release,
         debug_shell=request.config.getoption("--debug-shell"),
+        tools=p if (p := Path("mkosi.tools")).exists() else None,
     )