Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

"0.00% coverage" reported when rustflags contains -C debuginfo=0 #601

Closed
Turbo87 opened this issue Oct 23, 2020 · 9 comments
Closed

"0.00% coverage" reported when rustflags contains -C debuginfo=0 #601

Turbo87 opened this issue Oct 23, 2020 · 9 comments

Comments

@Turbo87
Copy link

Turbo87 commented Oct 23, 2020

In rust-lang/crates.io#2951 I've added https://github.com/actions-rs/tarpaulin to the CI pipeline of crates.io, but unfortunately it currently reports "0.00% coverage" and I'm out of ideas of what I might be doing wrong 馃槥

The project definitely does have tests so the coverage should be at least above zero. Any help would be greatly appreciated! 馃檹

@xd009642
Copy link
Owner

xd009642 commented Oct 23, 2020

Interesting, I'll try running locally and see if I can figure it out. Edit: if there are any tips for running locally would be appreciated 馃槄

@Turbo87
Copy link
Author

Turbo87 commented Oct 25, 2020

I'll try running locally and see if I can figure it out

that would be great, thanks! :)

if there are any tips for running locally would be appreciated

riiight, I totally forgot about the necessary test setup... 馃槄

I hope https://github.com/rust-lang/crates.io/blob/master/docs/CONTRIBUTING.md#working-on-the-backend and https://github.com/rust-lang/crates.io/blob/master/docs/CONTRIBUTING.md#running-the-backend-tests should give you all the necessary information. If not, let me know if something is missing. :)

@xd009642
Copy link
Owner

I haven't gotten to this yet (been busy), but I'm releasing a fairly significant update to tarpaulin tonight or tomorrow so if you want to try it there's always the chance it may now work due to one of the new features or linker changes.

@xd009642
Copy link
Owner

@Turbo87 So I managed to get the tests running locally and with cargo-tarpaulin 0.16.0 and rustc 1.49.0 I get coverage results (82.01% coverage, 6837/8337 lines covered). I've hosted my own version just to check with actions what happens in CI as CI doesn't run on forks but if the issue persists on CI but not locally it's probably not going to be straightforward to track this down

@Turbo87
Copy link
Author

Turbo87 commented Jan 30, 2021

that's good news. I wasn't even able to get it running locally, but maybe I did something wrong. did you just run it with the defaults?

@xd009642
Copy link
Owner

yeah I just followed the readme instructions, had to fiddle around with postgres just because diesel didn't seem happy doing the migration without a password but once the diesel migration worked and cargo test ran through cargo tarpaulin worked fine

@xd009642
Copy link
Owner

Oh I might have something, in the workflow it does: RUSTFLAGS: "-C debuginfo=0 -D warnings" now tarpaulin relies on debuginfo to map instructions to the source code. I've just removed the debuginfo removal and pushed it so I'll see if it reports coverage.

If it does I'll change this into an issue to prevent people from overriding debuginfo in a way that stops tarpaulin from working 馃槃

@xd009642
Copy link
Owner

@Turbo87 That sorted it! Removing -C debuginfo=0 gives you coverage results 馃帀

@xd009642 xd009642 changed the title "0.00% coverage" reported "0.00% coverage" reported when rustflags contains -C debuginfo=0 Jan 30, 2021
@Turbo87
Copy link
Author

Turbo87 commented Jan 30, 2021

awesome! I looked at git blame but I still can't tell why we have this enabled in the first place 馃槄

thanks a lot for your help!!

xd009642 added a commit that referenced this issue Feb 16, 2021
This detects if the user has set -Cdebuginfo in their rustflags and
removes this as tarpaulin sets it and requires it to get debug info for
traces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants