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

JaCoCo 0.7.5 incorrectly shows 0% coverage in Jenkins summary

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: jacoco-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.609.1
      JaCoCo plugin 1.0.19
    • Similar Issues:

      Description

      The JaCoCo maven plugin has released version 0.7.5.201505241946. I updated the Jenkins git-client-plugin from 0.7.4 to that new maven plugin for coverage reporting. The summary graph and the source code tables all show no coverage (0%) even though the HTML coverage reports generated by JaCoCo show the correct values in target/site/jacoco/index.html.

      Steps to show the problem:

      1. create a new Jenkins job which uses https://github.com/jenkinsci/git-client-plugin.git as its git repository with a Maven build step that performs "clean" and "install". Include a JaCoCo coverage report in the job definition using default settings
      2. build the branch "8c512c4e" that is the commit prior to the JaCoCo 0.7.5 change and confirm that the coverage report displays as expected
      3. build the branch "aa7e532a" that is the commit which switched to JaCoCo 0.7.5 and confirm that the coverage report displays 0% coverage. Confirm also in the repository that the target/site/jacoco/index.html file includes correct coverage reporting information
      4. build the branch "31e556b2" that is the commit which reverted the swtich to JaCoCo 0.7.5 and confirm that Jenkins reporting is again showing the correct coverage summary graph

      I've attached a "support.zip" file from the Cloudbees support plugin which shows the version information of the various components I am using, a screen shot, and the job definition.

      The jenkins.log file includes the following stack trace

      May 30, 2015 7:44:40 AM hudson.model.Run execute
      INFO: git-client-my-branches/master-update-jacoco-0.7.5 #1 main build action completed: SUCCESS
      While reading execution data-file: /var/lib/jenkins/jobs/git-client-my-branches/branches/master-update-jacoco-0.7.5/builds/1/jacoco/execFiles/exec0/jacoco.exec
      java.io.IOException: Incompatible version 1007.
              at org.jacoco.core.data.ExecutionDataReader.readHeader(ExecutionDataReader.java:127)
              at org.jacoco.core.data.ExecutionDataReader.readBlock(ExecutionDataReader.java:107)
              at org.jacoco.core.data.ExecutionDataReader.read(ExecutionDataReader.java:87)
              at hudson.plugins.jacoco.ExecutionFileLoader.loadExecutionData(ExecutionFileLoader.java:92)
              at hudson.plugins.jacoco.ExecutionFileLoader.loadBundleCoverage(ExecutionFileLoader.java:132)
              at hudson.plugins.jacoco.JacocoReportDir.parse(JacocoReportDir.java:102)
              at hudson.plugins.jacoco.JacocoBuildAction.loadRatios(JacocoBuildAction.java:291)
              at hudson.plugins.jacoco.JacocoBuildAction.load(JacocoBuildAction.java:273)
              at hudson.plugins.jacoco.JacocoPublisher.perform(JacocoPublisher.java:371)
              at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
              at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
              at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
              at hudson.model.Build$BuildExecution.post2(Build.java:183)
              at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
              at hudson.model.Run.execute(Run.java:1766)
              at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
              at hudson.model.ResourceController.execute(ResourceController.java:98)
              at hudson.model.Executor.run(Executor.java:374)
      

        Attachments

          Issue Links

            Activity

            Hide
            an2d AN2D added a comment -

            Confirmed that Jacoco plugin version: 2.0.1 worked with the 0.7.6 version of jacocoagent.jar & jacocoant.jar. Thanks centic

            Show
            an2d AN2D added a comment - Confirmed that Jacoco plugin version: 2.0.1 worked with the 0.7.6 version of jacocoagent.jar & jacocoant.jar. Thanks centic
            Hide
            centic centic added a comment -

            Setting to resolved based on latest comments, if you still see this, make sure you use JaCoCo >= 0.7.5 in your project and JaCoCo plugin >= 2.0.1 and if that still does not work, please create a new issue as it is likely not related to this problem.

            Show
            centic centic added a comment - Setting to resolved based on latest comments, if you still see this, make sure you use JaCoCo >= 0.7.5 in your project and JaCoCo plugin >= 2.0.1 and if that still does not work, please create a new issue as it is likely not related to this problem.
            Hide
            saml Samuel Lopez added a comment -

            Thanks,
            On my side it looks like using the Mvn plugin at 0.7.5 fixes my issue

            Show
            saml Samuel Lopez added a comment - Thanks, On my side it looks like using the Mvn plugin at 0.7.5 fixes my issue
            Hide
            balu_bhat13 bhalachandra bhat added a comment -

            I am also facing the same issue and i am not able to fix that

            Show
            balu_bhat13 bhalachandra bhat added a comment - I am also facing the same issue and i am not able to fix that
            Hide
            balu_bhat13 bhalachandra bhat added a comment -

            [JaCoCo plugin] Collecting JaCoCo coverage data...
            [JaCoCo plugin] */.ec;/app/build/intermediates/classes/debug/com/calci/com/calculator1;*/app/src/main/java; locations are configured
            [JaCoCo plugin] Number of found exec files for pattern */*.ec: 1
            [JaCoCo plugin] Saving matched execfiles: C:\Users\310247986\AndroidStudioProjects\Calculator1\app\build\outputs\code-coverage\connected\coverage.ec
            [JaCoCo plugin] Saving matched class directories for class-pattern: **/app/build/intermediates/classes/debug/com/calci/com/calculator1: C:\Users\310247986\AndroidStudioProjects\Calculator1\app\build\intermediates\classes\debug\com\calci\com\calculator1
            [JaCoCo plugin] Saving matched source directories for source-pattern: **/app/src/main/java: C:\Users\310247986\AndroidStudioProjects\Calculator1\app\src\main\java
            [JaCoCo plugin] Loading inclusions files..
            [JaCoCo plugin] inclusions: [**/*.class]
            [JaCoCo plugin] exclusions: []
            [JaCoCo plugin] Thresholds: JacocoHealthReportThresholds [minClass=0, maxClass=0, minMethod=0, maxMethod=0, minLine=0, maxLine=0, minBranch=0, maxBranch=0, minInstruction=0, maxInstruction=0, minComplexity=0, maxComplexity=0]
            [JaCoCo plugin] Publishing the results..
            [JaCoCo plugin] Loading packages..
            [JaCoCo plugin] Done.
            [JaCoCo plugin] Overall coverage: class: 0, method: 0, line: 0, branch: 0, instruction: 0
            Finished: SUCCESS

            in my case .ec file is generated but it is showing 0% code coverage though XML file shows 17% of code coverage

            Show
            balu_bhat13 bhalachandra bhat added a comment - [JaCoCo plugin] Collecting JaCoCo coverage data... [JaCoCo plugin] * / .ec; /app/build/intermediates/classes/debug/com/calci/com/calculator1; */app/src/main/java; locations are configured [JaCoCo plugin] Number of found exec files for pattern * / *.ec: 1 [JaCoCo plugin] Saving matched execfiles: C:\Users\310247986\AndroidStudioProjects\Calculator1\app\build\outputs\code-coverage\connected\coverage.ec [JaCoCo plugin] Saving matched class directories for class-pattern: **/app/build/intermediates/classes/debug/com/calci/com/calculator1: C:\Users\310247986\AndroidStudioProjects\Calculator1\app\build\intermediates\classes\debug\com\calci\com\calculator1 [JaCoCo plugin] Saving matched source directories for source-pattern: **/app/src/main/java: C:\Users\310247986\AndroidStudioProjects\Calculator1\app\src\main\java [JaCoCo plugin] Loading inclusions files.. [JaCoCo plugin] inclusions: [**/*.class] [JaCoCo plugin] exclusions: [] [JaCoCo plugin] Thresholds: JacocoHealthReportThresholds [minClass=0, maxClass=0, minMethod=0, maxMethod=0, minLine=0, maxLine=0, minBranch=0, maxBranch=0, minInstruction=0, maxInstruction=0, minComplexity=0, maxComplexity=0] [JaCoCo plugin] Publishing the results.. [JaCoCo plugin] Loading packages.. [JaCoCo plugin] Done. [JaCoCo plugin] Overall coverage: class: 0, method: 0, line: 0, branch: 0, instruction: 0 Finished: SUCCESS in my case .ec file is generated but it is showing 0% code coverage though XML file shows 17% of code coverage

              People

              • Assignee:
                centic centic
                Reporter:
                markewaite Mark Waite
              • Votes:
                22 Vote for this issue
                Watchers:
                25 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: