Skip to content

ci: Add container integration test for rpm and bootc#52

Merged
martinpitt merged 2 commits intolinux-system-roles:mainfrom
martinpitt:bootc-container-test
Apr 28, 2025
Merged

ci: Add container integration test for rpm and bootc#52
martinpitt merged 2 commits intolinux-system-roles:mainfrom
martinpitt:bootc-container-test

Conversation

@martinpitt
Copy link
Contributor

@martinpitt martinpitt commented Apr 23, 2025

Generalize qemu-kvm-integration-tests.yml to run some "container-*" environments as well. For "classic rpm" OSes that does not give us too much beyond making sure that the container tests actually work (developers might use them locally, after all). 90% of the logic (setup, compatibility check, status updates, etc.) is the same, so it's not economic to duplicate all of that into a new workflow.

Add Fedora/CentOS *-bootc scenarios: These check that our role works during a bootc container build, without any systemd, processes, or other runtime environment. tox-lsr added support for this in linux-system-roles/tox-lsr#188.

However, as most roles don't currently work in that environment, introduce and check a new containerbuild tag in meta/main.yml. We'll add this to roles as we adjust them.

Similarly, as not every role works in a running container (e.g. due to assuming SELinux), check a new container tag in their tests.

Issue Tracker Tickets (Jira or BZ if any): https://issues.redhat.com/browse/RHEL-85652


@codecov
Copy link

codecov bot commented Apr 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #52   +/-   ##
=======================================
  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.

- { image: "fedora-42", env: "container-ansible-core-2.17" }

env:
TOX_ARGS: "--skip-tags tests::infiniband,tests::nvme,tests::scsi"
Copy link
Contributor

Choose a reason for hiding this comment

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

nice! refactoring this will allow us to do per-role tags in the future

@martinpitt martinpitt force-pushed the bootc-container-test branch from 0885636 to 07bff5b Compare April 25, 2025 10:01
@martinpitt martinpitt force-pushed the bootc-container-test branch 2 times, most recently from b4d83ba to b9aa6ac Compare April 25, 2025 10:59
@martinpitt
Copy link
Contributor Author

The current version (commit b9aa6ac) is all green, but with a tear in my eye I'll re-disable the "classic rpm" container scenarios. They work fine here, but already caused some (easily fixable) trouble in the firewall role, and some serious (SELinux) trouble in cockpit. It would be nice to cover/fix them and fix lsr for containers, but (1) let's wait for customers to actually ask for that, and (2) we have too much work ongoing already ("pick your battles").

@martinpitt
Copy link
Contributor Author

Or actually, let's add a new tag for "certified to work in a container"! Then we can selectively enable it for rules where it works.

@martinpitt martinpitt force-pushed the bootc-container-test branch from b9aa6ac to bce2f77 Compare April 25, 2025 13:13
@martinpitt martinpitt marked this pull request as ready for review April 25, 2025 13:22
@martinpitt martinpitt requested a review from spetrosi as a code owner April 25, 2025 13:22
@martinpitt martinpitt requested a review from richm April 25, 2025 13:22
@martinpitt
Copy link
Contributor Author

I am happy with this now. I also sent it to linux-system-roles/firewall#264 and linux-system-roles/cockpit#212 to test them against a more complex scenarios. In particular, firewall only supports the "container" tag, while cockpit only supports the "containerbuild" tag (not not quite yet, but working on it 🔨 )

So this is ready for a round of reviews. Once we are all happy with this, I'll sync the other two PRs and send it to .github.git - we can mass-deploy this now and then selectively work on enabling the container and containerbuild scenarios.

@martinpitt martinpitt force-pushed the bootc-container-test branch from bce2f77 to 888087f Compare April 25, 2025 13:59
Generalize qemu-kvm-integration-tests.yml to run some "container-*"
environments as well. For "classic rpm" OSes that does not give us too
much beyond making sure that the container tests actually work
(developers might use them locally, after all). 90% of the logic (setup,
compatibility check, status updates, etc.) is the same, so it's not
economic to duplicate all of that into a new workflow.

Add Fedora/CentOS *-bootc scenarios: These check that our role works
during a bootc container build, without any systemd, processes, or other
runtime environment. tox-lsr added support for this in
linux-system-roles/tox-lsr#188.

However, as most roles don't currently work in that environment,
introduce and check a new `containerbuild` tag in meta/main.yml. We'll
add this to roles as we adjust them.

Similarly, as not every role works in a running container (e.g. due to
assuming SELinux), check a new `container` tag in their tests.

See https://issues.redhat.com/browse/RHEL-85652
Feature: Support running the sudo role during container builds and in
container environments.

Reason: This is particularly useful for building bootc derivative OSes.
It's also desirable to run roles in system containers.

Result: These flags enable running the container scenarios in CI, which
ensures that the role works in podman system containers as well as
buildah build environment and thus allows us to officially support this
role for image mode builds.

See https://issues.redhat.com/browse/RHEL-78157
@martinpitt martinpitt force-pushed the bootc-container-test branch from 888087f to 86dee84 Compare April 28, 2025 13:27
@martinpitt martinpitt requested a review from richm April 28, 2025 13:27
@martinpitt martinpitt merged commit 6a90556 into linux-system-roles:main Apr 28, 2025
29 checks passed
@martinpitt martinpitt deleted the bootc-container-test branch April 28, 2025 14:32
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