1
0
mirror of https://github.com/containers/bootc.git synced 2026-02-05 06:45:13 +01:00

Rework GHA testing: Use bcvk, cover composefs with tmt

Part 1: Use bcvk

For local tests, right now testcloud+tmt doesn't support UEFI, see
https://github.com/teemtee/tmt/issues/4203

This is a blocker for us doing more testing with UKIs.

In this patch we switch to provisioning VMs with bcvk, which
fixes this - but beyond that a really compelling thing about
this is that bcvk is *also* designed to be ergonomic and efficient
beyond just being a test runner, with things like virtiofs
mounting of host container storage, etc.

In other words, bcvk is the preferred way to run local virt
with bootc, and this makes our TMT tests use it.

Now a major downside of this though is we're effectively
implementing a new "provisioner" for tmt (bypassing the
existing `virtual`). In the more medium term I think we
want to add `bcvk` as a provisioner option to tmt.

Anyways for now, this works by discovers test plans via `tmt plan ls`,
spawning a separate VM per test, and then using uses tmt's connect
provisioner to run tests targeting these externally provisioned
systems.

Part 2: Rework the Justfile and Dockerfile

This adds `base` and `variant` arguments which are propagated through
the system, and we have a new `variant` for sealed composefs.

The readonly tests now pass with composefs.

Drop the continuous repo tests...as while we could keep
that it's actually a whole *other* entry in this matrix.

Assisted-by: Claude Code (Sonnet 4.5)
Signed-off-by: Colin Walters <walters@verbum.org>
This commit is contained in:
Colin Walters
2025-11-04 09:20:56 -05:00
parent c832f6d0fc
commit f8ce015254
18 changed files with 840 additions and 209 deletions

View File

@@ -38,15 +38,6 @@ jobs:
uses: ./.github/actions/bootc-ubuntu-setup
- name: Validate (default)
run: just validate
# Build container with continuous repository enabled
container-continuous:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: Bootc Ubuntu Setup
uses: ./.github/actions/bootc-ubuntu-setup
- name: Build with continuous repo enabled
run: sudo just build --build-arg=continuous_repo=1
# Check for security vulnerabilities and license compliance
cargo-deny:
runs-on: ubuntu-24.04
@@ -141,60 +132,39 @@ jobs:
- name: Install tmt
run: pip install --user "tmt[provision-virtual]"
- name: Build container and disk image
- name: Setup env
run: |
BASE=$(just pullspec-for-os ${{ matrix.test_os }})
echo "BOOTC_base=${BASE}" >> $GITHUB_ENV
- name: Build container
run: |
set -xeuo pipefail
build_args=()
# Map from an ID-VERSIONID pair to a container ref
target=${{ matrix.test_os }}
OS_ID=$(echo "$target" | cut -d '-' -f 1)
OS_VERSION_ID=$(echo "$target" | cut -d '-' -f 2)
# Base image
case "$OS_ID" in
"centos")
BASE="quay.io/centos-bootc/centos-bootc:stream${OS_VERSION_ID}"
;;
"fedora")
BASE="quay.io/fedora/fedora-bootc:${OS_VERSION_ID}"
;;
*) echo "Unknown OS: ${OS_ID}" 1>&2; exit 1
;;
esac
build_args+=("--build-arg=base=$BASE")
just build ${build_args[@]}
just build-integration-test-image
# Cross check we're using the right base
used_vid=$(podman run --rm localhost/bootc-integration bash -c '. /usr/lib/os-release && echo $VERSION_ID')
test "$OS_VERSION_ID" = "${used_vid}"
# Extra cross-check (duplicating the integration test) that we're using the right base
used_vid=$(podman run --rm localhost/bootc-integration bash -c '. /usr/lib/os-release && echo ${ID}-${VERSION_ID}')
test ${{ matrix.test_os }} = "${used_vid}"
- name: Run container tests
run: |
just test-container
- name: Generate disk image
run: |
mkdir -p target
just build-disk-image localhost/bootc-integration target/bootc-integration-test.qcow2
- name: Workaround https://github.com/teemtee/testcloud/issues/18
run: sudo rm -f /usr/bin/chcon && sudo ln -sr /usr/bin/true /usr/bin/chcon
- name: Unit and container integration tests
run: just test-container
- name: Run all TMT tests
run: |
just test-tmt-nobuild
run: just test-tmt
- name: Archive TMT logs
if: always()
uses: actions/upload-artifact@v5
with:
name: tmt-log-PR-${{ github.event.number }}-${{ matrix.test_os }}-${{ env.ARCH }}-${{ matrix.tmt_plan }}
name: tmt-log-PR-${{ github.event.number }}-${{ matrix.test_os }}-ostree-${{ env.ARCH }}
path: /var/tmp/tmt
# This variant does composefs testing
test-integration-cfs:
strategy:
fail-fast: false
matrix:
# TODO expand this matrix, we need to make it better to override the target
# OS via Justfile variables too
test_os: [centos-10]
variant: [composefs-sealeduki-sdboot]
runs-on: ubuntu-24.04
@@ -204,9 +174,29 @@ jobs:
uses: ./.github/actions/bootc-ubuntu-setup
with:
libvirt: true
- name: Install tmt
run: pip install --user "tmt[provision-virtual]"
- name: Setup env
run: |
BASE=$(just pullspec-for-os ${{ matrix.test_os }})
echo "BOOTC_base=${BASE}" >> $GITHUB_ENV
echo "BOOTC_variant="${{ matrix.variant }} >> $GITHUB_ENV
- name: Build container
run: just build-sealed
run: |
just build-integration-test-image
- name: Test
run: just test-composefs
- name: Unit and container integration tests
run: just test-container
- name: Run readonly TMT tests
# TODO: expand to more tests
run: just test-tmt readonly
- name: Archive TMT logs
if: always()
uses: actions/upload-artifact@v5
with:
name: tmt-log-PR-${{ github.event.number }}-${{ matrix.test_os }}-cfs-${{ env.ARCH }}
path: /var/tmp/tmt