I'm getting 0% branch coverage on code with no branch logic.

1,157 views
Skip to first unread message

Jeremy Brown

unread,
Oct 7, 2014, 10:23:14 AM10/7/14
to jac...@googlegroups.com
I'm getting 0% branch coverage on code with no branch logic. It's a package that just contains JPA classes and Spring Controller Templates which is very well tested using BoneCP and H2. If there are no branches to execute shouldn't the coverage be 100%? Maybe this seems like a quibble but these kinds of issues make our teams very hesitant to display code coverage information to the org, it's hard enough to get them to accept it already.

Marc R. Hoffmann

unread,
Oct 7, 2014, 5:17:33 PM10/7/14
to jac...@googlegroups.com
Can you please provide a specific example demonstrating the problem?

Regards,
-marc


On 07.10.14 16:23, Jeremy Brown wrote:
I'm getting 0% branch coverage on code with no branch logic. It's a package that just contains JPA classes and Spring Controller Templates which is very well tested using BoneCP and H2. If there are no branches to execute shouldn't the coverage be 100%? Maybe this seems like a quibble but these kinds of issues make our teams very hesitant to display code coverage information to the org, it's hard enough to get them to accept it already.
--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jeremy Brown

unread,
Oct 7, 2014, 6:06:51 PM10/7/14
to jac...@googlegroups.com
OK, Really this is just me being silly. The hashCode and equals methods certainly have branch logic.

Thanks, Jeremy

Jeremy Brown

unread,
Oct 8, 2014, 4:28:46 PM10/8/14
to jac...@googlegroups.com
Well, maybe I'm not so silly. I was thrown off by a checkin. Here is an example of what I believe is 0% branch on a class with no branch logic.

Marc R. Hoffmann

unread,
Oct 9, 2014, 10:59:47 AM10/9/14
to jac...@googlegroups.com
Hi Jeremy,

the native JaCoCo report would show "N/A" instead of 0% if there are no branches at all.

Your screen shot is the Jenkins plug-in which is not maintained by us. I recommend filing a bug at the respective project:

    https://wiki.jenkins-ci.org/display/JENKINS/JaCoCo+Plugin

Regards,
-marc

Jeremy Brown

unread,
Oct 9, 2014, 12:33:00 PM10/9/14
to jac...@googlegroups.com
Yes, Your correct. Thanks!

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages