Skip to content

Raise JaCoCo coverage floor above 50% line / 30% branch #23

Description

@devops-thiago

Background

pom.xml enforces a whole-project JaCoCo floor of 50% line / 30% branch coverage, explicitly commented as "set just below current levels (line ~53%, branch ~34%); raising these as coverage improves is a follow-up."

Impact

  • The quality gate passes with roughly half the code untested.
  • Key RAG paths (retrieval filtering, token tracking, provider factories, error branches) may be under-tested without anyone noticing.
  • Codecov/SonarCloud badges imply higher coverage than the gate actually enforces.

How to reproduce

  1. Run mvn jacoco:check — passes at the 50%/30% floor.
  2. Delete a test exercising a covered branch and re-run — still passes until coverage dips below the floor.

Where the fix should land

Raise the floor incrementally as coverage improves:

  • Measure current coverage (mvn clean test jacoco:report).
  • Raise the BUNDLE limits in pom.xml in steps (e.g. 0.55/0.35, then 0.60/0.40) rather than one big jump.
  • Add focused unit tests for under-covered classes (TokenUsageTracker, MetricsService, VectorRepositoryFactory, provider error paths) to keep pace with each raised floor.

Files touched

  • pom.xml (JaCoCo configuration/rules)
  • New/updated tests under src/test/java/...

Acceptance criteria

  • JaCoCo floor raised by at least one step and the CI code-coverage job stays green.
  • Coverage improvement visible in the Codecov report.
  • No tests skipped or disabled to game the threshold.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestjavaPull requests that update java code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions