Add support for `cargo test`s --skip and --exact command line flags
Opened this issue · 1 comments
Hi, I was just looking for an issue about --skip
in nextest and found #29 which is saying that these are supported, but using different syntax. This is problematic for my use case since I have a test script that runs cargo nextest run
if available, but falls back to regular cargo test
if nextest is not installed. I also think that for interactive usage, --skip
and --exact
are much easier to use than the filter expression syntax.
Would you consider adding support for these flags? The implementation could just instantiate the appropriate filter expressions internally, so it should be really simple.
Hi -- I was hesitant to add this at first, but over the last few months I've changed my mind. I'm happy to accept a PR for this. Some notes:
--skip
and--exact
should only be accepted aftercargo nextest run --
-- the point after--
is where we accept test binary args. Seenextest/cargo-nextest/src/dispatch.rs
Lines 606 to 629 in 02a0cf0
- Just like the existing support, filter expressions must be ANDed with them. i.e. if both a filter expression and
--skip
/--exact
is passed in, both should be matched for a test to be run. - I'm not exactly sure of the semantics of
--skip
and--exact
especially when they're passed in together, so a full description of the semantics, with tests would be wonderful.