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

Tarpaulin not working if absolute file path contains a dot #682

Closed kaenganxt closed 3 years ago

kaenganxt commented 3 years ago

Describe the bug Running tarpaulin in my development environment worked fine, but running it on our CI platform (Jenkins) did not produce any results. Looking at the code, this is caused by the is_hidden function filtering out folders starting with a dot in the absolute file path. Since Jenkins places its default workspace in ~/.jenkins/, all files were ignored.

To Reproduce Place a Cargo project inside a folder starting with a dot and run tarpaulin.

Expected behavior Parent folders starting with a dot should not influence if a file is considered or not. The is_hidden function should only consider dots inside the project folder.

xd009642 commented 3 years ago

Thanks for the issue, I've just added a fix and test for this. It might be a while until my next release (need to solve some other issues) so in the meantime you can install the latest version on the develop branch.