Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Why are history files showing higher coverage that the coverage report created at the same time?

Rich Kolkmeier March 7, 2018

I am using history files to verify our code coverage does not decrease with releases. I am creating reports and history files through maven commands clover:clover and clover:save-history.  After creating a history file, I execute a build with the same version of code.  I get the same code coverage as the initial run, but the clover:check command indicates that we have less coverage than the history file.  The history file shows indicates a higher code coverage percentage.

Has anyone encountered this? 

 

1 answer

0 votes
Rich Kolkmeier March 15, 2018

After running several tests, I have discovered the difference in the historical coverage and the current report is centered around whether you are including the the test source code in the coverage metrics.  The current report breaks the coverage down into two sections, one for the application source code and one for the test source code.  The historical coverage includes both the application source code and the test source code into a single coverage metric.  When running the clover:check goal, the plugin compares the application source code coverage in the current report to the historical report that contains both the application and test source code.  The historical coverage is higher because the test source coverage is close to 100% which increases the overall coverage metric.  The historical coverage and the current report coverage are similar if the includeTestSourceRoots is set to false.

Has anyone else seen this or have a suggestion on configurations in the report descriptor that will keep from using the test source code in the history reports?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events