My hypothethical scenario is this:
- I have run my junit tests and generated a jacoco file
- my git diff shows I have changed 10 lines of code
Now the intersection of my git diff and the jacoco information is that 7 of the 10 lines of code changed are covered. ie - I have 70% coverage on new code.
But I had to work that out manually.
I'd like an automated way to work out the percentage how many new lines of code are covered.
My question is: Is there a way to get unit coverage percentage (eg from jacoco) on only new code?
(Note I know sonarqube can do this if you run the scanner with analysis.mode=publish
and get interrogate the task result with the JSON API - I'm looking for something lightweight that a developer can run locally.)