Close the test coverage gaps across modules - #71
Merged
Conversation
Both modules shipped with zero tests. zerolog: level parsing, Setup's global level, trace/span-ID injection through WithContext (positive and negative), bare-context fallback. clog: level parsing, TracingHandler injection both ways, Enabled delegation, the WithAttrs/WithGroup wrap-preservation contract (losing the *TracingHandler wrapper would silently drop trace injection on every derived logger), context round-trip, and the four context aliases' level filtering. API-only span contexts — no OTel SDK.
The module only had Docker-gated integration tests. Cover Record.Finished (including the stored-zero response code, which counts as finished by design), sentinel error identity, New's field wiring, and scan via a fake pgx.Row: ErrNoRows→ErrNotFound translation, generic-error wrapping, and the column-to-field mapping that would corrupt records silently if reordered.
grpcx: deadline interceptor (default applied, caller deadline kept), peerAddr, the stream access-log interceptor, and a table forcing every declared error reason into the business/transient classification with the reason overriding the status code. httpx: pin all 18 error-code strings and their distinctness. dbx: option injection and the ping-failure wrap on a closed port. migratex: the unusable-DSN branch after a valid source. flagx: subprocess re-exec over both Must* fatal paths. authmw: the malformed-JWKS-URL constructor error (an unreachable URL is deliberately not a constructor failure — keyfunc refreshes in the background and the middleware 503s at request time).
Run's apply, ErrNoChange-on-rerun, and failed-migration branches need a real database — the only migratex paths unit tests cannot reach. Testcontainers-backed behind the integration tag, same pattern and pinned version as dbx/idempotency. Lifts migratex CI coverage (the gate runs TAGS=integration) past the fleet's 80% bar.
|
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.



Test-only PR (9 test files, no production code) closing the gaps an audit of all 13 modules found. Verified by an independent adversarial review; its one Required finding (a tautological drift guard in the grpcx reason table) and all Optional findings are addressed.
Coverage movement
-tags=integration)What the new tests pin
TracingHandler.WithAttrs/WithGroupwrapper-preservation contract — losing the wrapper silently drops trace injection on every derived logger; plus injection both ways, Enabled delegation, context round-trip, alias level filtering.Record.Finished(a stored 0 counts as finished), sentinel identity, andscanvia a fakepgx.Row— ErrNoRows translation, error wrapping, and thecolumns↔dest-order lockstep that would corrupt records silently if reordered.peerAddr, stream access-log interceptor, and a reason-classification table where the reason overrides the status code in both directions, with a drift tripwire on the production maps.dbx: pingfailure wrap on a closed port.Must*fatal paths via subprocess re-exec.Full
make testgate green under-race.🤖 Generated with Claude Code