Skip to content

Fix CI failures on GitHub-hosted runners - #1

Merged
yamixst merged 5 commits into
mainfrom
fix/ci-failures
Nov 8, 2026
Merged

yamixst merged 5 commits into
mainfrom
fix/ci-failures

Conversation

@yamixst

@yamixst yamixst commented Nov 8, 2026

Copy link
Copy Markdown
Owner

CI fails on GitHub runners because of environment assumptions that only hold on the developer machine (uid 1000, restricted AppArmor off).

  • changes tests: use the current uid/gid instead of hardcoded 1000:1000; lower-dir fixtures are owned by the runner user (uid 1001), so recreated entries were reported as modified.
  • apply::tests::test_needs_root_detection: check against a read-only temp dir instead of /usr/local/bin, which is writable on runners.
  • CI: set kernel.apparmor_restrict_unprivileged_userns=0 before cargo test, otherwise writing uid_map fails with EPERM (prereq::tests::test_probe_userns).
  • Docker integration tests: build the tester user with the host uid/gid so cargo can create /work/target-docker in the bind-mounted checkout.

Lower-dir fixtures are owned by the user running the tests, so the
hardcoded 1000:1000 owner made recreated entries look modified when the
suite runs under another uid (GitHub runners use uid 1001).
The test assumed /usr/local/bin is not writable by the current user,
which does not hold on GitHub-hosted runners.
Ubuntu 24.04 runners set kernel.apparmor_restrict_unprivileged_userns=1,
so writing uid_map fails with EPERM and prereq::tests::test_probe_userns
cannot pass.
The container user was hardcoded to uid 1000, so on GitHub runners
(uid 1001) cargo could not create /work/target-docker in the
bind-mounted checkout.
On the bare runner the privileged e2e tests write to the real
/usr/local/bin, which is user-writable there, so root-ownership
assertions fail. Skip privileged tests (and the userns probe test)
when AppArmor restricts unprivileged user namespaces, and lift the
restriction only for the Docker job, where INSTALLCTL_REQUIRE_PRIV_TESTS=1
forbids skipping.
@yamixst
yamixst merged commit 00e6096 into main Nov 8, 2026
2 checks passed
@yamixst
yamixst deleted the fix/ci-failures branch November 8, 2026 23:05
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.

1 participant