nextest
nextest copied to clipboard
Support CARGO_WORKSPACE_DIR
There exists a quite common hack to add an env variable for the workspace directory: https://github.com/rust-lang/cargo/issues/3946#issuecomment-97313299
In comparison to cargo test this hack is not working with nextest. While its easy to export the variable it might be nice addition
Thanks for the report! This looks like it's part of https://github.com/nextest-rs/nextest/issues/325.
Would you like to contribute a fix? The logic for cargo config parsing is in https://github.com/nextest-rs/nextest/blob/main/nextest-runner/src/cargo_config.rs. You just need to add environment variables to it according to the documented spec, then pass them in while running them in https://github.com/nextest-rs/nextest/blob/58999b1e350eb4865f6dcb1e8d3354820483f32c/nextest-runner/src/list/test_list.rs#L845. Finally, you'll need to add some tests to the fixtures/nextest-tests directory.
I would be happy to review your PR next week!
I will check tomorrow if I can easily
This has landed, and will be part of the next release of nextest in the next 2-3 days.
Just released cargo-nextest 0.9.40 with support for this -- binaries will be available within the next 20 minutes.