Can I specify finer-grained thresholds for certain classes?

163 views
Skip to first unread message

andrey...@gmail.com

unread,
Jun 16, 2015, 8:59:40 AM6/16/15
to jac...@googlegroups.com
Hello!

I use JaCoCo maven plugin. Can I specify finer-grained thresholds for certain classes (TOTALCOUNT, COVEREDCOUNT, MISSEDCOUNT, COVEREDRATIO, MISSEDRATIO etc)? Something like finer-grained thresholds for certain classes using regular expressions in cobertura.
https://github.com/cobertura/cobertura/wiki/Ant-Task-Reference

I've already tried to use <includes> in rule specification but it doesn't work.

For example:

<configuration>
<haltOnFailure>true</haltOnFailure>
<rules>
<rule element="PACKAGE">
<includes>
<include>com.package_name.SomeClass</include>
</includes>
<limits>
<limit counter="LINE" value="COVEREDRATIO"><minimum>0.90</minimum></limit>
</limits>
</rule>
</rules>
</configuration>

Thank you in advance!

Evgeny Mandrikov

unread,
Jun 17, 2015, 12:32:43 PM6/17/15
to jac...@googlegroups.com, andrey...@gmail.com, andrey...@gmail.com
Hi,

I believe that usage of "/" (slash) instead of "." (dot) as a package name separator should solve this issue.

Best regards,

Evgeny Mandrikov

unread,
Jun 17, 2015, 2:42:18 PM6/17/15
to Andrew Selkin, jac...@googlegroups.com
Thanks for sample - I'll take a look on it soon.

P.S. I've added group back into list of recipients - in future please post answers back into group instead of private emails.

On Wed, Jun 17, 2015 at 8:08 PM, Andrew Selkin <andrey...@gmail.com> wrote:
It still doesn't work correctly. I created the simple test project and used "/" instead of "." as a package name separator. I also created the empty test class so coverage should be 0% and set threshold of line coverage to 0.90 (90%) in JaCoCo maven plugin configuration but haltOnFailure flag doesn't halt the build.





--
С уважением,
Андрей Селькин



--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_

Evgeny Mandrikov

unread,
Jun 17, 2015, 3:19:54 PM6/17/15
to jac...@googlegroups.com, mand...@gmail.com, andrey...@gmail.com
Excuse me, I was wrong about slashes. Problem of original configuration - "element" specified as attribute and not as a child node. Fix for sample test project - https://github.com/MEZk/JaCoCoTest/pull/1

Best regards,


On Wednesday, June 17, 2015 at 8:42:18 PM UTC+2, Evgeny Mandrikov wrote:
Thanks for sample - I'll take a look on it soon.

P.S. I've added group back into list of recipients - in future please post answers back into group instead of private emails.



--
С уважением,
Андрей Селькин
andreyselkin@...
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages