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

Jenkins Jacoco plugin shows 0% branch coverage when jacoco report shows n/a

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Jenkins Jacoco plugin shows 0% branch coverage on Classes and packages with no branch logic. For the same class the Jacoco report correctly shows an n/a .

        Attachments

          Activity

          Hide
          inquisitive anshu pitlia added a comment -

          I too have this issue. Is anyone looking into it?

          I am using 1.0.19 version of jacoco plugin for jenkins.

          Show
          inquisitive anshu pitlia added a comment - I too have this issue. Is anyone looking into it? I am using 1.0.19 version of jacoco plugin for jenkins.
          Hide
          tibor17 Tibor Digana added a comment -

          Jeremy Brown
          Jeremy Brown
          I had the same problem when I built jacoco.exe with Maven plugin version 0.7.5 however Jankins JaCoCo plugin version was 1.0.x. The versions 1.0.x should use Maven plugin version 0.7.4 or lower.

          After my admin did upgrade of Jenkins plugin to version 2.0.0 the problem disappeared with Maven plugin version 0.7.5.<timestamp>. Although the graph is displayed I found another issue JENKINS-32528.

          Show
          tibor17 Tibor Digana added a comment - Jeremy Brown Jeremy Brown I had the same problem when I built jacoco.exe with Maven plugin version 0.7.5 however Jankins JaCoCo plugin version was 1.0.x. The versions 1.0.x should use Maven plugin version 0.7.4 or lower. After my admin did upgrade of Jenkins plugin to version 2.0.0 the problem disappeared with Maven plugin version 0.7.5.<timestamp>. Although the graph is displayed I found another issue JENKINS-32528 .
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Kevin Scaldeferri
          Path:
          resources/test/multiple.png
          src/main/java/hudson/plugins/jacoco/model/Coverage.java
          src/test/java/hudson/plugins/jacoco/CoverageTest.java
          src/test/java/hudson/plugins/jacoco/model/CoverageObjectGraphTest.java
          src/test/java/hudson/plugins/jacococoveragecolumn/JaCoCoColumnTest.java
          http://jenkins-ci.org/commit/jacoco-plugin/174dbd90ab3ffbaaceb07664d57649cefc06d97d
          Log:
          Report 100% for empty Coverage objects

          If a section of code has no branches, we should report 100% branch coverage
          not 0% coverage. This prevents spurious threshold violations for such code.

          (This concern also applies to other coverage measures, although in practice
          I've only encountered this problem for branches.)

          Fixes JENKINS-25076 and JENKINS-29117

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kevin Scaldeferri Path: resources/test/multiple.png src/main/java/hudson/plugins/jacoco/model/Coverage.java src/test/java/hudson/plugins/jacoco/CoverageTest.java src/test/java/hudson/plugins/jacoco/model/CoverageObjectGraphTest.java src/test/java/hudson/plugins/jacococoveragecolumn/JaCoCoColumnTest.java http://jenkins-ci.org/commit/jacoco-plugin/174dbd90ab3ffbaaceb07664d57649cefc06d97d Log: Report 100% for empty Coverage objects If a section of code has no branches, we should report 100% branch coverage not 0% coverage. This prevents spurious threshold violations for such code. (This concern also applies to other coverage measures, although in practice I've only encountered this problem for branches.) Fixes JENKINS-25076 and JENKINS-29117
          Hide
          centic centic added a comment - - edited

          We now report 100% for such branches via https://github.com/jenkinsci/jacoco-plugin/pull/79, this will be included in the next release.

          Show
          centic centic added a comment - - edited We now report 100% for such branches via https://github.com/jenkinsci/jacoco-plugin/pull/79 , this will be included in the next release.

            People

            • Assignee:
              ognjenb Ognjen Bubalo
              Reporter:
              jeremyjjbrown Jeremy Brown
            • Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: