Skip to content

Some fixes to develop on Mac - #161

Merged
sebastian-pf9 merged 6 commits into
mainfrom
private/sebastian/fix-e2e-on-mac
Aug 11, 2026
Merged

Some fixes to develop on Mac#161
sebastian-pf9 merged 6 commits into
mainfrom
private/sebastian/fix-e2e-on-mac

Conversation

@sebastian-pf9

Copy link
Copy Markdown
Collaborator
  1. Now compiles on Mac
  2. Pure unit tests run on Mac
  3. Agent tests run within a Linux ARM VM on Mac

Missing:

  • Full e2e suite. This is next on my list.
  • Potentially Makefile tergets + documentation

indradhanush
indradhanush previously approved these changes Aug 11, 2026

@indradhanush indradhanush left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved to unblock.

Comment thread installer/registry.go
Comment thread agent/host_agent_suite_test.go
Comment thread agent/host_agent_suite_test.go
For e.g. running unit tests on mac
…upport

The e2e suite built the host-agent binary for the runner's native GOOS,
which breaks when running on macOS since the binary is copied into a
Linux BYOH host container. Force GOOS=linux for that build.

The installer registry only recognized x86-64 bundles, and the bundle
ingredient downloader hardcoded the amd64 containerd tarball, so an
arm64 BYOH host container hit "No k8s support for OS" and could never
install. Add arm64 registry entries and parameterize the containerd
download by $ARCH.
…ontainer

The agent integration tests copy the host-agent binary into real Linux
BYOH host containers and expect them to reach envtest's local API server
over the containers' "host" networking. On macOS, both the built binary
and that networking assumption break: container runtimes there run
everything inside a Linux VM, so "host" networking only shares the VM's
namespace, not the real Mac. Rather than bridge across that boundary,
run the whole suite inside a Linux container sharing the VM's own podman
socket (see hack/docker/linux-test-runner.Dockerfile), which makes host
networking and loopback behave exactly as they do in CI.

agent/host_agent_suite_test.go now builds two binaries: a native one for
help_flag_test.go's direct local exec, and a linux/<host arch> one for
the containers, matching the fix already applied to the e2e suite.

agent/registration/csr_test.go's "should return error if not able to
write kubeconfig" test relied on mkdir failing with EACCES at the
filesystem root, which only holds for a non-root process. Root (needed
elsewhere in this suite, e.g. cleaning up /etc/cni/net.d) bypasses that
check. Switched to blocking the target path with a regular file, which
fails with ENOTDIR regardless of privilege level.
… via a Linux container

Encode the container-run invocation validated this session as make
targets (agent-test-linux-vm, test-e2e-linux-vm) instead of leaving it
as an ad hoc shell command, and document why it's needed and the
one-time host setup it depends on in docs/local_dev.md.
@sebastian-pf9
sebastian-pf9 force-pushed the private/sebastian/fix-e2e-on-mac branch from 6d84ab6 to ca69c5b Compare August 11, 2026 15:06
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.11111% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
agent/reconciler/host_reconciler_linux.go 0.00% 6 Missing ⚠️
agent/reconciler/host_reconciler.go 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@sebastian-pf9

Copy link
Copy Markdown
Collaborator Author

e2e tests failed. Claude says:

No — this is a pre-existing failure on main, not something caused by this PR. I checked recent main branch e2e runs and every single one is failing with the exact same 3 specs, going back through commits our branch is based on:

gh run list --workflow=e2e.yml --branch=main
shows failures on main at commits tests: Fixes to run E2E suites in parallel (#144), ci: rearchitect and streamline CI (#143), and every push since — all before our branch touched anything.

@sebastian-pf9
sebastian-pf9 merged commit 9c478ab into main Aug 11, 2026
14 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants