Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-58469

Not able to generate the coverage report with jenkins jacoco plugin 1.0.19 and jacoco 0.7.4

    Details

    • Similar Issues:

      Description

      What went wrong:
      Execution failed for task ':CoreServices:testCoverage'.
      > Unable to read execution data file C:\p4\nemo\ce\sw\4.0\team\services\CoreServices\build\jacoco\testDebugUnitTest.exec

       

       

      Code base:

      task testCoverage(type: JacocoReport) {
      reports

      { xml.enabled = true html.enabled = true }

      def mainSrc = "${project.projectDir}/src"
      sourceDirectories = files([mainSrc])

      def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
      def debugTree = fileTree(dir: "${project.buildDir.getPath()}/intermediates/classes/debug", excludes: fileFilter)
      classDirectories = files([debugTree])

      // executionData = files("${project.buildDir.getPath()}/jacoco/testDebugUnitTest.exec")
      executionData = fileTree(dir: project.projectDir, includes: ['**/*.exec'])

      testCoverage.dependsOn('testDebugUnitTest')

      }

        Attachments

          Activity

          Hide
          yamanuri123 Satya yamanuri added a comment -

          Team any suggestion on this we have to use the 1.0.19 version plugin in Jenkins and this plug in supports only jacococ version 0.7.4.

          Ans using 0.7.4 we are getting the following excception.

          Unable to read execution data file C:\p4\nemo\ce\sw\4.0\team\services\CoreServices\build\jacoco\testDebugUnitTest.exec

          Show
          yamanuri123 Satya yamanuri added a comment - Team any suggestion on this we have to use the 1.0.19 version plugin in Jenkins and this plug in supports only jacococ version 0.7.4. Ans using 0.7.4 we are getting the following excception. Unable to read execution data file C:\p4\nemo\ce\sw\4.0\team\services\CoreServices\build\jacoco\testDebugUnitTest.exec
          Hide
          centic centic added a comment -

          Depending on which version of jacoco produced the .exec file, only the matching version of the jacoco-plugin will be able to process the data.

          Please at least more clearly describe which versions of jacoco and jacoco-plugin you are using here, as this is not clear from the current description.

          In the long run we strongly suggest to update JaCoCo to a newer version and use the latest version of the JaCoCo-plugin, then things should work fine.

          See also the note from the README/GitHub page:

          Note: Version 2.0.0 and higher requires using JaCoCo 0.7.5 or newer, if your projects still use JaCoCo 0.7.4, the plugin will not display any code-coverage numbers any more! In this case please use version 1.0.19 until you can update jacoco in your codebase.

          Show
          centic centic added a comment - Depending on which version of jacoco produced the .exec file, only the matching version of the jacoco-plugin will be able to process the data. Please at least more clearly describe which versions of jacoco and jacoco-plugin you are using here, as this is not clear from the current description. In the long run we strongly suggest to update JaCoCo to a newer version and use the latest version of the JaCoCo-plugin, then things should work fine. See also the note from the README/GitHub page: Note: Version 2.0.0 and higher requires using JaCoCo 0.7.5 or newer, if your projects still use JaCoCo 0.7.4, the plugin will not display any code-coverage numbers any more! In this case please use version 1.0.19 until you can update jacoco in your codebase.

            People

            • Assignee:
              Unassigned
              Reporter:
              yamanuri123 Satya yamanuri
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: