Is it possible for `Run Test` and `Run Tests` in VS Code to invoke nextest?
See also https://github.com/nextest-rs/nextest/discussions/2253 where I cross posted to nextest many months ago.
rust-analyzer has this nice little Run Tests button above a mod of tests:
It also has Run Test above a single test. When switching a project to nextest, most of the time Run Test still works, but often Run Tests will start to fail if you start taking advantage of nextest's one process per test feature, i.e. Run Tests will invoke some call to cargo test rather than nextest itself and your tests won't run in separate processes.
Have you all considered making the hook for Run Tests configurable in some way so that nextest could be invoked instead?
CC @sunshowers, I hope you don't mind me mentioning you here, feel free to ignore, but I thought you might want to be involved if there is movement here
Sounds like a good feature to have! But I think making a hook would be a bit too much. Wouldn't making an alternative command for running test similar to the one for run like https://rust-analyzer.github.io/book/configuration.html#runnables.command suffice?
Thanks for opening this issue, this is something that I have wanted for quite some time.
Wouldn't making an alternative command for running test similar to the one for run like https://rust-analyzer.github.io/book/configuration.html#runnables.command suffice?
Yeah, I think that would be simple. In one of my projects, when I click the "Run test" from my editor - this is what rust analyzer invokes currently:
cargo test --package my-pkg-name --lib -- p2p_large::large_sync --exact --show-output
But just switching test to nextest run won't work and fails with this:
$ cargo nextest run --package my-pkg-name --lib -- p2p_large::large_sync --exact --show-output
error: failed to parse test binary arguments `--show-output`: arguments are unsupported
But removing --show-output makes it work. So we would probably need more than one option: One for the subcommand that is invoked and the additional options that is appeneded to the test runner.