Hi all, something of a convoluted question here.

Is there any way I can generate an "empty" or "all red" coverage report, even 
when no code in a project has been called?

I'll share my use case so that this hopefully makes more sense. I'm using maven 
and the jacoco-maven-plugin.

Internally, the team I work for has a maven plugin that calculates how much 
coverage a given GitHub pull request has. We don't want to check the code 
coverage of the project as a whole as some of them are legacy projects with 
close to 0% and we just want to enforce the adding of tests for new changes.  
Our method is as follows: we check the git diff vs master, see which lines of 
which files in this diff appear in some coverage report and then figure out 
what percentage of those has code coverage. 

Here is the current issue we are having: there is one project in a particularly 
bad state with literally zero tests. Since there are no tests, no jacoco.exec 
file is output at the end of the maven test lifecycle, so no report is 
generated. This obviously makes sense since a module could be config or some 
other non-java code that jacoco is not interested in. However, in our case we 
are left with no way of determining which lines are executable in the project 
and therefore default to thinking it is not coverable meaning that until at 
least one test is added, all PRs will pass our checks. 

Is there any way to force the creation of a jacoco.exec file that just says 
there were no lines covered at all? Is this option exposed in the jacoco maven 
plugin?

Thanks,
K

-- 
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/f3c22155-146e-45d0-a04e-5204beffe7d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to