tests: verify worker platform selection without QEMU#1076
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Linux integration “cross platform” test selection to avoid QEMU emulation on amd64 CI runners by preferring a same-arch, different-variant target (linux/amd64/v3) instead of cross-arch (e.g., arm64).
Changes:
- Add
linux/amd64/v3to the per-distroPlatformslists used by integration tests. - Update
testTargetPlatformselection logic to prefer same-architecture platforms (different variant) to avoid QEMU on amd64 runners. - Extend the platform plumbing assertion to verify both
TARGETARCHandTARGETVARIANTare passed through.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/target_ubuntu_test.go | Adds linux/amd64/v3 to Ubuntu test platform matrix. |
| test/target_rockylinux_test.go | Adds linux/amd64/v3 to Rocky Linux 8/9 test platform matrices. |
| test/target_azlinux_test.go | Adds linux/amd64/v3 to Azure Linux 3 test platform matrix. |
| test/target_almalinux_test.go | Adds linux/amd64/v3 to AlmaLinux 8/9 test platform matrices. |
| test/linux_target_test.go | Changes cross-platform target selection to prefer same-arch variants and asserts TARGETVARIANT plumbing. |
82a69fb to
d0fd589
Compare
1fa9493 to
dfb0668
Compare
99f3305 to
58c8315
Compare
The cross-platform test previously built worker images for a foreign architecture, which required QEMU emulation and intermittently crashed in CI. Redesign it to prove the frontend selects the correct platform-specific worker image without emulating it. A shared marker image is built from the real distro base for each tested platform, with a /platform-marker file identifying the platform. It is exposed as an OCI layout content store via a small layoutStore adapter: an ocijoin.Layout is already a content.Provider, so the adapter embeds a nil content.Store for the unused methods and implements only ReaderAt and Info, which is all BuildKit's oci-layout source reads. Two subtests then verify selection via different resolution paths: - 'worker context' supplies the marker index as the worker build context, short-circuiting worker building; the returned image is inspected directly. Nothing executes, so no QEMU. - 'source policy' rewrites the distro base image to the marker index via a BuildKit source policy, exercising the normal llb.Image worker-build path. Cross-arch installs run natively via dnf/apt --forcearch into a foreign-arch root, so the marker survives into the result rootfs without emulation. Both confirm the selected worker matches the requested build platform by reading the marker file from the result. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Brian Goff <cpuguy83@gmail.com>
58c8315 to
52f3e65
Compare
|
Took this in a new direction. Why: the existing cross platform test built a package/container for a foreign architecture and ran build steps inside that foreign-arch worker. On a single-arch CI runner that requires QEMU What changed: instead of doing a real foreign-arch build, the test now verifies the thing that was actually at risk of regressing — that the frontend selects the correct platform-specific A small multi-platform "marker" image is built from the real distro worker base, injecting a /platform-marker file into each manifest that names its platform. The test then requests the Selection is checked through both resolution paths:
Both run natively regardless of the runner's architecture — no QEMU. Coverage notes:
|
Problem
The
cross platformintegration test built packages for a foreign architecture (arm64 on amd64 CI runners), which required QEMU emulation. QEMU frequently crashes in CI during this test (e.g. https://github.com/project-dalec/dalec/actions/runs/26779889971/job/78941218259?pr=1068).Approach
Replace it with a native test that proves what the test actually cares about: the frontend selects the correct platform-specific worker image for a requested build platform — without any emulation or rebuilding the world.
linux/amd64andlinux/arm64). Each manifest embeds a/platform-markerfile naming its own platform.SolveOpt.OCIStores) and supplied as the distro worker context via anoci-layout:named context.workertarget and asserts the returned image's/platform-markermatches the requested platform.The distro worker target short-circuits when a worker context image is provided and returns it directly, so nothing is executed (no rpmbuild/dpkg, no emulation) — the worker image is only inspected. Requesting
arm64on anamd64runner therefore needs no QEMU.Real
amd64/arm64platforms are used (rather than a made-up platform) because the worker handler resolves the real distro image config at the requested platform, so the requested platform must actually exist on that image.