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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False negatives in Rust code coverage #934

Closed
praseodym opened this issue Jan 30, 2025 · 3 comments · Fixed by #935
Closed

False negatives in Rust code coverage #934

praseodym opened this issue Jan 30, 2025 · 3 comments · Fixed by #935
Assignees
Labels
backend Issues or pull requests that relate to the backend continuous-integration rust Pull requests that update Rust code tests Issues or pull requests that relate to tests

Comments

@praseodym
Copy link
Contributor

The Rust code coverage has some obvious false negatives in lines with only a constant value, e.g. in backend/src/error.rs:
Image

Related: xd009642/tarpaulin#351

@praseodym praseodym added backend Issues or pull requests that relate to the backend continuous-integration rust Pull requests that update Rust code tests Issues or pull requests that relate to tests labels Jan 30, 2025
@praseodym praseodym self-assigned this Jan 30, 2025
@github-project-automation github-project-automation bot moved this to Options in Abacus Jan 30, 2025
@praseodym
Copy link
Contributor Author

Another project (EnergySystemsModellingLab/MUSE_2.0#236) switched to cargo-llvm-cov, I'm going to give that a try.

@praseodym praseodym moved this from Options to In Progress in Abacus Jan 30, 2025
@praseodym
Copy link
Contributor Author

cargo-llvm-cov looks a lot better, the same lines in backend/src/error.rs are now properly covered:
Image
And cargo-llvm-cov also works with Rust stable (Tarpaulin required Rust nightly), which makes it easier to integrate into our regular backend build job.

@Lionqueen94
Copy link
Contributor

cargo-llvm-cov looks a lot better, the same lines in backend/src/error.rs are now properly covered: Image And cargo-llvm-cov also works with Rust stable (Tarpaulin required Rust nightly), which makes it easier to integrate into our regular backend build job.

I think it did state that branch coverage only works with nightly: "Generate very precise coverage data. (line, region, and branch coverage. branch coverage is currently optional and requires nightly, see taiki-e/cargo-llvm-cov#8 for more)"

@github-project-automation github-project-automation bot moved this from In Progress to Done in Abacus Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Issues or pull requests that relate to the backend continuous-integration rust Pull requests that update Rust code tests Issues or pull requests that relate to tests
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants