Hi Randall,

good to hear that JMRI uses JaCoCo :)

Indeed in 0.8.3 we added empty classes to our reports: 
https://github.com/jacoco/jacoco/pull/817 
<https://github.com/jacoco/jacoco/pull/817>

In your configuration this leads to the side effect you’re describing for empty 
classes (e.g. interfaces without default methods). As a workaround you can 
specify a very low minimum coverage ratio, like this:

<rule>
  <element>SOURCEFILE</element>
  <limits>
    <limit>
      <counter>LINE</counter>
      <value>COVEREDRATIO</value>
      <minimum>0.00001</minimum>
    </limit>
  </limits>
</rule>

The ratio is not checked in case of empty classes.

Regards,
-marc



> On 15. Dec 2019, at 17:33, [email protected] wrote:

> In the JMRI project[1], we use JaCoCo to ensure:
> - all classes have some coverage
> - coverage does not fall below a specified threshold
> 
> I tried to update JaCoCo from version 0.8.2 and 0.8.3 [2] (0.8.5 shows the 
> same behavior), and the Travis CI tests began failing with every interface 
> without a default method not explicitly excluded from the coverage report 
> with "lines covered count is 0, but expected minimum is 1".
> 
> Is there a way to exclude interfaces without default methods from the 
> coverage report to avoid the need to manually exclude each and every one 
> individually (our coverage count is too low to switch on a coverage 
> requirement for every method at this point)?
> 
> The pom.xml that is in use is at 
> https://github.com/rhwood/JMRI/blob/codecov/pom.xml (or would it be 
> preferable to copy into a message?)
> 
> [1]: https://github.com/JMRI/JMRI
> [2]: https://github.com/rhwood/JMRI/tree/codecov
> 
> -- 
> 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 [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jacoco/38366ba0-1862-49f7-bf97-c9a9567228b0%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jacoco/38366ba0-1862-49f7-bf97-c9a9567228b0%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/0AD592FC-EBEF-4D5E-937B-6B54ED1F66D0%40mountainminds.com.

Reply via email to