You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
coverage: three packages have no floor and no explanation for not having one #199
area: ci-cdCI workflows, gates, and release automationarea: testsTest infrastructure and test suiteeffort: xsExtra small effort - <2 hourspriority: lowNice to have, low urgencytype: testingTest coverage, test infrastructure, or test improvements
.coverage-floors documents five packages as deliberately unfloored. scripts/coverage-gate.sh --report-unlisted reports eight:
package
test files
floors header explains it?
cmd/objectfs
0
yes
internal/testhttp
0
yes
pkg/archive
0
yes
pkg/compression
0
yes
sdks/c
0
yes
pkg/optimization
0
no
pkg/types
1
no
tests
9
no
The last three are the point. The gate names them every run, so they are visible — but the file's header is what says why an absence is intentional, and for these it says nothing. An unexplained gap reads as an oversight, which means the next person either adds a floor without knowing whether the package is meant to be tested, or assumes someone decided this already.
pkg/types and tests have tests and no floor, so their coverage can go to zero without failing anything. pkg/optimization has no tests at all and is not mentioned anywhere — worth checking whether it has callers before writing tests for it (internal/archive and the CargoShip path are the likely consumers).
Do, in order:
Decide per package: floor it, or document the absence in the header the way the existing five are documented.
For pkg/optimization, first establish whether it is live code — if it is dead like pkg/archive, say so there rather than floor it.
Any package added after this gets caught by the gate's unlisted report, which already works; this issue is the backlog, not the mechanism.
Verification: the set the gate reports as unlisted matches the set the header explains, exactly. That equality is the invariant worth having — not a particular coverage number.
Fixed in #359. The invariant this issue names — the set the gate reports as unlisted matches the set the header explains, exactly — is now pinned by TestUnfloorablePackagesAreExplained, which fails in both directions and runs coverage-gate.sh rather than re-deriving the set. Recording what didn't survive reading this against the tree, since four of the premises above shaped the fix.
1. There is no --report-unlisted flag.scripts/coverage-gate.sh:20's comment names one, but the unlisted reporting is unconditional. Passing the flag makes the script read it as $1 — the profile path — which is where coverage-gate: no coverage profile at --report-unlisted came from.
2. pkg/optimization does not exist.4d10da0 deleted pkg/optimization/interfaces.go. Its explanation in the header outlived it by two releases, which is the cheaper half of this drift to miss: a stale explanation is worse than none, because it answers a question nobody should still be asking. The test now fails on it.
3. pkg/types and tests cannot be floored at all, so "floor it, or document it" has one branch for them. Both contain no statements — pkg/types is three files of interface and struct declarations, tests is five _test.go files and no non-test Go files — so go test reports coverage: [no statements], no profile line is emitted, and the gate never sees them. Adding pkg/types 50 doesn't weaken the gate, it breaks it: FAIL pkg/types — a floor of 50% is set but the coverage profile has no data for it, exit 1, via the stale-floor arm at coverage-gate.sh:97-105. Verified rather than reasoned. They get a separate # no-statements: category, and a second test holds that claim so it can't quietly become false. test/benchmarks joins them: //go:build benchmark means go list ./... doesn't report it either, so a reader counting Go directories against the gate's output would find it missing from both with no way to tell which.
4. The eight-vs-five framing is wrong in both numbers. CI's authoritative profile yields six unfloored packages, not eight; the header explained five while its own prose said four. The extra two locally are Go files vendored inside node_modules by two copies of the npm flatted package, which go list ./... reports as packages of this module on any machine that has run npm ci. CI's coverage job installs no npm dependencies, so it sees six either way. They're filtered in the test rather than floored or explained — they aren't this repository's code.
Two things this issue didn't have.
internal/cache/cachetest arrived with #178 and was never explained — so the drift wasn't static, it was still growing.
And the header's entry for pkg/archive said "dead code pending a decision (Part 4)". internal/archive imports it from five files. The claim was wrong in the direction that matters: it read as a reason not to test a package that a floored package depends on.
Why the 0.0% figures aren't a case for weak floors. Five of the six report 0.0%, and that's an artifact of how coverage is collected, not a measurement — go test -coverprofile instruments only the package under test, so a support package's statements produce count-0 lines even when a sibling suite executes all of them. With -coverpkg pointed at each from its consumers:
internal/cache/cachetest 0.0% reported, 81.9% under internal/cache + internal/cache/redis
internal/testhttp 0.0% reported, 75.6% under internal/adapter
pkg/compression 0.0% reported, 88.9% under internal/compression
pkg/archive 0.0% reported, 48.6% under internal/archive
internal/awsrates/…/offertest 0.0% reported, 48.9% under internal/awsrates/...
A floor for any of those would have to be 0 to pass, and 0 is not a gate. sdks/c is the sixth and unfloorable for an unrelated reason: its number depends on CGO_ENABLED, because main.go is a CgoFile, so CGO_ENABLED=0 go test ./sdks/c/ doesn't fall back to a tag-excluded variant — it fails to compile. CI sets CGO_ENABLED=0 for the cross-build matrix and the release build.
No floor values changed. Two follow-ups worth their own issues: pkg/archive's uncovered half (metadata.go's index construction, ~19 statements internal/archive doesn't reach), and a floor for sdks/c once the coverage job's cgo posture is explicit rather than incidental.
area: ci-cdCI workflows, gates, and release automationarea: testsTest infrastructure and test suiteeffort: xsExtra small effort - <2 hourspriority: lowNice to have, low urgencytype: testingTest coverage, test infrastructure, or test improvements
Activity
scttfrdmn commentedon Aug 5, 2026
Fixed in #359. The invariant this issue names — the set the gate reports as unlisted matches the set the header explains, exactly — is now pinned by
TestUnfloorablePackagesAreExplained, which fails in both directions and runscoverage-gate.shrather than re-deriving the set. Recording what didn't survive reading this against the tree, since four of the premises above shaped the fix.1. There is no
--report-unlistedflag.scripts/coverage-gate.sh:20's comment names one, but the unlisted reporting is unconditional. Passing the flag makes the script read it as$1— the profile path — which is wherecoverage-gate: no coverage profile at --report-unlistedcame from.2.
pkg/optimizationdoes not exist.4d10da0deletedpkg/optimization/interfaces.go. Its explanation in the header outlived it by two releases, which is the cheaper half of this drift to miss: a stale explanation is worse than none, because it answers a question nobody should still be asking. The test now fails on it.3.
pkg/typesandtestscannot be floored at all, so "floor it, or document it" has one branch for them. Both contain no statements —pkg/typesis three files of interface and struct declarations,testsis five_test.gofiles and no non-test Go files — sogo testreportscoverage: [no statements], no profile line is emitted, and the gate never sees them. Addingpkg/types 50doesn't weaken the gate, it breaks it:FAIL pkg/types — a floor of 50% is set but the coverage profile has no data for it, exit 1, via the stale-floor arm atcoverage-gate.sh:97-105. Verified rather than reasoned. They get a separate# no-statements:category, and a second test holds that claim so it can't quietly become false.test/benchmarksjoins them://go:build benchmarkmeansgo list ./...doesn't report it either, so a reader counting Go directories against the gate's output would find it missing from both with no way to tell which.4. The eight-vs-five framing is wrong in both numbers. CI's authoritative profile yields six unfloored packages, not eight; the header explained five while its own prose said four. The extra two locally are Go files vendored inside
node_modulesby two copies of the npmflattedpackage, whichgo list ./...reports as packages of this module on any machine that has runnpm ci. CI's coverage job installs no npm dependencies, so it sees six either way. They're filtered in the test rather than floored or explained — they aren't this repository's code.Two things this issue didn't have.
internal/cache/cachetestarrived with #178 and was never explained — so the drift wasn't static, it was still growing.And the header's entry for
pkg/archivesaid "dead code pending a decision (Part 4)".internal/archiveimports it from five files. The claim was wrong in the direction that matters: it read as a reason not to test a package that a floored package depends on.Why the 0.0% figures aren't a case for weak floors. Five of the six report 0.0%, and that's an artifact of how coverage is collected, not a measurement —
go test -coverprofileinstruments only the package under test, so a support package's statements produce count-0 lines even when a sibling suite executes all of them. With-coverpkgpointed at each from its consumers:A floor for any of those would have to be 0 to pass, and 0 is not a gate.
sdks/cis the sixth and unfloorable for an unrelated reason: its number depends onCGO_ENABLED, becausemain.gois aCgoFile, soCGO_ENABLED=0 go test ./sdks/c/doesn't fall back to a tag-excluded variant — it fails to compile. CI setsCGO_ENABLED=0for the cross-build matrix and the release build.No floor values changed. Two follow-ups worth their own issues:
pkg/archive's uncovered half (metadata.go's index construction, ~19 statementsinternal/archivedoesn't reach), and a floor forsdks/conce the coverage job's cgo posture is explicit rather than incidental.