perf(ci): fix degenerate unit-test coverage (469MB→merged) via covdata#996
perf(ci): fix degenerate unit-test coverage (469MB→merged) via covdata#996oskarszoon wants to merge 1 commit into
Conversation
make test used -coverprofile + -coverpkg=./..., which made go test concatenate (not merge) every test binary's full-codebase profile -> a 469MB/5.5M-line coverage.out (~115x duplicated; 47,667 real blocks, 58.71% coverage). Writing it was ~313s of the ~511s test step; SonarQube ingested all 469MB. Switch to binary coverage (-cover -coverpkg=./... -args -test.gocoverdir=DIR) merged once with 'go tool covdata textfmt'. Same coverage, merged into a few-MB profile. Expected: test step ~511s->~230s, coverage.out 469MB->few MB.
|
🤖 Claude Code Review Status: Complete Current Review: No issues found. The changes correctly implement binary coverage collection via The .gitignore addition appropriately excludes the coverage directory from version control. |
Benchmark Comparison ReportBaseline: Current: Summary
All benchmark results (sec/op)
Threshold: >10% with p < 0.05 | Generated: 2026-06-01 11:53 UTC |
|
|
Closing — the change doesn't deliver what I expected. Measured on the green re-run (commit 33e17d5):
Not worth changing the coverage figure for a cosmetic file-size win, and it doesn't move the PR gate ( |



The
testjob's coverage output is a 469 MB / 5.5M-linecoverage.outthat's ~115× duplicated:-coverpkg=./...instruments every test binary for the whole codebase, andgo testconcatenates (not merges) all ~105 binaries' full-codebase profiles. Only 47,667 blocks are real; coverage is 58.71%. Writing/handling that file is ~313s of the ~511sRun Go testsstep (the 10,173 tests themselves run in ~94s), and SonarQube then ingests the full 469 MB.Fix
Switch
make testto Go binary coverage:-cover -coverpkg=./... … -args -test.gocoverdir=<dir>, then merge once withgo tool covdata textfmt. Same instrumentation, same coverage — but the output is properly merged into a few-MB profile instead of a 469 MB concatenation.Verified the mechanism locally: covdata output is deduped (1,334 blocks → 1,335 lines, no duplication), coverage % identical, format is standard Go coverage (
mode: atomic),gotestsumforwards the flags,-racecompatible.Expected
Run Go testsstep ~511s → ~230s (the ~313s coverage-write tail goes away);testjob ~9.2m → ~4.5m.coverage.out~469 MB → a few MB; faster artifact upload + SonarQube ingest.This speeds the unit job and cuts runner-minutes + SonarQube load. It does not lower the overall PR gate (set by
pr-smoketests~10.6m;pr-testssits just under it) — it's an efficiency + faster-unit-feedback fix.Verify on this PR
testjob duration drops.coverage.outartifact is small (few MB, not ~469 MB).