Open jwodder opened 2 years ago
I think I found the issue. grcov generate coverage information about dependencies and that information confuse the codecov. You can find my solution at the following link: https://github.com/erhanbaris/yummy/blob/main/.github/workflows/rust.yml Also here is the command:
grcov . \
--binary-path ./target/debug/deps/ \
--source-dir . \
--excl-start 'mod test* \{' \
--ignore 'tests/*' \
--ignore "*test.rs" \
--ignore "*tests.rs" \
--ignore "*github.com*" \
--ignore "*libcore*" \
--ignore "*rustc*" \
--ignore "*liballoc*" \
--ignore "*cargo*" \
-t coveralls+ \
--token ? \
-o ./cov_normal.json
Codecov shows correct coverage information now. I hope that information will help you.
I don't know whether this is a problem with grcov or Codecov, but you seem more accessible, so I'll start here.
I am attempting to set up coverage reporting of my Rust project using grcov and codecov.io. When I generate HTML coverage reports locally like so:
then the coverage is shown as 88.61%, and the report (mostly) makes sense. However, when I upload a report to codecov from GitHub Actions with the following workflow:
then the coverage is shown as 48.21%, and much of the report does not match the HTML report, nor does it make much sense.
For example, compare this section of the HTML report:
with the corresponding section in codecov's report:
Another example: In the HTML report, all of the lines shown below are neither hit nor missed, yet codecov shows a mixture of hit & missed lines, including some of both in the comments!
In addition, I previously had my tests in my
src/lib.rs
file but later moved them totests/
. When they were insrc/lib.rs
, I was able to get the HTML report to show the tests as neither hit nor missed, yet Codecov showed the tests as largely missed, with some hits thrown in.You can find the report uploaded to codecov for the "stable" run of this commit here: https://github.com/mozilla/grcov/files/9072729/build.txt.