kennytm / cargo-kcov

Cargo subcommand to run kcov to get coverage report on Linux
127 stars 20 forks source link

cargo kcov does not properly upload to coveralls and codecov #21

Closed Robbepop closed 6 years ago

Robbepop commented 6 years ago

I switched from my old way to perform code coverage analysis to your neat cargo kcov utility for that purpose and while there seems to be no errors during a travisCI run there are no longer any proper uploads to coveralls or codecov for my project.

My old .travis.yml and my new (broken) .travis.yml can be found in those two links.

It seems that the coverage is computed and sent but when visiting coveralls and codecov it seems to arrive broken or empty or ... I don't actually know what exactly happens. :S

Here is the travis CI output of the latest run.

Links to my currently broken codecov and coveralls results:

Using cargo kcov locally works just fine and properly generates the correct coverage info in my target/cov/ repo folder.

I really hope you can help me find the source of the error or tell me what I did wrong in using your cargo kcov in my .travis.yml.

kennytm commented 6 years ago

Hi.

I've reproduced the problem with the new .travis.yml, but I noted that your old .travis.yml was targeting the debug build, while the new one uses --release. There is no problem generating coverage when removing the --release flags.

kcov relies on debug symbols. Since release build by default won't generate debug symbols, the coverage will be empty. If you must use release build, try to enable the debug symbols with

# in your Cargo.toml

[profile.bench]
debug = 2
Robbepop commented 6 years ago

Thank you very much for your analysis. I never would have guessed that the problem is the --release ... Also thank you for providing a hint how to handle debug info with release configs.

My project does not require compiler optimizations, however, there seems to be no compilation overhead but the tests run a lot faster. (x5-10)