From 4d14617636bcf73ac118e7d30757afd510ac9b1c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 1 Mar 2021 12:14:16 +0300 Subject: Speedup heavy tests We used to skip sysroot, but this logic got bitrotted, reinstalling. --- crates/rust-analyzer/tests/rust-analyzer/main.rs | 16 ++++++++++++++-- crates/rust-analyzer/tests/rust-analyzer/support.rs | 10 +++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/tests/rust-analyzer/main.rs b/crates/rust-analyzer/tests/rust-analyzer/main.rs index 391a0b60d..7545b4a34 100644 --- a/crates/rust-analyzer/tests/rust-analyzer/main.rs +++ b/crates/rust-analyzer/tests/rust-analyzer/main.rs @@ -54,6 +54,9 @@ version = "0.0.0" use std::collections::Spam; "#, ) + .with_config(serde_json::json!({ + "cargo": { "noSysroot": false } + })) .server() .wait_until_workspace_is_loaded(); @@ -450,6 +453,9 @@ fn main() {{}} "#, librs, libs )) + .with_config(serde_json::json!({ + "cargo": { "noSysroot": false } + })) .server() .wait_until_workspace_is_loaded(); @@ -572,7 +578,10 @@ fn main() { "###, ) .with_config(serde_json::json!({ - "cargo": { "loadOutDirsFromCheck": true } + "cargo": { + "loadOutDirsFromCheck": true, + "noSysroot": true, + } })) .server() .wait_until_workspace_is_loaded(); @@ -715,7 +724,10 @@ pub fn foo(_input: TokenStream) -> TokenStream { "###, ) .with_config(serde_json::json!({ - "cargo": { "loadOutDirsFromCheck": true }, + "cargo": { + "loadOutDirsFromCheck": true, + "noSysroot": true, + }, "procMacro": { "enable": true, "server": PathBuf::from(env!("CARGO_BIN_EXE_rust-analyzer")), diff --git a/crates/rust-analyzer/tests/rust-analyzer/support.rs b/crates/rust-analyzer/tests/rust-analyzer/support.rs index 726d555e4..6b774073d 100644 --- a/crates/rust-analyzer/tests/rust-analyzer/support.rs +++ b/crates/rust-analyzer/tests/rust-analyzer/support.rs @@ -27,7 +27,15 @@ pub(crate) struct Project<'a> { impl<'a> Project<'a> { pub(crate) fn with_fixture(fixture: &str) -> Project { - Project { fixture, tmp_dir: None, roots: vec![], config: serde_json::Value::Null } + Project { + fixture, + tmp_dir: None, + roots: vec![], + config: serde_json::json!({ + // Loading standard library is costly, let's ignore it by default + "cargo": { "noSysroot": true } + }), + } } pub(crate) fn tmp_dir(mut self, tmp_dir: TestDir) -> Project<'a> { -- cgit v1.2.3