Skip to content

Commit e2f918a

Browse files
chore: get cargo test to pass (#1728)
1 parent 516cddd commit e2f918a

File tree

11 files changed

+16
-22
lines changed

11 files changed

+16
-22
lines changed

crates/chat-cli/src/auth/builder_id.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl std::fmt::Display for OAuthFlow {
6969
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7070
match *self {
7171
OAuthFlow::DeviceCode => write!(f, "DeviceCode"),
72-
OAuthFlow::Pkce => write!(f, "PKCE"),
72+
OAuthFlow::Pkce => write!(f, "Pkce"),
7373
}
7474
}
7575
}
@@ -593,7 +593,7 @@ mod tests {
593593
#[test]
594594
fn test_oauth_flow_ser_deser() {
595595
test_ser_deser!(OAuthFlow, OAuthFlow::DeviceCode, "DeviceCode");
596-
test_ser_deser!(OAuthFlow, OAuthFlow::Pkce, "PKCE");
596+
test_ser_deser!(OAuthFlow, OAuthFlow::Pkce, "Pkce");
597597
}
598598

599599
#[test]

crates/chat-cli/src/auth/secret_store/sqlite.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![allow(dead_code)]
22
use super::Secret;
3-
use crate::Result;
43
use crate::auth::AuthError;
54
use crate::settings::sqlite::{
65
Db,

crates/chat-cli/src/cli/chat/conversation_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ mod tests {
994994

995995
#[tokio::test]
996996
async fn test_conversation_state_additional_context() {
997-
tracing_subscriber::fmt::try_init().ok();
997+
// tracing_subscriber::fmt::try_init().ok();
998998

999999
let mut tool_manager = ToolManager::default();
10001000
let ctx = Context::builder().with_test_home().await.unwrap().build_fake();

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3424,7 +3424,7 @@ mod tests {
34243424

34253425
#[tokio::test]
34263426
async fn test_flow() {
3427-
let _ = tracing_subscriber::fmt::try_init();
3427+
// let _ = tracing_subscriber::fmt::try_init();
34283428
let ctx = Context::builder().with_test_home().await.unwrap().build_fake();
34293429
let test_client = create_stream(serde_json::json!([
34303430
[
@@ -3478,7 +3478,7 @@ mod tests {
34783478

34793479
#[tokio::test]
34803480
async fn test_flow_tool_permissions() {
3481-
let _ = tracing_subscriber::fmt::try_init();
3481+
// let _ = tracing_subscriber::fmt::try_init();
34823482
let ctx = Context::builder().with_test_home().await.unwrap().build_fake();
34833483
let test_client = create_stream(serde_json::json!([
34843484
[
@@ -3624,7 +3624,7 @@ mod tests {
36243624

36253625
#[tokio::test]
36263626
async fn test_flow_multiple_tools() {
3627-
let _ = tracing_subscriber::fmt::try_init();
3627+
// let _ = tracing_subscriber::fmt::try_init();
36283628
let ctx = Context::builder().with_test_home().await.unwrap().build_fake();
36293629
let test_client = create_stream(serde_json::json!([
36303630
[
@@ -3718,7 +3718,7 @@ mod tests {
37183718

37193719
#[tokio::test]
37203720
async fn test_flow_tools_trust_all() {
3721-
let _ = tracing_subscriber::fmt::try_init();
3721+
// let _ = tracing_subscriber::fmt::try_init();
37223722
let ctx = Context::builder().with_test_home().await.unwrap().build_fake();
37233723
let test_client = create_stream(serde_json::json!([
37243724
[

crates/chat-cli/src/cli/chat/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ mod tests {
320320

321321
#[tokio::test]
322322
async fn test_parse() {
323-
let _ = tracing_subscriber::fmt::try_init();
323+
// let _ = tracing_subscriber::fmt::try_init();
324324
let tool_use_id = "TEST_ID".to_string();
325325
let tool_name = "execute_bash".to_string();
326326
let tool_args = serde_json::json!({

crates/chat-cli/src/cli/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ const HELP_TEXT: &str = color_print::cstr! {"
151151
"};
152152

153153
#[derive(Debug, Parser, PartialEq, Default)]
154-
#[command(version, about, name = crate::CHAT_BINARY_NAME, help_template = HELP_TEXT)]
154+
#[command(version, about, name = crate::util::CHAT_BINARY_NAME, help_template = HELP_TEXT)]
155155
pub struct Cli {
156156
#[command(subcommand)]
157157
pub subcommand: Option<CliRootCommands>,

crates/chat-cli/src/mcp_client/client.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ mod tests {
540540
PathBuf::from(workspace_root)
541541
}
542542

543+
#[ignore = "TODO: support test binary"]
543544
#[tokio::test(flavor = "multi_thread")]
544545
async fn test_client_stdio() {
545546
std::process::Command::new("cargo")

crates/chat-cli/src/platform/env.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ mod inner {
5252

5353
impl Env {
5454
pub fn new() -> Self {
55-
match cfg!(test) {
56-
true => Self(inner::Inner::Fake(Arc::new(Mutex::new(inner::Fake::default())))),
57-
false => Self::default(),
58-
}
55+
Self::default()
5956
}
6057

6158
/// Create a fake process environment from a slice of tuples.
@@ -213,7 +210,7 @@ mod tests {
213210

214211
#[test]
215212
fn test_default_current_dir() {
216-
let env = Env::new();
213+
let env = Env::from_slice(&[]);
217214
assert_eq!(env.current_dir().unwrap(), PathBuf::from("/"));
218215
}
219216
}

crates/chat-cli/src/platform/fs.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ mod inner {
3939

4040
impl Fs {
4141
pub fn new() -> Self {
42-
match cfg!(test) {
43-
true => Self(inner::Inner::Fake(Arc::new(Mutex::new(HashMap::new())))),
44-
false => Self::default(),
45-
}
42+
Self::default()
4643
}
4744

4845
pub fn new_chroot() -> Self {
@@ -484,7 +481,7 @@ mod tests {
484481

485482
#[tokio::test]
486483
async fn test_read_to_string() {
487-
let fs = Fs::new();
484+
let fs = Fs::new_chroot();
488485
fs.write("fake", "contents").await.unwrap();
489486
fs.write("invalid_utf8", &[255]).await.unwrap();
490487

crates/chat-cli/src/settings/sqlite.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ mod tests {
326326
);
327327

328328
// Assert all the files in migrations/ are in the list
329-
let migration_folder = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("src/sqlite/migrations");
329+
let migration_folder = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("src/settings/sqlite_migrations");
330330
let migration_count = std::fs::read_dir(migration_folder).unwrap().count();
331331
assert_eq!(MIGRATIONS.len(), migration_count);
332332
}

0 commit comments

Comments
 (0)