Skip to content

Conversation

@martinpitt
Copy link
Contributor

@martinpitt martinpitt commented Jun 2, 2025

These were applied in linux-system-roles/sudo#59 and lay the groundwork for adding bootc end-to-end tests. The changes are backwards compatible and no-ops for roles without e2e tests. Preferably they can get mass-deployed, to avoid having to cherry-pick all these changes manually.

Summary by Sourcery

Enable bootc end-to-end tests by extending the QEMU CI workflow with Podman 5.x support, customizable tox arguments, and a new validation step for bootc images, and bump tox-lsr to version 3.10.0.

CI:

  • Upgrade Podman to 5.x via apt pinning for bootc scenarios
  • Pass custom TOX_ARGS and add skip-tags for bootc-e2e in the tox invocation
  • Add a QEMU-based bootc validation tests step that runs tests against generated QCOW2 images and logs results

@martinpitt martinpitt requested a review from richm June 2, 2025 21:18
sourcery-ai[bot]

This comment was marked as outdated.

Avoids repeating the value. The defined `TOX_ARGS` was previously
unused.
Ubuntu 24.04's podman 4.9.3 does not work with the bootc-image-builder
container: Bind-mounting the container storage into it makes the
container's podman 5 fail with a storage error.

Thus install podman 5.4 from Ubuntu 25.04 to regain compatibility. This
is rather hackish, but as that is a stable release, it should not break
in the future (wrt. library dependencies and such).
These tests run the role during a bootc container image build, deploy
the container into a QEMU VM, boot that, and validate the expected
configuration there. They run in two different tox environments, and
thus have to be run in two steps (preparation in buildah, validation in
QEMU). The preparation is expected to output a qcow2 image in
`tests/tmp/TESTNAME/qcow2/disk.qcow2`, i.e. the output structure of
<https://github.com/osbuild/bootc-image-builder>.

There are two possibilities:

* Have separate bootc end-to-end tests. These are tagged with
`tests::bootc-e2` and are skipped in the normal qemu-* scenarios.
They run as part of the container-* ones.

* Modify an existing test: These need to build a qcow2 image exactly
*once* (via calling `bootc-buildah-qcow.sh`) and skip setup/cleanup
and role invocations in validation mode, i.e. when
`__bootc_validation` is true.

In the container scenario, run the QEMU validation as a separate step in
the workflow.

See https://issues.redhat.com/browse/RHEL-88396
@martinpitt martinpitt changed the title ci: Bump tox-lsr to 3.10.0 ci: bootc end-to-end support Jun 3, 2025
@linux-system-roles linux-system-roles deleted a comment from sourcery-ai bot Jun 3, 2025
@sourcery-ai
Copy link

sourcery-ai bot commented Jun 3, 2025

Reviewer's Guide

This PR enhances the CI workflows to support bootc end-to-end tests by conditionally upgrading podman, extending the tox invocation to accept bootc-specific arguments, adding a new QEMU-based bootc validation step, and bumping the tox-lsr version to 3.10.0.

Sequence Diagram: Bootc E2E Test Execution in CI

sequenceDiagram
    participant GHA as "GitHub Actions Workflow"
    participant Runner as "CI Runner"
    participant PodmanSvc as "Podman Service"
    participant ToxEngine as "Tox Engine"
    participant QEMU_Bootc as "QEMU (for Bootc)"

    GHA->>Runner: Start E2E Tests
    Runner->>Runner: Checkout Code
    opt Podman Upgrade Required
        Runner->>PodmanSvc: Upgrade Podman
        PodmanSvc-->>Runner: Podman Ready
    end
    Runner->>ToxEngine: Execute tests (with bootc args, using tox-lsr 3.10.0)
    ToxEngine->>QEMU_Bootc: Run QEMU-based bootc validation
    QEMU_Bootc-->>ToxEngine: Validation Result
    ToxEngine-->>Runner: Test Suite Result
    Runner-->>GHA: Report CI Status
Loading

File-Level Changes

Change Details Files
Introduce a podman 5.x upgrade step for bootc scenarios
  • Add a conditional CI step to switch to plucky sources when testing '-bootc' images
  • Pin plucky releases for podman and related packages via an APT preferences file
  • Run apt update and install podman, crun, conmon, and containers-storage
playbooks/templates/.github/workflows/qemu-kvm-integration-tests.yml
Refactor tox command to support bootc-specific arguments
  • Replace hard-coded --log-level and skip-tags with reusable $TOX_ARGS
  • Exclude only the 'tests::bootc-e2e' tag by default
playbooks/templates/.github/workflows/qemu-kvm-integration-tests.yml
Add QEMU-based bootc validation test step
  • Introduce a new conditional job step for bootc images in container envs
  • Derive the QEMU environment name from the container scenario
  • Loop over qcow2 disk images to invoke tox with __bootc_validation enabled
  • Capture and rename logs per test with PASS/FAIL suffix and fail fast
playbooks/templates/.github/workflows/qemu-kvm-integration-tests.yml
Bump tox-lsr version to 3.10.0
  • Update tox_lsr_url in active_roles group vars from 3.9.1 to 3.10.0
inventory/group_vars/active_roles.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @martinpitt - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Review instructions: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@martinpitt martinpitt merged commit fe0eaa0 into linux-system-roles:main Jun 3, 2025
@martinpitt martinpitt deleted the tox-lsr-310 branch June 3, 2025 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants