xd009642 / tarpaulin

A code coverage tool for Rust projects
https://crates.io/crates/cargo-tarpaulin
Apache License 2.0
2.5k stars 180 forks source link

Generated `cobertura.xml` has empty `filename` field #857

Closed MPThLee closed 2 years ago

MPThLee commented 2 years ago

Describe the bug: I got some bug about codecov stuck on Processing.... I just contact to them and received this response: the cobertura.xml file that you are uploading has a file without a filename. (See this) I'm using github action for testing coverage. GHA log is here: https://github.com/MPThLee/binary-reader.rs/runs/3983116585?check_suite_focus=true Note that I'm using xd009642/tarpaulin:develop-nightly with --security-opt seccomp=unconfined

To Reproduce Please checkout my repository that testing now. https://github.com/MPThLee/binary-reader.rs

Expected behavior Should have proper filename. I think.

xd009642 commented 2 years ago

This is really interesting, just running it normally (with debug output) gives:

|| Uncovered Lines:
|| src/lib.rs: 66-70, 79, 83-88, 101-102, 105-106, 110-113, 120-122, 135, 139-144, 156-158, 177, 180, 188, 191, 199, 202, 210, 212-213, 221, 223-224, 238, 240-241, 249, 251-252, 260, 262-263
|| Tested/Total Lines:
|| : 115/169 +0.00%
|| src/lib.rs: 67/121 +0.00%
|| src/tests.rs: 48/48 +0.00%
|| 

So it definitely thinks there's an unnamed file, either in the DWARF tables and I have failed to handle that edge case... Or somewhere else. I'll have a look deeper to find it, but this is definitely a unique (and maybe fun) issue :thinking:

EDIT: It's because of the .rs in the project name, I'll find where the missing is_file() check should be then make a PR, test to prevent regression and maybe drop a new release later today

xd009642 commented 2 years ago

Once this CI passes I'll merge the PR and then at some point the new docker images will build and push for you

MPThLee commented 2 years ago

lmao, it caused by directory name. Anyways, Thanks for fix this issue!