Skip to content

test: raise coverage gate from 78% to 80% and restore broken tests #620

Description

@kcenon

What

Raise the coverage gate introduced in PR #619 from the current initial floor of 78% up to the full 80% line / 70% branch target from the original AC of #613.

Why

PR #619 merged an enforced coverage gate at 78% (current measured baseline: 78.3% line, branches unmeasured). The 80% target from #613 was reduced to 78% as an interim floor because pushing for the remaining 1.7% would have expanded the gate PR scope significantly. Raising the gate to 80% requires either repairing the pre-existing failing tests or adding new coverage.

How

Option A: repair pre-existing failing tests (higher ROI)

These tests are already failing on develop but not blocking CI because ctest runs with || true. Repairing them restores intended coverage:

  • EncryptedWriterTest.WriteAndDecryptSingleEntry — format/magic mismatch (header.magic=842019419 vs kMagic=1162756946)
  • EncryptedWriterTest.WriteMultipleEntries — same root cause
  • LoggerOtelIntegrationTest.LoggerContextMethods
  • ConsoleWriterIntegrityTest.RoundTripOnStdout

Option B: add new cases in the lowest-covered files

Per lcov per-file breakdown from the PR #619 CI run:

  • logger.cpp — 63.6% (152 missed lines, largest absolute gap)
  • encrypted_writer.cpp — 63.9% (104 missed)
  • log_sampler.cpp — 60.1% (126 missed)

Option C: enable branch instrumentation

The gate currently skips branch coverage because lcov reports "no data found". Enabling branch instrumentation in the Debug+coverage build will produce a measurement and close the 70% branch AC from #613.

Acceptance criteria

  • Coverage gate raised to LINE_THRESHOLD=80
  • Either: failing tests above repaired OR equivalent new cases added
  • Branch instrumentation enabled and BRANCH_THRESHOLD=70 enforced
  • CI Coverage Analysis passes on a PR to develop

Context

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions