diff --git a/crates/globwatch/Cargo.toml b/crates/globwatch/Cargo.toml index 9af15b20c895b..43a77489e532a 100644 --- a/crates/globwatch/Cargo.toml +++ b/crates/globwatch/Cargo.toml @@ -19,7 +19,7 @@ pin-project = "1.0.12" stop-token = "0.7.0" tokio = { version = "1.25.0", features = ["sync"] } tokio-stream = "0.1.12" -tracing = "0.1.37" +tracing.workspace = true unic-segment = "0.9.0" walkdir = "2.3.2" diff --git a/crates/turborepo-lib/src/commands/mod.rs b/crates/turborepo-lib/src/commands/mod.rs index 501c140db9895..cd91dc26838b2 100644 --- a/crates/turborepo-lib/src/commands/mod.rs +++ b/crates/turborepo-lib/src/commands/mod.rs @@ -169,6 +169,7 @@ mod test { use crate::get_version; + #[cfg(not(target_os = "windows"))] #[test_case("/tmp/turborepo", "6e0cfa616f75a61c"; "basic example")] fn test_repo_hash(path: &str, expected_hash: &str) { use super::CommandBase; @@ -183,4 +184,20 @@ mod test { assert_eq!(hash, expected_hash); assert_eq!(hash.len(), 16); } + + #[cfg(target_os = "windows")] + #[test_case("C:\\\\tmp\\turborepo", "6e0cfa616f75a61c"; "basic example")] + fn test_repo_hash_win(path: &str, expected_hash: &str) { + use super::CommandBase; + use crate::Args; + + let args = Args::default(); + let repo_root = AbsoluteSystemPathBuf::new(path).unwrap(); + let command_base = CommandBase::new(args, repo_root, get_version()).unwrap(); + + let hash = command_base.repo_hash(); + + assert_eq!(hash, expected_hash); + assert_eq!(hash.len(), 16); + } } diff --git a/crates/turborepo-lib/src/config/repo.rs b/crates/turborepo-lib/src/config/repo.rs index a521ed763253d..903395efe6228 100644 --- a/crates/turborepo-lib/src/config/repo.rs +++ b/crates/turborepo-lib/src/config/repo.rs @@ -189,7 +189,13 @@ mod test { #[test] fn test_repo_config_when_missing() -> Result<()> { - let config = RepoConfigLoader::new(PathBuf::from("missing")).load(); + let path = if cfg!(windows) { + "C:\\missing" + } else { + "/missing" + }; + + let config = RepoConfigLoader::new(AbsoluteSystemPathBuf::new(path).unwrap()).load(); assert!(config.is_ok()); Ok(()) @@ -215,7 +221,13 @@ mod test { #[test] fn test_repo_config_includes_defaults() { - let config = RepoConfigLoader::new(PathBuf::from("missing")) + let path = if cfg!(windows) { + "C:\\missing" + } else { + "/missing" + }; + + let config = RepoConfigLoader::new(AbsoluteSystemPathBuf::new(path).unwrap()) .load() .unwrap(); assert_eq!(config.api_url(), DEFAULT_API_URL);