nextest-rs/nextest

Add support for per-test target runners

Opened this issue · 2 comments

At Oxide we have a use case where we want to be able to run pfexec (sudo equivalent) for some tests on illumos. This is generally possible with target runners on illumos, but using pfexec against every single test is a recipe for a ton of files suddenly being owned by root.

There are hacks around this, but the ideal solution is to support per-test target runners. We should add a way to do that.

This is mostly a matter of adding configuration to nextest.toml, since the general infrastructure for target runners can be reused. I'd estimate it would take 3-4 days for me to get it done, including documentation. So it's just a matter of budgeting time for it.

Some notes from the debugging session today:

  • When nextest encounters both .cargo/config and .cargo/config.toml, it should loudly warn
  • within nextest's support for target runners, it should be possible to only use them for the run-phase and not the list phase (or even define separate target runners for the list and run phase)
  • the docs should more clearly talk about the non-cross-compile scenario

One interesting behavior with Cargo's target runners is that cargo run, even if invoked from within the target runner, also invokes the target runner. We'll want to probably support this use case by setting CARGO_TARGET_<...>_RUNNER, maybe with an optional recurse = true.