Skip to content

Commit 9155f97

Browse files
committed
chore: get cargo test to pass
1 parent dd6ca31 commit 9155f97

File tree

7 files changed

+12
-18
lines changed

7 files changed

+12
-18
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/cli/chat/conversation_state.rs

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

988988
#[tokio::test]
989989
async fn test_conversation_state_additional_context() {
990-
tracing_subscriber::fmt::try_init().ok();
990+
// tracing_subscriber::fmt::try_init().ok();
991991

992992
let mut tool_manager = ToolManager::default();
993993
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
@@ -3384,7 +3384,7 @@ mod tests {
33843384

33853385
#[tokio::test]
33863386
async fn test_flow() {
3387-
let _ = tracing_subscriber::fmt::try_init();
3387+
// let _ = tracing_subscriber::fmt::try_init();
33883388
let ctx = Context::builder().with_test_home().await.unwrap().build_fake();
33893389
let test_client = create_stream(serde_json::json!([
33903390
[
@@ -3438,7 +3438,7 @@ mod tests {
34383438

34393439
#[tokio::test]
34403440
async fn test_flow_tool_permissions() {
3441-
let _ = tracing_subscriber::fmt::try_init();
3441+
// let _ = tracing_subscriber::fmt::try_init();
34423442
let ctx = Context::builder().with_test_home().await.unwrap().build_fake();
34433443
let test_client = create_stream(serde_json::json!([
34443444
[
@@ -3584,7 +3584,7 @@ mod tests {
35843584

35853585
#[tokio::test]
35863586
async fn test_flow_multiple_tools() {
3587-
let _ = tracing_subscriber::fmt::try_init();
3587+
// let _ = tracing_subscriber::fmt::try_init();
35883588
let ctx = Context::builder().with_test_home().await.unwrap().build_fake();
35893589
let test_client = create_stream(serde_json::json!([
35903590
[
@@ -3678,7 +3678,7 @@ mod tests {
36783678

36793679
#[tokio::test]
36803680
async fn test_flow_tools_trust_all() {
3681-
let _ = tracing_subscriber::fmt::try_init();
3681+
// let _ = tracing_subscriber::fmt::try_init();
36823682
let ctx = Context::builder().with_test_home().await.unwrap().build_fake();
36833683
let test_client = create_stream(serde_json::json!([
36843684
[

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/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: 1 addition & 4 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 {

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)