Open Bug 1742984 Opened 3 years ago Updated 3 years ago

Add basic assertions in coverage parsing code to ensure the results are sane

Categories

(Testing :: Code Coverage, enhancement)

Default
enhancement

Tracking

(Not tracked)

People

(Reporter: marco, Unassigned)

Details

We could select a file that we know isn't going to go away any time soon and which is definitely at least partially covered, then in https://searchfox.org/mozilla-central/rev/ac7a567f036e1954542763f4722fbfce041fb752/testing/mozharness/mozharness/mozilla/testing/codecoverage.py#293 and https://searchfox.org/mozilla-central/rev/ac7a567f036e1954542763f4722fbfce041fb752/testing/parse_build_tests_ccov.py#79 assert that there is a "SF:path/to/chosen/source/file" entry with at least one DA with a count > 0.

If we had this, we would have caught bug 1742652 earlier.

I think we can pick up the file containing the main function or maybe just check for the main function itself.
Another thing we could do is to get the artifact from the day before and compare the total coverage percentage and compare with the last one.
I guess if the diff is greater than 1,2,...5 % there is likely something wrong.

You need to log in before you can comment on or make changes to this bug.