Repository navigation
Description
Surfaced while fixing #199 (PR #359). sdks/c is the one package the coverage gate reports as unfloored with a non-zero number — 11.0% — and it is the only one of the six whose reason for having no floor isn't "the number is a collection artifact".
Its reason is that the number isn't stable across build configurations. sdks/c/main.go carries import "C", so it's a CgoFile rather than a GoFile. With cgo off, the package does not fall back to a build-tag-excluded variant — it fails to compile:
$ CGO_ENABLED=0 go test ./sdks/c/
undefined: codeFromErr
undefined: fillCStr
main_test.go references both, and neither declaration is built. That is a hard failure, not a skip.
CI sets CGO_ENABLED=0 in the cross-build matrix (ci.yml:310, :319) and for the release build. The coverage job does not set it either way, so it inherits the runner default of cgo on — which is why the 11.0% appears in coverage.out at all. A floor written against that number would be a floor on a posture no workflow states, held in place by a default.
What to do, in order:
- Make the coverage job's cgo posture explicit — set
CGO_ENABLEDin the coverage job rather than inheriting it, so the number a floor would gate is a stated configuration. - Then set a floor for
sdks/cand delete its# no-floor:entry from.coverage-floors. test: hold the coverage gate's unfloored set to a recorded reason (#199) #359'sTestUnfloorablePackagesAreExplainedfails if the entry is left behind once the gate stops reporting the package, so the two halves can't drift apart.
11.0% is also low enough to be worth a look on its own — the C SDK's error and string-marshalling paths are exactly where a caller in another language has no type system to catch a mistake. But the ordering matters: a floor set before step 1 pins a number that a future CGO_ENABLED=0 on the coverage job would turn into a compile failure rather than a coverage drop, which is a much worse failure to debug.
Activity
test: give pkg/archive tests of its own and sdks/c a floor (#360, #361)…