Skip to content

Commit 23fe3af

Browse files
committed
internal: Ensure tracing is configured in slow tests
rust-lang/rust-analyzer#16394 changed the logging initialisation to create a Config struct, but never did anything with it. Call `.init()` so slow tests have tracing configured. You can test this by adding a test failure to a slow test, e.g. `test_format_document_2018`, and then running it: ``` $ RA_LOG=trace RUN_SLOW_TESTS=1 cargo t test_format_document_2018 ``` Previously this didn't log anything, even though RA_LOG was set.
1 parent 985ec34 commit 23fe3af

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • src/tools/rust-analyzer/crates/rust-analyzer/tests/slow-tests

src/tools/rust-analyzer/crates/rust-analyzer/tests/slow-tests/support.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ impl Project<'_> {
173173
chalk_filter: std::env::var("CHALK_DEBUG").ok(),
174174
profile_filter: std::env::var("RA_PROFILE").ok(),
175175
json_profile_filter: std::env::var("RA_PROFILE_JSON").ok(),
176-
};
176+
}
177+
.init();
177178
});
178179

179180
let FixtureWithProjectMeta {

0 commit comments

Comments
 (0)