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

Version 0.18.1 breaks using --test-threads 1 #819

Closed
jonasbb opened this issue Sep 4, 2021 · 2 comments
Closed

Version 0.18.1 breaks using --test-threads 1 #819

jonasbb opened this issue Sep 4, 2021 · 2 comments
Assignees

Comments

@jonasbb
Copy link

jonasbb commented Sep 4, 2021

I run cargo-tarpaulin on CI using stable Rust with --workspace --all-features -- --test-threads 1 as arguments. This worked fine, but with version 0.18.1 I get an empty coverage result. I noticed it first on this PR which only modifies documentation, so should not have any effect on the coverage.

I did not modify the CI environment. The only difference is that tarpaulin released a new version, which got picked up.
I can reproduce the problem locally too, by installing either version 0.18.0, which works as expected, or version 0.18.1, which shows 0 coverage. I could reproduce it with cargo 1.54.0 (5ae8d74b3 2021-06-22) and cargo 1.56.0-nightly (cc17afbb0 2021-08-02). I used the serde_with crate to verify the bug.

# cargo-tarpaulin version: 0.18.0
cargo tarpaulin --workspace --all-features --out Html -- --test-threads 1
76.78% coverage, 2076/2704 lines covered, +0% change in coverage

# cargo-tarpaulin version: 0.18.1
cargo tarpaulin --workspace --all-features --out Html -- --test-threads 1
0.00% coverage, 0/2704 lines covered, -76.77514792899409% change in coverage

The problem seems to be that --test-threads 1 no longer specifies a number of threads, but gets interpreted as a filter which tests to run. None of the tests run, thus I get a 0 coverage.

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 6 filtered out; finished in 0.00s

I would expect that the version of tarpaulin has no effect on how these arguments are parsed, since this way worked since at least 1.5 years without problems. It seems that --test-threads=1 (with an = sign) still works and limits the testing to a single thread.

jonasbb added a commit to jonasbb/serde_with that referenced this issue Sep 4, 2021
bors bot added a commit to jonasbb/serde_with that referenced this issue Sep 4, 2021
357: `--test-threads 1` is broken on tarpaulin 0.18.1 r=jonasbb a=jonasbb

But using an `=` sign works.

xd009642/tarpaulin#819

bors merge

Co-authored-by: Jonas Bushart <jonas@bushart.org>
@xd009642
Copy link
Owner

xd009642 commented Sep 5, 2021

I've just tracked down the issue that caused this, just sorting out a test to prevent another regression and I'll push out a 0.18.2 later today 👍

xd009642 added a commit that referenced this issue Sep 5, 2021
@jonasbb
Copy link
Author

jonasbb commented Sep 5, 2021

Thanks for fixing this issue so quickly :)

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