Typically, if I have something (a microservice) that is 100% covered both for lines and branches, neither JaCoCo or Cobertura will show it properly unless I do some things. Here are some examples of the type of things I have to do:
I have quite a few projects where I’ve gotten Cobertura to correctly show 100% line/branch coverage and many with it showing 99% so I set my build thresholds to around 97 or 98 to make sure I catch anything changing that but it takes some time to arrange things to be correctly measured.
VP, Technical Architecture Solutions
RGA Reinsurance Company
16600 Swingley Ridge Road
Chesterfield, Missouri 6301701706
External e-mail. Use caution! / Courriel externe. Faites attention!
Groovy has done a lot of work recently to mark generated methods with an @Generated annotation. We have other generated methods which are synthetic methods. I know JaCoCo has been making changes to ensure that such methods aren't included in coverage analysis. I am not sure whether Cobertura has done any updates along those lines. It did appear for a while that activity on Cobertura was decreasing but I notice there was some activity a few months ago. It is perhaps worth asking that community about whether they have or can consider making similar changes, otherwise perhaps switching to JaCoCo might be the way to go.
On Fri, Jun 21, 2019 at 3:02 AM Sean LeBlanc <email@example.com> wrote:
What are people using currently to get accurate code coverage from new(ish) versions of Groovy? We are on 2.4.10 and I see similar issues as what this thread is talking about:
Does anyone have good experiences with getting more accurate code coverage numbers with Groovy > 2.0.8? And what route did you take?