micrometer icon indicating copy to clipboard operation
micrometer copied to clipboard

Add jacoco to the build

Open jonatan-ivanov opened this issue 4 years ago • 1 comments

JaCoCo is a Java Code Coverage library that we can add to the project so that we can track code coverage when we write tests to see if we are missing anything we wanted to cover.

Goals:

  • Generating code coverage for those subprojects that are published and has tests (e.g.: bom, benckmarks, samples do not need coverage)
  • Generate code coverage for test tasks (e.g.: shenandoahTest, zgcTest, dockerTest etc. are not needed to be included)
  • Generating an aggregated report (all the reports merged together) in the root project
  • Introducing JaCoCo in a way that it has minimal impact to the build (see non-goals)

Non-Goals:

  • Addig jacoco report generation to the build lifecycle is not needed, this means you need to explicitly ask for coverage report (i.e.: ./gradlew jacocoTestReport)
  • Publishing coverage reports and coverage verifications are not needed
  • Recording execution data while executing tests is ok

jonatan-ivanov avatar Dec 06 '21 00:12 jonatan-ivanov

I needed to revert this change because I think it broke the build:

  • 1.6 and 1.7 were ok
  • 1.8 was failing (it seems some timing issue)
  • main (1.9) was ok
  • 2.0 was failing but with a different error than 1.8
  • locally everything was ok

jonatan-ivanov avatar Dec 06 '21 04:12 jonatan-ivanov

I don't recall any internal discussions about this so maybe let's close it for now and come back to it if we ever need it?

marcingrzejszczak avatar Dec 22 '23 13:12 marcingrzejszczak