nextest icon indicating copy to clipboard operation
nextest copied to clipboard

Support CARGO_WORKSPACE_DIR

Open cemoktra opened this issue 3 years ago • 2 comments

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

cemoktra avatar Aug 24 '22 08:08 cemoktra

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!

sunshowers avatar Aug 24 '22 15:08 sunshowers

I will check tomorrow if I can easily

cemoktra avatar Aug 24 '22 16:08 cemoktra

This has landed, and will be part of the next release of nextest in the next 2-3 days.

sunshowers avatar Oct 20 '22 00:10 sunshowers

Just released cargo-nextest 0.9.40 with support for this -- binaries will be available within the next 20 minutes.

sunshowers avatar Oct 25 '22 22:10 sunshowers