nextest-rs / nextest

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

feat: support hyphen values for --build-jobs #1874

Closed mattsse closed 2 weeks ago

mattsse commented 2 weeks ago

cargo --jobs supports negative values: https://github.com/rust-lang/cargo/issues/9217

currently this fails:

cargo nextest run --build-jobs -1                                                                                                                                                                                                   
error: unexpected argument '-1' found

  tip: to pass '-1' as a value, use '-- -1'

because clap doesn't support this by default and requires allow_hyphen_values = true

https://github.com/clap-rs/clap/issues/1245

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 79.65%. Comparing base (f6064a0) to head (8d6c414). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1874 +/- ## ======================================= Coverage 79.64% 79.65% ======================================= Files 80 80 Lines 20406 20409 +3 ======================================= + Hits 16253 16256 +3 Misses 4153 4153 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sunshowers commented 2 weeks ago

Thank you! Could you also add a test here?

https://github.com/nextest-rs/nextest/blob/866897046eb934e7d98273bc1512421b3091626c/cargo-nextest/src/dispatch.rs#L2350

sunshowers commented 2 weeks ago

Thank you!