Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

"Run test" codelens runs the wrong test #944

Closed
dsyer opened this issue Mar 3, 2022 · 4 comments
Closed

"Run test" codelens runs the wrong test #944

dsyer opened this issue Mar 3, 2022 · 4 comments

Comments

@dsyer
Copy link

dsyer commented Mar 3, 2022

In the rustlings project there is a codelens on the test in tests1.rs. When you click on it you get this:

    Running tests/integration_tests.rs (target/debug/deps/integration_tests-db54af64180db0fc)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 22 filtered out; finished in 0.00s

So it ran some random global test suite and ignored the test the codelens was on.

@lnicola
Copy link
Member

lnicola commented Mar 3, 2022

rustlings has a bit of a weird project structure that doesn't work well with IDEs, neither RLS, nor rust-analyzer. See e.g. rust-lang/rustlings#917.

PS: unless you aren't already, you should try rust-analyzer, though it still doesn't work with rustlings.

@dsyer
Copy link
Author

dsyer commented Mar 3, 2022

I tried it, but it barfs

rust-analyzer failed to load workspace: Failed to read Cargo metadata from Cargo.toml file /workspaces/rustlings/Cargo.toml, cargo 1.59.0 (49d8809dc 2022-02-10): Failed to run `"cargo" "metadata" "--format-version" "1" "--features" "exercises" "--manifest-path" "/workspaces/rustlings/Cargo.toml" "--filter-platform" "x86_64-unknown-linux-gnu"`: `cargo metadata` exited with an error: error: none of the selected packages contains these features: exercises

Maybe that's what you meant by "it still doesn't work with rustlings".

It appears to be an alternative to vscode-rust? So I guess it doesn't help fix this issue.

@lnicola
Copy link
Member

lnicola commented Mar 3, 2022

If you applied the setting from rust-lang/rustlings#917 (comment), you'll also need to pull in the changes from the same PR: https://github.com/rust-lang/rustlings/pull/917/files.

There's also https://github.com/jackos/rustlings-fix/ as an alternative, but I haven't tried either of them.

I mentioned rust-analyzer because you filed an issue here, but vscode-rust is de-facto unmaintained.

@dsyer
Copy link
Author

dsyer commented Mar 4, 2022

vscode-rust is de-facto unmaintained.

Good to know. It's a shame that it looks like the "official" extension then.

@dsyer dsyer closed this as completed Mar 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants