A coverage report for a C file shows mostly reasonable results. However, a few lines which are clearly code that must have been executed are shown in white, not in green. Yet the gcov data includes them. Soo Codecov seemingly randomly skips some lines in its display.
It is shown in white, i.e. not even as uncovered code. Moreover, inspecting the gcov uploads for that commit, e.g. this, the line is clearly reported as being covered. Here is an excerpt of the relevant part, I marked the relevant line
...
# path=src#io.c.gcov.reduced
-: 0:Source:src/io.c
func
#####:105:
73289723:107:
func
#####:110:
...
34:836:
34:839:
func
#####:851:
#####:853:
branch 0 never executed::
branch 1 never executed::
call 2 never executed::
#####:856:
#####:857:
#####:858:
#####:859: <--- this is the line, reported as covered code like all before and after
#####:860:
#####:861:
#####:862:
#####:863:
#####:864:
#####:867:
#####:870:
func
29:891:
...
There are more examples in that file, e.g. line 1133, 1196, 1197, 1220
There definitely is a filename collision; there are several files called io.c involved, but we only care about one. We’ve been fighting with this over the years, and in the end the only way I found to get Codecov to ignore all those other files was to make sure they are built without coverage tracking turned on (which requires quite some hacking on our side).
Among the things we tried was to add exclude the directories with the “bad” files via .codecov.yml, like this:
But that didn’t work. We also invoke codecov.sh like this, but it doesn’t seem to do anything either: ./codecov.sh -f '!./pkg/*' -f '!./extern/*' -f '!./build/*'.
I’ll try the -X fix you suggest, though I wonder what it does? The description on Fixing Reports is … not helpful. It lists some factoids about various languages, but doesn’t actually say what it “fixes” about them. Also, there seem to be some markdown and/or rendering issues on that page.