Run k8s e2e tests against the kind infrastructure in CI#339
Merged
nikolasmatt merged 21 commits intoagentregistry-dev:mainfrom Mar 16, 2026
Merged
Run k8s e2e tests against the kind infrastructure in CI#339nikolasmatt merged 21 commits intoagentregistry-dev:mainfrom
nikolasmatt merged 21 commits intoagentregistry-dev:mainfrom
Conversation
nikolasmatt
commented
Mar 13, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the e2e test harness so that Kubernetes/Kind (and related infra like MetalLB, registry, kagent) is provisioned via Make targets/scripts before the Go test process starts, and adds a docker-only e2e mode that skips Kind/k8s-only tests—enabling faster local iteration and more reliable CI execution.
Changes:
- Move e2e infra setup/teardown out of
TestMainand intomake test-e2e-k8s/make test-e2e-docker, with backend-based test skipping. - Rework Kind setup to support CI networking (API server bind/kubeconfig patch) and optional local registry wiring.
- Update CI workflow to run docker and k8s e2e in parallel via a matrix, and add a Make target for dumping Kind state on failure.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/kind/setup-kind.sh | Uses go tool kind, adds Linux networking/kubeconfig patching, and makes registry config optional via env vars. |
| scripts/kind/kind-config.yaml | Switches to strategic merge patch to add API server cert SANs needed for CI networking. |
| scripts/kind/install-kagent.sh | New script to download/install kagent CLI into bin/ and install kagent into the cluster. |
| scripts/install-helm-unittest.sh | New standalone installer script for the helm-unittest plugin with retry logic. |
| e2e/mcp_publish_test.go | Adds stale MCP entry cleanup to improve idempotency across interrupted runs. |
| e2e/helpers.go | Adds IsK8sBackend() and getEnv() helpers for backend selection and env defaults. |
| e2e/e2e_test.go | Simplifies TestMain to require pre-provisioned infra and gates k8s-only prereqs/logging by backend. |
| e2e/deploy_test.go | Skips k8s deploy targets/tests when running with docker backend; improves test logging and idempotent cleanup. |
| e2e/agent_registry_test.go | Adds stale MCP entry cleanup for idempotent test runs. |
| Makefile | Introduces test-e2e-{k8s,docker}, run-{k8s,docker}, local-registry, dump-kind-state, and install-kagent; moves defaults for API keys. |
| .github/workflows/e2e.yaml | Runs e2e against k8s and docker backends in parallel and calls dump-kind-state on k8s failures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
peterj
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refactors the e2e test infrastructure to move all cluster/daemon setup out of Go test code and into Makefile targets, and adds a docker-only e2e mode that skips Kind entirely.
Motivation: The previous
TestMainmixed infrastructure provisioning (Kind cluster creation, kagent install, daemon startup) with test orchestration. Separating concerns makes the test suite faster to iterate on locally and more debuggable in CI.What changed:
e2e_test.gonow contains only test setup — all infrastructure is provisioned bymake test-e2e-k8s/make test-e2e-dockerbefore the Go process startsmake setup-kind-clusteris fully self-contained and idempotent: creates the Kind cluster, installs MetalLB, PostgreSQL, agentregistry, and kagent (skips steps that already exist)setup-kind.sh: API server bound on0.0.0.0, kubeconfig rewritten to the Docker bridge gateway (172.17.0.1), and127.0.0.1+172.17.0.1added to the API server cert SANs viakubeadmConfigPatchesstrategic mergekindsourced viago tool kind(go.mod tool directive) — no separate install stepinstall-kagent.shandinstall-helm-unittest.shextracted as dedicated scripts; kagent CLI downloaded tobin/and invoked directly rather than via$PATHmake local-registrymanages a sharedkind-registrycontainer on port 5001 (used by both docker and k8s backends to avoid CI port conflicts)make test-e2edispatches totest-e2e-dockerortest-e2e-k8sbased onE2E_BACKEND; defaults to k8stest-e2e-k8sandtest-e2e-dockerin parallel via matrix withfail-fast: false; cluster debug dump moved tomake dump-kind-stateGOOGLE_API_KEYandOPENAI_API_KEYdefault tofake-key-for-setupin the Makefile — no test skips for missing keysv0.8.0-beta6(latest) since the install script some times failed in CI due to Github API rate limits.Change Type
/kind cleanup
Changelog