Skip to content

Commit 4d14617

Browse files
committed
Speedup heavy tests
We used to skip sysroot, but this logic got bitrotted, reinstalling.
1 parent 14cc626 commit 4d14617

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

crates/rust-analyzer/tests/rust-analyzer/main.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ version = "0.0.0"
5454
use std::collections::Spam;
5555
"#,
5656
)
57+
.with_config(serde_json::json!({
58+
"cargo": { "noSysroot": false }
59+
}))
5760
.server()
5861
.wait_until_workspace_is_loaded();
5962

@@ -450,6 +453,9 @@ fn main() {{}}
450453
"#,
451454
librs, libs
452455
))
456+
.with_config(serde_json::json!({
457+
"cargo": { "noSysroot": false }
458+
}))
453459
.server()
454460
.wait_until_workspace_is_loaded();
455461

@@ -572,7 +578,10 @@ fn main() {
572578
"###,
573579
)
574580
.with_config(serde_json::json!({
575-
"cargo": { "loadOutDirsFromCheck": true }
581+
"cargo": {
582+
"loadOutDirsFromCheck": true,
583+
"noSysroot": true,
584+
}
576585
}))
577586
.server()
578587
.wait_until_workspace_is_loaded();
@@ -715,7 +724,10 @@ pub fn foo(_input: TokenStream) -> TokenStream {
715724
"###,
716725
)
717726
.with_config(serde_json::json!({
718-
"cargo": { "loadOutDirsFromCheck": true },
727+
"cargo": {
728+
"loadOutDirsFromCheck": true,
729+
"noSysroot": true,
730+
},
719731
"procMacro": {
720732
"enable": true,
721733
"server": PathBuf::from(env!("CARGO_BIN_EXE_rust-analyzer")),

crates/rust-analyzer/tests/rust-analyzer/support.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@ pub(crate) struct Project<'a> {
2727

2828
impl<'a> Project<'a> {
2929
pub(crate) fn with_fixture(fixture: &str) -> Project {
30-
Project { fixture, tmp_dir: None, roots: vec![], config: serde_json::Value::Null }
30+
Project {
31+
fixture,
32+
tmp_dir: None,
33+
roots: vec![],
34+
config: serde_json::json!({
35+
// Loading standard library is costly, let's ignore it by default
36+
"cargo": { "noSysroot": true }
37+
}),
38+
}
3139
}
3240

3341
pub(crate) fn tmp_dir(mut self, tmp_dir: TestDir) -> Project<'a> {

0 commit comments

Comments
 (0)