rust-covfix icon indicating copy to clipboard operation
rust-covfix copied to clipboard

Why not fix?

Open TriplEight opened this issue 5 years ago • 4 comments

Thanks for the great project! And great documentation as well! I've just managed to set it up working with grcov and it actually does report better.

Nevertheless, I wanted to ask: why is it a standalone project and not a contribution to grcov? This and that it is pretty young and doesn't have much stars and maintainers make it less trustworthy and fewer projects will afford using it.

TriplEight avatar May 04 '20 18:05 TriplEight

Hi @TriplEight ! Thanks so much for using rust-covfix and giving me a star :star2:

There are 3 reasons why rust-covfix is developed as standalone package.

  1. A grcov collaborator is aware of rustc reporting incorrect coverage (https://github.com/mozilla/grcov/issues/249#issuecomment-465154051). I'm trying to compare original Rust code and transformed LLVM IR, but still don't fully understand why Rustc report incorrect coverage. The rust-covfix was originally developped as a temporal workaround for this problem until I understand when and where rustc reports incorrect coverage. It is not completely unraveled yet.

  2. grcov is just a coverage collection tool, not a coverage generator. It only aggregates the raw coverage data, and convert the format. It does not read the source code, nor manipulate any coverage data. Also, although grcov is targetting many programming languages such as C/C++, Nim and Rust, rust-covfix only supports Rust.

  3. rust-covfix is targetting not only grcov, but also cargo-kcov and Tarpaulin in the future. Actually, Tarpaulin can now generate the lcov.info. It means rust-covfix is already able to fix the coverage data generated by Tarpaulin. I'm working on feature/cobertura branch to support cargo-kcov too. The final objective is to support these 3 tools.

Kogia-sima avatar May 05 '20 21:05 Kogia-sima

Yeah, I see, thanks for the explanation! Last week I was setting the code coverage for the first time and had to do a little research. If you are interested

  • from kcov, grcov and tarpaulin really liked the latter, it does the better job than grcov, but tarpaulin can't run without decreasing docker security, so had to stick with grcov.
  • from codecov.io and coveralls.io chose codecov. Neither of them has anything special for Rust yet, codecov just does fancy comments to PR and more feature-rich.
  • finally found your project and was happy making coverage better and more honest with it.

If you want some data, you can see our reports here. It's from https://github.com/paritytech/ink

TriplEight avatar May 06 '20 10:05 TriplEight

Would be great to copy paste this explanation into the readme as I am sure everyone wonders this. Great answers btw!

Sent with GitHawk

gilescope avatar May 08 '20 07:05 gilescope

@TriplEight @gilescope Thank you all for feedback comments!

Again, rust-covfix is a temporary workaround. It still miss some incorrect line/branch coverages. If you really need a reliable coverage, you may want to disable the branch coverage. Branch coverages are sometimes weird and dishonest (e.g. pattern match context).

Kogia-sima avatar May 09 '20 02:05 Kogia-sima