Skip to content

Add Test Coverage Report and Enforcement #528

@1fanwang

Description

@1fanwang

Overview

We need to add test coverage reporting and enforcement to our build process. This will help us maintain and improve code quality by ensuring adequate test coverage across the project.

Goals

  • Integrate JaCoCo with our Gradle build
  • Generate comprehensive test coverage reports
  • Enforce minimum coverage thresholds
  • Make reports easily accessible to developers

Implementation Details

  1. Add JaCoCo plugin to root build.gradle file
  2. Configure JaCoCo for all subprojects
  3. Set up aggregate report generation
  4. Define coverage thresholds (suggest starting with 70% instruction coverage)
  5. Integrate coverage checks into our CI/CD pipeline

Specific Tasks

  • Update root build.gradle to include JaCoCo configuration
  • Create a jacocoTestReport task for each subproject
  • Create a jacocoRootReport task for aggregate reporting
  • Set up jacocoTestCoverageVerification with appropriate rules
  • Update CI configuration to run coverage checks and fail builds if thresholds aren't met
  • Determine how/where to publish reports (e.g., as build artifacts)
  • Update documentation to explain how to run and interpret coverage reports

Next Steps

  1. Review and adjust proposed implementation details
  2. Assign developer(s) to the task
  3. Plan for gradual increase of coverage thresholds over time

Additional Notes

  • We should consider excluding certain packages or classes if they're not suitable for unit testing
  • We should discuss strategies for rolling this out without disrupting development (e.g., setting specific coverage requirement per module instead of global)

Resources

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationenhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions