diff --git a/Cargo.lock b/Cargo.lock index 7e063864..b3d21820 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,7 +19,7 @@ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "agent-client" -version = "0.5.1" +version = "0.5.2" dependencies = [ "libc", "reqwest", @@ -30,7 +30,7 @@ dependencies = [ [[package]] name = "agent-runtime" -version = "0.5.1" +version = "0.5.2" dependencies = [ "agent-client", "aws-lc-rs", @@ -2486,7 +2486,7 @@ dependencies = [ [[package]] name = "sonny" -version = "0.5.1" +version = "0.5.2" dependencies = [ "agent-client", "base64 0.22.1", diff --git a/Cargo.toml b/Cargo.toml index 6bfb13f6..ec464e10 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "agent-runtime" -version = "0.5.1" +version = "0.5.2" edition = "2024" rust-version = "1.92" license = "MIT OR Apache-2.0" diff --git a/client/Cargo.toml b/client/Cargo.toml index 184b5c28..82ec8eeb 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "agent-client" -version = "0.5.1" +version = "0.5.2" edition = "2024" rust-version = "1.92" license = "MIT OR Apache-2.0" diff --git a/sonny/Cargo.toml b/sonny/Cargo.toml index 1a41a022..f2dccfd8 100644 --- a/sonny/Cargo.toml +++ b/sonny/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sonny" -version = "0.5.1" +version = "0.5.2" edition = "2024" rust-version = "1.92" license = "MIT OR Apache-2.0" diff --git a/sonny/tests/task.rs b/sonny/tests/task.rs index a3416c6f..958cb7ac 100644 --- a/sonny/tests/task.rs +++ b/sonny/tests/task.rs @@ -2,9 +2,9 @@ //! runs them (`sonny tool NAME`), with a stand-in for the daemon's //! `agent`: a task gets a worktree by default and a sandfs copy when Sonny //! is set to, is started there with what the lead asked for, and a start -//! that fails leaves no folder behind. The sandfs case mounts for real, so it needs what a -//! mount needs: FUSE 3 on Linux, nothing on macOS. -use std::os::unix::fs::PermissionsExt; +//! that fails leaves no folder behind. Sandfs uses a cloned folder when +//! supported, otherwise a real mount that needs FUSE 3 on Linux. +use std::os::unix::fs::{MetadataExt, PermissionsExt}; use std::path::{Path, PathBuf}; use std::process::Command; @@ -363,10 +363,15 @@ fn a_sandfs_task_copy_takes_the_checkout_and_pushes_back() { lab.git(©, &["commit", "-q", "--allow-empty", "-m", "loose"]); let (ok, err) = lab.remove(&lab.repo, false); assert!(!ok && err.contains("on HEAD"), "{err}"); - // Left unmounted, as by a restart, it is mounted again to be checked. + // A real mount left unmounted, as by a restart, is mounted again to be + // checked. Sandfs may instead keep the copy as a cloned folder. let sandfs = sandfs::Home::at(lab.home.join("sandfs")).unwrap(); - sandfs.unmount("demo.fix").unwrap(); - assert!(!copy.join(".git").exists()); + if std::fs::metadata(©).unwrap().dev() + != std::fs::metadata(copy.parent().unwrap()).unwrap().dev() + { + sandfs.unmount("demo.fix").unwrap(); + assert!(!copy.join(".git").exists()); + } let (ok, err) = lab.remove(&lab.repo, false); assert!(!ok && err.contains("on HEAD"), "{err}"); // A tag keeps it too, as does a stash. @@ -380,7 +385,7 @@ fn a_sandfs_task_copy_takes_the_checkout_and_pushes_back() { let (ok, err) = lab.remove(&lab.repo, false); assert!(!ok && err.contains("on stash@{0}"), "{err}"); lab.git(©, &["stash", "drop", "-q"]); - // Unmounted, so the folder can go with the test. + // The clean copy can now go with the test. let (ok, err) = lab.remove(&lab.repo, false); assert!(ok, "{err}"); assert!(sandfs.workspaces().unwrap().is_empty());