Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix test failures due to dependency on Settings global in client for telemetry

Mikayla Makia3da41bfad3a
diff --git a/crates/collab/src/tests/randomized_integration_tests.rs b/crates/collab/src/tests/randomized_integration_tests.rs
index b067cac5ff5..11c62005c2d 100644
--- a/crates/collab/src/tests/randomized_integration_tests.rs
+++ b/crates/collab/src/tests/randomized_integration_tests.rs
@@ -18,6 +18,7 @@ use rand::{
distributions::{Alphanumeric, DistString},
prelude::*,
};
+use settings::Settings;
use std::{env, ffi::OsStr, path::PathBuf, sync::Arc};
#[gpui::test(iterations = 100)]
@@ -104,6 +105,8 @@ async fn test_random_collaboration(
cx.function_name.clone(),
);
+ client_cx.update(|cx| cx.set_global(Settings::test(cx)));
+
let op_start_signal = futures::channel::mpsc::unbounded();
let client = server.create_client(&mut client_cx, &username).await;
user_ids.push(client.current_user_id(&client_cx));
@@ -173,6 +176,7 @@ async fn test_random_collaboration(
available_users.push((removed_user_id, client.username.clone()));
client_cx.update(|cx| {
cx.clear_globals();
+ cx.set_global(Settings::test(cx));
drop(client);
});
@@ -401,6 +405,7 @@ async fn test_random_collaboration(
for (client, mut cx) in clients {
cx.update(|cx| {
cx.clear_globals();
+ cx.set_global(Settings::test(cx));
drop(client);
});
}
diff --git a/crates/settings/src/settings.rs b/crates/settings/src/settings.rs
index e3e8516508d..e29a98e775f 100644
--- a/crates/settings/src/settings.rs
+++ b/crates/settings/src/settings.rs
@@ -584,7 +584,10 @@ impl Settings {
lsp: Default::default(),
projects_online_by_default: true,
theme: gpui::fonts::with_font_cache(cx.font_cache().clone(), Default::default),
- telemetry_defaults: Default::default(),
+ telemetry_defaults: TelemetrySettings {
+ diagnostics: Some(true),
+ metrics: Some(true),
+ },
telemetry_overrides: Default::default(),
staff_mode: false,
}