From 75ace9fd84a1bd0ae25774d581276e77477b9ccd Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 20 Feb 2025 10:31:02 +0100 Subject: [PATCH 1/2] docs: Document how to run the unit tests in HACKING.md --- docs/HACKING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/HACKING.md b/docs/HACKING.md index fab5ae07b9..431c1eb4af 100644 --- a/docs/HACKING.md +++ b/docs/HACKING.md @@ -36,12 +36,13 @@ or via your distribution's package manager. Note that systemd regularly adopts newer mkosi features that are not in an official release yet so there's a good chance that your distribution's packaged version of mkosi will be too old. -Then, you can build and run systemd executables as follows: +Then, you can build, run and test systemd executables as follows: ```sh $ mkosi -f sandbox -- meson setup build $ mkosi -f sandbox -- meson compile -C build $ mkosi -f sandbox -- build/systemctl --version +$ mkosi -f sandbox -- meson test -C build # Run the unit tests ``` To build and boot an OS image with the latest systemd installed: From bddfcd96298255c897982e8f21bcc09ccc88e30c Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 20 Feb 2025 10:30:16 +0100 Subject: [PATCH 2/2] mkosi: Do not run unit tests during build by default We want the incremental builds to be as fast as possible, so let's not run the unit tests locally during the image build by default. --- .github/workflows/mkosi.yml | 1 + mkosi.conf | 1 + test/fmf/integration-tests/test.sh | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index 5f14be6599..6ed7a48efa 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -161,6 +161,7 @@ jobs: UseSubvolumes=yes ToolsTreeDistribution=${{ matrix.distro }} ToolsTreeRelease=${{ matrix.release }} + WithTests=yes WorkspaceDirectory=$TMPDIR PackageCacheDirectory=$TMPDIR/cache diff --git a/mkosi.conf b/mkosi.conf index 954012ee0f..1ae273a5da 100644 --- a/mkosi.conf +++ b/mkosi.conf @@ -34,6 +34,7 @@ ToolsTree=default BuildDirectory=build/mkosi.builddir CacheDirectory=build/mkosi.cache Incremental=yes +WithTests=no [Validation] SignExpectedPcr=yes diff --git a/test/fmf/integration-tests/test.sh b/test/fmf/integration-tests/test.sh index c7aeb06998..5c9f03c960 100755 --- a/test/fmf/integration-tests/test.sh +++ b/test/fmf/integration-tests/test.sh @@ -95,6 +95,7 @@ SandboxTrees= /etc/yum.repos.d/:/etc/yum.repos.d/ /var/share/test-artifacts/:/var/share/test-artifacts/ Environment=NO_BUILD=1 +WithTests=yes EOF cat /etc/dnf/dnf.conf