test: close coverage gaps — five unit suites + 73% CI floor#116
Merged
Conversation
Issue partially stale: flows/hclfuncs/dictionary_sqlgen already covered by recent work. Real gaps measured at 73.6% total: macros_introspect (0%), dictionary variant builders, renderPlanText, web section builders, introspect stragglers. CLI run* shells excluded as integration surface. Five parallel test workstreams + a 73% CI floor.
The coverage step previously printed the total and enforced nothing. Floor sits just under today's 73.6% so regressions fail CI; raise it as coverage grows.
macros_introspect (0% -> full, incl. error paths, driver-level fakes); dictionary layout/source round-trips from canned DDL (all 15 layouts, 7 sources; variant builders to ~100%); renderPlanText 0% -> 100%; web.go section builders (11 functions to 100%); introspect stragglers (applyKafkaSetting all arms, parseBoolPtr, stringSliceEqual, dump attribute branches, Distributed virtuals). 138 new tests, no production changes; total coverage 73.6% -> 78.1% (CI floor 73%).
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.
Closes #99.
Reality check first
The issue's file list was partially stale — flows.go (88%), hclfuncs.go (100%), dictionary_sqlgen.go (91%) were already covered by the #105–#113 work. Scope here is the gaps as measured on 2026-07-05 (total 73.6%).
What
Five new test suites (138 tests, zero production changes), total coverage 73.6% → 78.1%:
macros_introspect_test.go— 0% → full: all three functions incl. query/scan/iteration error paths, via minimal clickhouse-godriver.Conn/driver.Rowsfakes (the file bypasses the package'sfakeRowsscanner).dictionary_roundtrip_test.go— canned CREATE DICTIONARY DDL for all 15 modeled layouts and 7 source kinds: parse → whole-struct assert → dump → re-decode. Variant builders (writeDictionarySource31%,buildDictionaryLayoutFromAST41%,writeOptBool0%, everyKind()0%) now ~100%.plan_render_test.go—renderPlanText0% → 100%: every branch (unsafe headers, empty plan, MANUAL/UNSAFE flags, role provenance, column alignment) with exact pinned output.web_sections_test.go— 11 web.go builders to 100% (viewProps/dictProps/find*/sections/formatValue/kindLabel/buildHTMLView), direct calls + HTTP-driven page assertions.introspect_helpers_test.go—applyKafkaSetting38% → 100% (all 25 typed arms + Extra fallback + malformed values),parseBoolPtr,stringSliceEqual,setSQLAttribute/setQueryAttributebranches,EngineDistributed.Virtuals.CI gate: the coverage step now fails under a 73% floor (was print-only). Floor sits just under today's 78.1% headroom deliberately — raise it as coverage grows, never lower it.
Deliberately excluded: the 0% CLI shells (
main,runDiff,runIntrospect, …) — flag parsing + live connections + os.Exit; their logic lives in tested helpers, the shells are integration surface (#98).Found while testing
FLAT(INITIAL_ARRAY_SIZE …)→ emptyLayoutFlat{}, verified repro) — the introspect drops the ReplacingMergeTree is_deleted parameter #108 silent-drop class again.Verification
792 tests pass across all packages; snapshot + live suites green; gofmt -s/vet clean; floor logic validated against 72.9/73.0/73.6 locally.