Skip to content
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

Env variables (eg RUST_BACKTRACE=1) seem ignored in Cargo Test launch configuration #338

Open
mickaelistria opened this issue Sep 28, 2020 · 0 comments

Comments

@mickaelistria
Copy link
Contributor

I have a project with a test like

#[cfg(test)]
mod tests {
    #[test]
    fn it_works() {
        assert_eq!(2 + 2, 4);
    }
    
    #[test]
    fn it_fails() {
        use std::{thread, time};
        thread::sleep(time::Duration::from_secs(10));
        assert_eq!(2 + 2, 5);
    }
}

and get as response in the output

---- tests::it_fails stdout ----
thread 'tests::it_fails' panicked at 'assertion failed: `(left == right)`
  left: `4`,
 right: `5`', tests/test.rs:12:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Then I did go to the launch configuration and did set RUST_BACKTRACE to 1, but nothing changes, message is still here so it seems like the Environment Variables are ignored.
Setting this RUST_BACKTRACE in CLI with RUST_BACKTRACE=1 cargo test works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant