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

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

    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

          Issue Links

            Activity

            jeremyjjbrown Jeremy Brown created issue -
            jeremyjjbrown Jeremy Brown made changes -
            Field Original Value New Value
            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 . 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 . This skews the aggregate branch coverage report towards a false decline.
            jeremyjjbrown Jeremy Brown made changes -
            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 . This skews the aggregate branch coverage report towards a false decline. 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 .
            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.
            inquisitive anshu pitlia made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            inquisitive anshu pitlia made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            inquisitive anshu pitlia made changes -
            Status In Progress [ 3 ] Open [ 1 ]
            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 .
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 158977 ] JNJira + In-Review [ 179812 ]
            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.
            centic centic made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            centic centic made changes -
            Link This issue is related to JENKINS-56123 [ JENKINS-56123 ]

              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: