coral icon indicating copy to clipboard operation
coral copied to clipboard

Add Test Coverage Report and Enforcement

Open 1fanwang opened this issue 1 year ago • 1 comments

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

  • [x] Update root build.gradle to include JaCoCo configuration
  • [x] Create a jacocoTestReport task for each subproject
  • [x] Create a jacocoRootReport task for aggregate reporting
  • [x] 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

1fanwang avatar Sep 13 '24 22:09 1fanwang

cc @ljfgem @KevinGe00 @aastha25 @wmoustafa

1fanwang avatar Sep 13 '24 22:09 1fanwang