Repository navigation
ci: collect coverage from KinD e2e tests - #2340
Merged
Merged
Conversation
Enable per-Pod coverage storage and collect it from the running KinD node once the test Pod terminates. Publish the converted profile as a workflow artifact and reject reports without non-zero CLI coverage. Bound parallel instrumented builds to the Job's CPU budget and document local collection. Keep Codecov integration separate. Fixes oras-project#2209 Signed-off-by: sinbumu <[email protected]>
TerryHowe
reviewed
Nov 18, 2026
Signed-off-by: sinbumu <[email protected]>
TerryHowe
marked this pull request as ready for review
November 18, 2026 12:06
TerryHowe
requested review from
Wwwsylvia,
sabre1041,
sajayantony and
shizhMSFT
as code owners
November 18, 2026 12:06
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2340 +/- ##
=======================================
Coverage 74.89% 74.89%
=======================================
Files 157 157
Lines 6584 6584
=======================================
Hits 4931 4931
Misses 1364 1364
Partials 289 289 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
8 of 9 tasks
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.
What this PR does / why we need it:
The KinD e2e Job currently runs without
GOCOVERDIR, so it never instruments ORAS or produces an e2e coverage artifact.This enables coverage in a Pod-UID-specific hostPath directory, then collects it after the test Pod terminates. The collector resolves the actual KinD node from the Pod and streams a tar archive from that running node:
kubectl cpcannot read a terminated test container, anddocker cpcannot read KinD's/tmptmpfs. It converts the data withgo tool covdata textfmt, checks for non-zerocmd/oras/...coverage, and writestest/e2e/coverage.txt.The workflow uploads that file, including partial coverage from failed tests when collection succeeds, while preserving the test failure. Two Ginkgo workers and
GOMAXPROCS=2bound build concurrency within the existing 2 CPU / 4Gi limits. The README documents collection and storage lifetime. Codecov upload and the project target remain scoped to #2213.Validation:
cmd/oras/...functions. Observed memory peak was about 1.1GiB, with no OOM events.go test -race ./...,go vet ./..., ShellCheck,bash -n, actionlint, Kubernetes server dry-run, andgit diff --checkpassed.The first local e2e attempt could not download modules from inside the Pod. The successful run used a local-only image layer that prefetched the unchanged e2e dependencies; the repository Dockerfile is unchanged. The CI artifact upload still needs the upstream workflow run.
AI assistance was used to implement and validate this change.
Which issue(s) this PR fixes:
Fixes #2209
Please check the following list: