nextest-rs / nextest

A next-generation test runner for Rust.
https://nexte.st
Apache License 2.0
2.2k stars 97 forks source link

[CLI difference] `cargo test -j4` also sets the number of build jobs #833

Closed jalil-salame closed 1 year ago

jalil-salame commented 1 year ago

Problem

cargo test and cargo nextest run differ in their API:

Cargo test only has -j/--jobs to specify the parallelism. Nextest uses --build-jobs and --test-threads.

While I do agree with the separation, -j setting just the value for --test-threads is surprising.

Proposed solution

Add a third option: -j/--jobs which sets the value for both --test-threads and --build-jobs, specifying --build-jobs/--test-threads explicitely overrides the value from -j/--jobs.

sunshowers commented 1 year ago

Thanks for the report! Unfortunately -j is already taken for --test-threads, which limits our options.

I think we're just going to have to live with this incompatibility. I think your suggestion would have definitely been better overall, but it's too late to change to that.

jalil-salame commented 1 year ago

Maybe keep it in mind if there ever is a 2.0 release/backwards incompatible release?

sunshowers commented 1 year ago

Yeah, for sure.