Skip to content

Commit

Permalink
ci: Use mkosi sandbox to run the integration tests
Browse files Browse the repository at this point in the history
Using mkosi sandbox allows all the tools for the test logic themselves
to be executed from the tools tree as well.
  • Loading branch information
DaanDeMeyer committed Jan 22, 2025
1 parent 60dd86d commit 499a1f6
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 16 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ jobs:
- name: Install
run: |
sudo apt-get update
sudo apt-get install python3-pytest lvm2 cryptsetup-bin btrfs-progs sqop
# Make sure the latest changes from the pull request are used.
sudo ln -svf $PWD/bin/mkosi /usr/bin/mkosi
mkdir -p $HOME/.local/bin
ln -svf $PWD/bin/mkosi $HOME/.local/bin/mkosi
working-directory: ./

- name: Configure
Expand All @@ -171,6 +171,8 @@ jobs:
KernelCommandLine=systemd.default_device_timeout_sec=180
[Build]
ToolsTree=default
ToolsTreeDistribution=${{ matrix.tools }}
Environment=SYSTEMD_REPART_MKFS_OPTIONS_EROFS="--quiet"
[Runtime]
Expand Down Expand Up @@ -205,22 +207,20 @@ jobs:
done
- name: Build tools tree
run: |
mkosi \
--directory "" \
--distribution ${{ matrix.tools }} \
--include mkosi-tools
run: sudo --preserve-env=PATH mkosi -f sandbox true

- name: Build image
run: mkosi --distribution ${{ matrix.distro }} -f
run: sudo --preserve-env=PATH mkosi --distribution ${{ matrix.distro }} -f

- name: Run integration tests
run: |
sudo --preserve-env \
timeout -k 30 1h python3 -m pytest \
--tb=no \
--capture=no \
--verbose \
-m integration \
--distribution ${{ matrix.distro }} \
tests/
sudo --preserve-env=PATH \
mkosi sandbox \
timeout -k 30 1h \
python3 -m pytest \
--tb=no \
--capture=no \
--verbose \
-m integration \
--distribution ${{ matrix.distro }} \
tests/
5 changes: 5 additions & 0 deletions mkosi.conf.d/40-tools/mkosi.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-License-Identifier: LGPL-2.1-or-later

[Build]
ToolsTreePackages=
lvm2
2 changes: 2 additions & 0 deletions mkosi.conf.d/40-tools/mkosi.conf.d/arch.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ToolsTreeDistribution=arch

[Build]
ToolsTreePackages=
cryptsetup
mypy
python-pytest
ruff
sequoia-sop
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ ToolsTreeDistribution=|fedora

[Build]
ToolsTreePackages=
crypsetup
python3-mypy
python3-pytest
3 changes: 3 additions & 0 deletions mkosi.conf.d/40-tools/mkosi.conf.d/debian-kali-ubuntu.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ ToolsTreeDistribution=|ubuntu

[Build]
ToolsTreePackages=
cryptsetup-bin
fdisk
mypy
python3-pytest
sqop
1 change: 1 addition & 0 deletions mkosi.conf.d/40-tools/mkosi.conf.d/fedora.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ ToolsTreeDistribution=fedora
[Build]
ToolsTreePackages=
ruff
sequoia-sop
1 change: 1 addition & 0 deletions mkosi.conf.d/40-tools/mkosi.conf.d/opensuse.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ToolsTreeDistribution=opensuse

[Build]
ToolsTreePackages=
cryptsetup
grub2 # TODO: Move to default tools tree when https://bugzilla.opensuse.org/show_bug.cgi?id=1227464 is resolved.
mypy
python3-pytest
Expand Down

0 comments on commit 499a1f6

Please sign in to comment.