Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-15235

No test coverage reports for Java due to settings for Jacoco being incompatible with Gradle 8.x

    XMLWordPrintableJSON

Details

    Description

      On current dev branch, gradle 8.x fails while trying to generate test coverage reports as stated in the README, e.g. by running

      ./gradlew clients:reportCoverage -PenableTestCoverage=true -Dorg.gradle.parallel=false

       

      The error message states:

      "Could not set unknown property 'enabled' for Report html of type org.gradle.api.reporting.internal.TaskGeneratedSingleDirectoryReport"
      

      In "build.gradle", the library "jacoco" which is used to generate test coverage reports for the Java code is configured in two different places with these settings:

       

      jacocoTestReport {
          dependsOn tasks.test
          sourceSets sourceSets.main
          reports { 
              html.enabled = true
              xml.enabled = true        
              csv.enabled = false    
          }
      }
      

       

      With the latest version of jacoco, shipped with gradle 8.x, these config options are not compatible anymore. A correct configuration might look like like this:

       

      jacocoTestReport {
          dependsOn tasks.test
          sourceSets sourceSets.main
          reports {
              html {
                 required = true
              }
              xml {
                 required = true         
              }
              csv{
                required = false
              }
          }
      }
      

       

      However, even with these settings being accepted by Gradle, I was unable to generate any test coverage report. This might be due to some OOM issues, but I tried a lots of settings including increasing the maximum heap for the JVM gradle tasks without getting this to work.

      Attachments

        Issue Links

          Activity

            People

              bmscomp Said BOUDJELDA
              ethaden Eike Thaden
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: