nextest-rs/nextest

Unsupported arguments (--list --format terse) passed to rust cumcumber test

jaques-sam opened this issue · 2 comments

Description

For some reason if I use this cucumber crate where you can write Gherkin style BDD tests, for some reason this is incompatible (by default) with nextest as it passes unrecognized cli arguments to the test executable:

Full command: cargo nextest run --release -p my-project

error: creating test list failed

Caused by:
for my-project::bdd_tests, command my-project/target/release/deps/bdd_tests-92c5a5360a92e662 --list --format terse exited with code 2
--- stdout:

--- stderr:
error: unexpected argument '--list' found

Usage: bdd_tests-92c5a5360a92e662 [OPTIONS]

For more information, try '--help'.

I also checked the other cli arguments (--list, --format & terse) separately and none of them seem to work.

Hopeful solutions

  1. Is there a way I can disable these for a specific target (preferably in cargo.toml)?
  2. By default there shouldn't be extra parameters given to the tests

Thanks for the question!

Is there a way I can disable these for a specific target (preferably in cargo.toml)?

No, not at the moment. I'm inclined against adding this kind of thing, as opposed to having the test harness support those extra parameters. The risk is that nextest will end up missing tests implicitly and in a surprising fashion. We already have issues with this (with default-members) and I don't want to introduce more issues.

By default there shouldn't be extra parameters given to the tests.

This isn't possible with nextest's model. This is explained in How nextest works and Custom test harnesses. It isn't too hard to add support for the options to your custom test harness -- especially if you just use libtest-mimic, which gives you this support for free.

Hope this helps! I'll close this issue for now -- feel free to reopen or file a new issue if you run into implementation difficulties.

Thanks, that helps me a lot to solve my issue!