-
Notifications
You must be signed in to change notification settings - Fork 71
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
Support pass-through for all arguments that cargo test
supports
#58
Comments
test-threads
argumentcargo test
supports
If anybody wishes to take on this issue, I'd be happy to mentor. |
@bbqsrc hello! |
Hi @privalou :) If we take an ordinary Rust crate and run I think the absolute first step to take would be to modify this code so that unsupported flags are captured in a "catch all" and printed as warnings. We are currently using clap for parsing command line input. You could experiment with enabling If this isn't feasible, or you're struggling, group back here and we'll chat again. 😄 |
Thanks for your guidance! But to be honest it is not quite clear to me how to implement "catch all" logic at cli.rs |
@privalou the premise is that if you have a mechanism that can catch all "unknown arguments" into a vector, you can handle them separately. If that list isn't empty, then it means some unknown arguments were parsed, but not handled. An example could be a hypothetical app called Why do this? Well, unhandled flags are blocking our test runner from continuing right now, so at least catching them and ignoring them would allow the tests to run! Later we can work out how to handle them properly. It is absolutely possible that clap doesn't support this behaviour at all, so I linked you to the one feature I think might work that way. If it turns out it doesn't, we investigate other options. 😄 One other might be the crate gumdrop. |
@bbqsrc |
It might be easier to test it with another project, and use a path dependency to your modified cucumber crate. You can do that with the following in your Cargo.toml in place of the usual test dependency:
The path can be relative from your testing crate, or absolute. And the question isn't stupid. These things are not intuitive when you're new to Rust, and test runners like this are even less intuitive in the current cargo model. :) |
it seems like it is not failing when we are passing parameters like this |
For @privalou, some additional information about Rust + Cargo testing: |
Answer to @privalou question about dependency between Basically Here you can see that cli options are used to filter scenarios for example. |
@bbqsrc |
@tyranron this feature can't really be implemented, as those options are implemented by default test harness, which we are turning off with But #144 supports all possible similar options and introduces ability to add custom CLI options. For All possible options supported by default test harness to be sure that I didn't miss anything important:
|
- make CLI options composable by adding `Cli` associated type to `Parser`, `Runner` and `Writer` traits - switch to `structopt` crate as `clap` doesn't support generic flattening at the moment - allow extend `cli::Opts` with a custom `StructOpt` deriver Additionally: - fix accidenatlly messed up imports style Co-authored-by: tyranron <[email protected]>
Right now if you pass
test-thread
argument to cargo test, cucumber will fail:Command:
cargo test --workspace --verbose -- --test-threads=1
It will be great to support this feature or at list ignore it instead of failure.
The text was updated successfully, but these errors were encountered: