Skip to content

test: close coverage gaps — five unit suites + 73% CI floor#116

Merged
orian merged 3 commits into
mainfrom
coverage-gaps-99
Jul 5, 2026
Merged

test: close coverage gaps — five unit suites + 73% CI floor#116
orian merged 3 commits into
mainfrom
coverage-gaps-99

Conversation

@orian

@orian orian commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

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-go driver.Conn/driver.Rows fakes (the file bypasses the package's fakeRows scanner).
  • 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 (writeDictionarySource 31%, buildDictionaryLayoutFromAST 41%, writeOptBool 0%, every Kind() 0%) now ~100%.
  • plan_render_test.gorenderPlanText 0% → 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.goapplyKafkaSetting 38% → 100% (all 25 typed arms + Extra fallback + malformed values), parseBoolPtr, stringSliceEqual, setSQLAttribute/setQueryAttribute branches, 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

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.

orian added 3 commits July 5, 2026 15:24
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%).
@orian
orian merged commit 8dd25d9 into main Jul 5, 2026
17 checks passed
@orian
orian deleted the coverage-gaps-99 branch July 5, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: coverage gaps — flows.go untested; dictionary/named-collection/macros/plan/render_json thin; no coverage gate

1 participant