Reduce logging in lsp tests

This commit is contained in:
Max Brunsfeld 2022-02-11 16:37:50 -08:00
parent d84fc3beec
commit 8d6504826c
4 changed files with 11 additions and 7 deletions

4
Cargo.lock generated
View file

@ -2776,6 +2776,8 @@ version = "0.1.0"
dependencies = [
"anyhow",
"async-pipe",
"ctor",
"env_logger",
"futures",
"gpui",
"log",
@ -2784,7 +2786,6 @@ dependencies = [
"postage",
"serde",
"serde_json",
"simplelog",
"smol",
"unindent",
"util",
@ -3523,7 +3524,6 @@ dependencies = [
"rpc",
"serde",
"serde_json",
"simplelog",
"smol",
"sum_tree",
"tempdir",

View file

@ -27,5 +27,6 @@ smol = "1.2"
gpui = { path = "../gpui", features = ["test-support"] }
util = { path = "../util", features = ["test-support"] }
async-pipe = { git = "https://github.com/routerify/async-pipe-rs", rev = "feeb77e83142a9ff837d0767652ae41bfc5d8e47" }
simplelog = "0.9"
ctor = "0.1"
env_logger = "0.8"
unindent = "0.1.7"

View file

@ -707,10 +707,16 @@ impl FakeLanguageServer {
mod tests {
use super::*;
use gpui::TestAppContext;
use simplelog::SimpleLogger;
use unindent::Unindent;
use util::test::temp_tree;
#[ctor::ctor]
fn init_logger() {
if std::env::var("RUST_LOG").is_ok() {
env_logger::init();
}
}
#[gpui::test]
async fn test_rust_analyzer(cx: TestAppContext) {
let lib_source = r#"
@ -771,8 +777,6 @@ mod tests {
#[gpui::test]
async fn test_fake(cx: TestAppContext) {
SimpleLogger::init(log::LevelFilter::Info, Default::default()).unwrap();
let (server, mut fake) = LanguageServer::fake(&cx).await;
let (message_tx, message_rx) = channel::unbounded();

View file

@ -49,6 +49,5 @@ lsp = { path = "../lsp", features = ["test-support"] }
util = { path = "../util", features = ["test-support"] }
rpc = { path = "../rpc", features = ["test-support"] }
rand = "0.8.3"
simplelog = "0.9"
tempdir = { version = "0.3.7" }
unindent = "0.1.7"