Repository navigation
Description
Context
#2208 removes the Docker-on-the-runner e2e path (make teste2e / make teste2e-covdata), leaving e2e-k8s as the only e2e entry point. That job collects no coverage today, which is why #2208 has to lower the codecov project target to stay green.
Measured on 715917d (origin/main):
- codecov reports 88.14% for the repo today. The
buildjob logsFound 2 coverage files to report—coverage.txtandtest/e2e/coverage.txt. - Unit tests alone give 61.1% statement coverage, or 60.7% excluding codecov's ignored
internal/testutils(go test -coverprofile -covermode=atomic -coverpkg=./... ./...).
So the e2e suite contributes roughly 27 points, against a hard project target of 75% in .github/.codecov.yml.
Why the KinD job produces nothing today
Coverage was never a property of the Docker path itself. test/e2e/internal/utils/init.go, in BeforeSuite, keys off GOCOVERDIR — when it is set, it discards the prebuilt ORAS_PATH binary and rebuilds an instrumented one:
buildArgs = append(buildArgs, "-coverpkg", "oras.land/oras/cmd/oras/...,oras.land/oras/internal/...")
ORASPath, err = gexec.Build("oras.land/oras/cmd/oras", buildArgs...)test/e2e/k8s/e2e-test-job.yaml sets ORAS_PATH=/workspace/bin/linux/amd64/oras and never sets GOCOVERDIR, and make build-linux-amd64 builds without -cover. There is no GOCOVERDIR anywhere under test/e2e/k8s/, test/e2e/Dockerfile, test/e2e/scripts/, or .github/workflows/e2e-k8s.yml.
Proposed work
- Set
GOCOVERDIRintest/e2e/k8s/e2e-test-job.yaml. No test-code change is needed —init.goself-instruments. The image already carries Go,gcc,musl-devand a populated module cache, so the in-pod rebuild works. This is proven underginkgo -p: oldbuildlogs showcoverage instrumenting is enabledonce per parallel process. - Point
GOCOVERDIRat a hostPath volume so the data outlives the pod. The job already uses that pattern forzot-data→/tmp/oras-e2e-zot-data. - Extract it.
kubectl cpwill not work here — it needsexecinto a running container, and the job pod has terminated by the time the workflow would copy. Eitherdocker cp kind-control-plane:<path>on the runner, or reuse the debug-pod-mounting-the-same-hostPath approach already intest/e2e/scripts/generate-cache-db.sh. - Convert with
go tool covdata textfmt -i=<dir> -o test/e2e/coverage.txt, either inside the pod or on the runner (setup-gohas already run by then).
Acceptance
Publish test/e2e/coverage.txt as a workflow artifact and confirm go tool cover -func on it reports non-zero cmd/oras/... coverage. The suite contains no Skip(), XIt or Pending specs and e2e-k8s runs the same ginkgo -r -p suite, so the combined total should return to roughly 88% rather than landing somewhere in between.
Notes
- The job caps at
4Gi/2000m. One instrumentedgo buildper parallel ginkgo process, on top of--race, may require raising those. - Uploading to codecov and restoring the 75% target are deliberately out of scope here and tracked separately.
Activity
TerryHowe commentedon Oct 2, 2026
The codecov upload and the restore of the 75%
projecttarget are tracked in #2213, which is blocked on this issue.sinbumu commentedon Nov 17, 2026
I'd like to work on this. I plan to enable GOCOVERDIR for the KinD test Job, retain per-run data on the node, and extract/convert it after the Job exits so e2e-k8s can publish test/e2e/coverage.txt. I'll also check the parallel/race run's resource usage. Codecov upload and the target change will remain in #2213. I'll use AI assistance for implementation and validation and disclose the checks performed in the PR.