nextest icon indicating copy to clipboard operation
nextest copied to clipboard

Nextest doesn't work in workspace where Cargo.toml of workspace is not hierarchically higher than crates

Open Elrendio opened this issue 1 year ago • 4 comments

Output

image

File structures

Repo
  .cargo/workspace/Cargo.toml
  Crate/
     src/
     Cargo.toml

MinimalRepro repository

What I think the issue is

I believe that nextest assumes that the workspace Cargo.toml will always be in a parent folder of the crates the workspace contains.

Elrendio avatar Sep 04 '24 14:09 Elrendio

Thank you! I've never seen this before to be honest. Do you have a reference in the Cargo documentation for it?

sunshowers avatar Sep 04 '24 16:09 sunshowers

Hi @sunshowers , I'm sorry but I didn't understand what reference do you want me to provide?

Elrendio avatar Sep 05 '24 09:09 Elrendio

Thanks. I had another look at your repro, and to be honest I didn't know that you could use .. in workspace members! It definitely seems rare, I've never seen a Rust project in the wild do this.

This would have to be addressed in the underlying guppy library (also maintained by myself), https://github.com/guppy-rs/guppy. I don't plan to fix this myself but a patch would be welcome.

sunshowers avatar Sep 05 '24 18:09 sunshowers

I don't plan to work on this, but a patch would be welcome.

sunshowers avatar Sep 19 '24 20:09 sunshowers

I checked the error message, if do not restrict manifest path must within workspace path, nextest can run tests at MinimalRepo. If you are sure this restriction can be bypass optionally, I can try provide patch to Guppy and Nextest.

PegasusPlusUS avatar Nov 03 '24 09:11 PegasusPlusUS

Patch is ready now, for guppy repository, please review 0001-Help-fix-manifest-might-exist-out-of-workspace-root-.patch

PegasusPlusUS avatar Nov 04 '24 17:11 PegasusPlusUS

In guppy PR #331 now

PegasusPlusUS avatar Nov 17 '24 01:11 PegasusPlusUS

Just tagged cargo-nextest 0.9.86-b.1 with the fix from @PegasusPlusUS -- binaries will be out in around 20 minutes. Please test it out with:

cargo nextest self update --version 0.9.86-b.1

Thanks Pegasus for working on this!

sunshowers avatar Dec 05 '24 04:12 sunshowers

Seems like this has been addressed, so closing it out.

sunshowers avatar Jun 05 '25 06:06 sunshowers