Skip to content

test-log crate breaks test runnables #12396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mullr opened this issue May 26, 2022 · 6 comments
Open

test-log crate breaks test runnables #12396

mullr opened this issue May 26, 2022 · 6 comments
Labels
A-ide general IDE features C-bug Category: bug

Comments

@mullr
Copy link
Contributor

mullr commented May 26, 2022

rust-analyzer version: rust-analyzer 5b69a34fb 2022-05-25 dev

rustc version: rustc 1.61.0 (fe5b13d68 2022-05-18)

relevant settings: Using emacs with lsp-mode.

The test-log crate (https://github.com/d-e-s-o/test-log) comes with a replacement test macro. You use it like this:

use test_log::test;

#[test]
fn my_test() {
  info!("I can see this now!");
}

But, with this use test_log::test, when I try to run the test using lsp-rust-analyzer-run it doesn't detect it as an option. If I remove the use, the test is runnable.

@mullr mullr changed the title test-log crates breaks test runnables test-log crate breaks test runnables May 26, 2022
@jonas-schievink
Copy link
Contributor

It expands to a function with a #[::core::prelude::v1::test] attribute, maybe we're only looking for #[test]?

@lnicola
Copy link
Member

lnicola commented May 27, 2022

Was it reverted in #10044 (#9943)?

@Veykril
Copy link
Member

Veykril commented May 27, 2022

Shouldn't be, we skip expansion of test but we do it with resolved attributes, so not just a textual match. Manually using #[::core::prelude::v1::test] works fine as well

@Veykril
Copy link
Member

Veykril commented May 27, 2022

Fwiw I do get the test lenses in VSCode for the above snippet

@flodiebold flodiebold added S-unactionable Issue requires feedback, design decisions or is blocked on other work C-support Category: support questions labels Jun 17, 2022
@mullr
Copy link
Contributor Author

mullr commented Aug 15, 2022

I just checked this in both emacs and vs code. I notice that I DO get the lenses in code and in emacs. The problem occurs in emacs in the lsp-rust-analyzer-run path only; this bottoms out in the experimental/runnables lsp request.

@Veykril
Copy link
Member

Veykril commented Sep 16, 2023

Triage; This is still a problem

@Veykril Veykril added C-bug Category: bug A-ide general IDE features and removed S-unactionable Issue requires feedback, design decisions or is blocked on other work C-support Category: support questions labels Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ide general IDE features C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

5 participants