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

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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • jacoco-plugin
    • None

      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 .

          [JENKINS-25076] Jenkins Jacoco plugin shows 0% branch coverage when jacoco report shows n/a

          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.

          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.

          Tibor Digana added a comment -

          jeremybrown2
          jeremyjjbrown
          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.

          Tibor Digana added a comment - jeremybrown2 jeremyjjbrown 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 .

          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

          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

          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.

          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.

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

              Created:
              Updated:
              Resolved: