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

Tarpaulin not reporting per-package coverage in workspaces? #1185

Open
maxburke opened this issue Jan 20, 2023 · 5 comments
Open

Tarpaulin not reporting per-package coverage in workspaces? #1185

maxburke opened this issue Jan 20, 2023 · 5 comments
Assignees

Comments

@maxburke
Copy link

My workspace has about 30 packages and I am trying to report coverage per-package in the workspace but right now if I run tarpaulin on a single package, either via cargo tarpaulin -p package1 or by running cargo tarpaulin in the package directory, it reports coverage numbers for all the other packages, and so the resulting the coverage numbers reported are very low.

Is there a way to have coverage reported for only the package on which it is invoked?

@maxburke maxburke changed the title Tarpaulin not reporting per-package coverage in workspaces Tarpaulin not reporting per-package coverage in workspaces? Jan 20, 2023
@xd009642
Copy link
Owner

You should be able to do it by just cd'ing into the package and running cargo tarpaulin there. If the package makes use of code from other packages an --exclude-files ../* might work (I'd have to check that but also globs are changing impl soon)

@maxburke
Copy link
Author

Ah; the --exclude-files flag worked. Thanks!

@gitmalong
Copy link

gitmalong commented Jan 6, 2024

cd mypackage # workspace member
cargo tarpaulin --exclude-files ../* -p appsuite-mypackage

That does not work in my case. It reports coverage for all packages (even non workspace members as it seems the workspace's exclude is not taken into account but that might be another topic.. ).

cargo-tarpaulin-tarpaulin 0.27.2

@maxburke
Copy link
Author

maxburke commented Jun 1, 2024

I'm seeing a regression here; if I run cargo tarpaulin -p mypackage --exclude-files ../* I still get all the other workspace package code showing up in my coverage. It doesn't matter if I quote the glob to prevent shell expansion or not, it seems to happen regardless.

@maxburke maxburke reopened this Jun 1, 2024
@cxyzhang0
Copy link

Same here - I tried my things but still I cannot get only the coverage for a single package in a multi-package workspace. I am using cargo-tarpaulin-tarpaulin 0.31.4.
Any idea how?

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

4 participants