Skip to content

Conversation

@martinpitt
Copy link
Contributor

@martinpitt martinpitt commented Jun 2, 2025

This is an alternative implementation of #58 which modifies an existing test instead of adding a new one. It shows that both approaches work, so depending on the role we can chose to modify an existing test or add a new one.

Summary by Sourcery

Implement end-to-end bootc validation in QEMU integration tests and update CI dependencies accordingly

New Features:

  • Add a bootc end-to-end validation step in the QEMU integration workflow

CI:

  • Upgrade tox-lsr to v3.10.0 across all GitHub Actions workflows
  • Pin Podman 5.x via temporary apt hack for bootc-image-builder compatibility
  • Extend the QEMU integration job to adjust skip-tags and run bootc validation tests for container-bootc scenarios

Tests:

  • Introduce conditional branching in tests_default.yml to skip setup/cleanup during bootc validation and add a QEMU deployment task for bootc end-to-end tests

@sourcery-ai
Copy link

sourcery-ai bot commented Jun 2, 2025

Reviewer's Guide

This PR augments the CI workflows and test suite to enable bootc end-to-end validation by upgrading the tox-lsr dependency, pinning Podman 5.x for compatibility, refining the integration test invocations, and conditionally extending tests_default.yml with QEMU deployment tasks.

Sequence Diagram: Bootc End-to-End Validation Process

sequenceDiagram
    participant GHA as GitHub Actions CI
    participant TOX as tox / tox-lsr
    participant BIB as Bootc Image Builder (Buildah)
    participant QEMU as QEMU Environment

    GHA->>TOX: Invoke tests (with bootc params)
    activate TOX
    TOX->>BIB: Request Bootc Image Build
    activate BIB
    BIB-->>TOX: Bootc Image Ready
    deactivate BIB
    TOX->>QEMU: Deploy Image and Start VM
    activate QEMU
    TOX->>QEMU: Run Validation Tests
    QEMU-->>TOX: Test Results
    deactivate QEMU
    TOX-->>GHA: Overall Validation Status
    deactivate TOX
Loading

File-Level Changes

Change Details Files
Upgrade tox-lsr version in CI workflows
  • Bump pip install URL to tox-lsr@3.10.0 across all GitHub Actions
  • Replace earlier @3.9.0 references with the new version
.github/workflows/qemu-kvm-integration-tests.yml
.github/workflows/ansible-lint.yml
.github/workflows/ansible-managed-var-comment.yml
.github/workflows/ansible-test.yml
.github/workflows/python-unit-test.yml
Pin Podman 5.x in CI for bootc-image-builder compatibility
  • Add an apt‐sources hack to switch to Ubuntu plucky for Podman 5.x
  • Define apt preferences to pin Podman and related packages at priority 991
  • Install Podman 5.x, crun, conmon, and containers-storage
.github/workflows/qemu-kvm-integration-tests.yml
Enhance qemu-kvm-integration-tests with bootc validation
  • Adjust tox invocation to include $TOX_ARGS and skip bootc-e2e tests by default
  • Add a new step to iterate generated images and run bootc validation tests in QEMU
.github/workflows/qemu-kvm-integration-tests.yml
Enable conditional bootc tasks in tests_default.yml
  • Guard setup, role execution, and cleanup tasks using the __bootc_validation flag
  • Insert a delegated QEMU deployment task invoking bootc-buildah-qcow.sh for buildah connections
tests/tests_default.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

@codecov
Copy link

codecov bot commented Jun 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@f3cf515). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #59   +/-   ##
=======================================
  Coverage        ?   52.31%           
=======================================
  Files           ?        1           
  Lines           ?      346           
  Branches        ?        0           
=======================================
  Hits            ?      181           
  Misses          ?      165           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This *is* the correct name for our test dependency. The most recent
codespell version started to complain about it.
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
Update tests_default.yml to build a QEMU deployment during bootc
container runs after running the setup role. Skip setup/cleanup/role
invocation during the QEMU validation run.
@martinpitt martinpitt force-pushed the qemu-bootc-existingtest branch from 26dafe8 to 5506bae Compare June 2, 2025 21:20
@martinpitt martinpitt removed the blocked label Jun 2, 2025
@martinpitt martinpitt marked this pull request as ready for review June 2, 2025 21:20
@martinpitt martinpitt requested review from richm and spetrosi as code owners June 2, 2025 21:20
@martinpitt
Copy link
Contributor Author

@richm tox-lsr 3.10.0 released and updated here. My hunch is you'll like this version better than #58 (and I agree). But let me know if you rather prefer #58, I'll update that as well (if for nothing else than having an example).

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
Copy link
Contributor Author

F41 failure is known, see https://bodhi.fedoraproject.org/updates/FEDORA-2025-f68c3fced6 . Will be fixed in a day or two when the new bootc version lands in Fedora.

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