In 5.5 we have introduced a new metric executable_lines that is used to default UT line coverage to zero when no data is provided by sensors. The problem is that as soon as you have a few files covered by ITs the global metrics are not consistant.
Example: let say we have a project with 2 files. FileA and FileB. Each file has 10 executable lines correctly reported by language plugin.
1) When no coverage is reported at all, current behavior is to save 0 UT hits on each executable line. We don't save IT hits to avoid the UI to start displaying ITs metrics/coverage when most projects have no IT. OK.
2) Now let say Jacoco reports 5/10 UT covered lines on FileA (FileB is uncovered). The platform will save 0 hits on FileB. UT coverage of is 50% for FileA, 0% for FileB, 25% for the project. Still no IT / Overall coverage displayed in UI. OK.
3) Now use the same JaCoCo report as IT coverage (no UT). IT coverage is 50% for FileA, unset for FileB, so 50% for the project => KO inconsistent with case 2.
4) Now use the same report twice, once for UT and once for ITs:
- FileA: UT=50% IT=50% Overall=50%
- FileB: UT=0% IT=unset Overall=unset
- Project: UT=25% IT=50% Overall=50%
We have two opposite requirements:
- in a perfect world we would like to compute UT and IT coverage of all files.
- but we don't want to show "red bar" on all files because of missing ITs since this is too aggressive.