diff --git a/crates/cli/kubectl-pod-cleanup/src/main.rs b/crates/cli/kubectl-pod-cleanup/src/main.rs index 74d47fee63..d97961dad3 100644 --- a/crates/cli/kubectl-pod-cleanup/src/main.rs +++ b/crates/cli/kubectl-pod-cleanup/src/main.rs @@ -7,7 +7,6 @@ use config::shared_constants::DEFAULT_RUST_LOG; use errors::AnyhowResult; use crate::delete_pods_threaded::delete_pods_threaded; -use crate::list_pods::list_pods; pub mod delete_pods; pub mod delete_pods_threaded; diff --git a/crates/lib/storyteller_root/src/paths/storyteller_frontend_root.rs b/crates/lib/storyteller_root/src/paths/storyteller_frontend_root.rs index 5a48af8f51..8c0caa3a2f 100644 --- a/crates/lib/storyteller_root/src/paths/storyteller_frontend_root.rs +++ b/crates/lib/storyteller_root/src/paths/storyteller_frontend_root.rs @@ -84,7 +84,21 @@ mod tests { let mut expected = fake_storyteller.clone(); expected.push("storyteller-frontend"); - assert_eq!(get_storyteller_frontend_root(), expected); + let actual = get_storyteller_frontend_root(); + + if actual.starts_with("/private") && !expected.starts_with("/private") { + // NB: For Mac, TempDir creates in /var/... which is an alias of /private/var/... + // We'll make sure to canonicalize both paths. + let mut corrected = PathBuf::from("/private"); + + expected.iter() + .filter(|component| !component.to_string_lossy().eq("/")) + .for_each(|component| corrected.push(component)); + + expected = corrected; + } + + assert_eq!(actual, expected); std::env::remove_var(TEST_HOME); diff --git a/crates/lib/storyteller_root/src/paths/storyteller_ml_root.rs b/crates/lib/storyteller_root/src/paths/storyteller_ml_root.rs index c9233b062f..0361a7a48f 100644 --- a/crates/lib/storyteller_root/src/paths/storyteller_ml_root.rs +++ b/crates/lib/storyteller_root/src/paths/storyteller_ml_root.rs @@ -84,7 +84,21 @@ mod tests { let mut expected = fake_storyteller.clone(); expected.push("storyteller-ml"); - assert_eq!(get_storyteller_ml_root(), expected); + let actual = get_storyteller_ml_root(); + + if actual.starts_with("/private") && !expected.starts_with("/private") { + // NB: For Mac, TempDir creates in /var/... which is an alias of /private/var/... + // We'll make sure to canonicalize both paths. + let mut corrected = PathBuf::from("/private"); + + expected.iter() + .filter(|component| !component.to_string_lossy().eq("/")) + .for_each(|component| corrected.push(component)); + + expected = corrected; + } + + assert_eq!(actual, expected); std::env::remove_var(TEST_HOME); diff --git a/crates/lib/storyteller_root/src/paths/storyteller_root.rs b/crates/lib/storyteller_root/src/paths/storyteller_root.rs index 5d68e45c80..b880bb5bc2 100644 --- a/crates/lib/storyteller_root/src/paths/storyteller_root.rs +++ b/crates/lib/storyteller_root/src/paths/storyteller_root.rs @@ -127,7 +127,22 @@ mod tests { // test variable so we never infect other tests. std::env::set_var(TEST_HOME, fake_home.to_str().expect("should be string")); - assert_eq!(get_storyteller_root(), fake_storyteller); + let actual = get_storyteller_root(); + let mut expected = fake_storyteller.clone(); + + if actual.starts_with("/private") && !expected.starts_with("/private") { + // NB: For Mac, TempDir creates in /var/... which is an alias of /private/var/... + // We'll make sure to canonicalize both paths. + let mut corrected = PathBuf::from("/private"); + + expected.iter() + .filter(|component| !component.to_string_lossy().eq("/")) + .for_each(|component| corrected.push(component)); + + expected = corrected; + } + + assert_eq!(actual, expected); std::env::remove_var(TEST_HOME); diff --git a/crates/lib/storyteller_root/src/paths/storyteller_rust_root.rs b/crates/lib/storyteller_root/src/paths/storyteller_rust_root.rs index fd339e73c7..99b98fa77d 100644 --- a/crates/lib/storyteller_root/src/paths/storyteller_rust_root.rs +++ b/crates/lib/storyteller_root/src/paths/storyteller_rust_root.rs @@ -84,7 +84,21 @@ mod tests { let mut expected = fake_storyteller.clone(); expected.push("storyteller-rust"); - assert_eq!(get_storyteller_rust_root(), expected); + let actual = get_storyteller_rust_root(); + + if actual.starts_with("/private") && !expected.starts_with("/private") { + // NB: For Mac, TempDir creates in /var/... which is an alias of /private/var/... + // We'll make sure to canonicalize both paths. + let mut corrected = PathBuf::from("/private"); + + expected.iter() + .filter(|component| !component.to_string_lossy().eq("/")) + .for_each(|component| corrected.push(component)); + + expected = corrected; + } + + assert_eq!(actual, expected); std::env::remove_var(TEST_HOME); diff --git a/crates/lib/tts_common/src/clean_symbols.rs b/crates/lib/tts_common/src/clean_symbols.rs index a07eef0637..f735719220 100644 --- a/crates/lib/tts_common/src/clean_symbols.rs +++ b/crates/lib/tts_common/src/clean_symbols.rs @@ -175,7 +175,7 @@ mod tests { use crate::clean_symbols::clean_symbols; - const TIME_BOMB_EPOCH_STR : &str = "2023-11-01T00:00:00.00Z"; + const TIME_BOMB_EPOCH_STR : &str = "2024-04-01T00:00:00.00Z"; static TIME_BOMB_EPOCH: Lazy> = Lazy::new(|| { let datetime = DateTime::parse_from_rfc3339(TIME_BOMB_EPOCH_STR) diff --git a/crates/service/web/storyteller_web/src/http_server/endpoints/voice_designer/voices/list_voices_by_session.rs b/crates/service/web/storyteller_web/src/http_server/endpoints/voice_designer/voices/list_voices_by_session.rs index a1f0a8dc34..3a4cf16409 100644 --- a/crates/service/web/storyteller_web/src/http_server/endpoints/voice_designer/voices/list_voices_by_session.rs +++ b/crates/service/web/storyteller_web/src/http_server/endpoints/voice_designer/voices/list_voices_by_session.rs @@ -72,7 +72,7 @@ pub async fn list_voices_by_session_handler( })? .ok_or_else(|| { warn!("not logged in"); - return ListVoicesByUserError::NotAuthorized; + ListVoicesByUserError::NotAuthorized })?; let creator_user_token = user_session.user_token.clone();