From c8bf5e559e3aa6ac8fadb970762b1360e35f87c0 Mon Sep 17 00:00:00 2001 From: Surma Date: Sat, 7 Nov 2026 15:15:52 +0000 Subject: [PATCH] Build undo harness guests in the shared target --- host/tests/undo_harness.rs | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/host/tests/undo_harness.rs b/host/tests/undo_harness.rs index 5c4e6ca..b7b272f 100644 --- a/host/tests/undo_harness.rs +++ b/host/tests/undo_harness.rs @@ -41,6 +41,45 @@ async fn command(runtime: &Arc, args: &[&str]) -> String { #[tokio::test(flavor = "current_thread")] async fn tools_restore_one_call_or_the_whole_turn() { let target = PathBuf::from(std::env::var("CARGO_TARGET_DIR").unwrap()); + let repo = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap(); + assert!( + std::process::Command::new("nu") + .args(["--no-config-file", "userland/cwd-init/build.nu"]) + .current_dir(repo) + .status() + .unwrap() + .success() + ); + assert!( + std::process::Command::new("cargo") + .args([ + "build", + "--release", + "--locked", + "--target", + "wasm32-wasip2", + "-p", + "git", + "-p", + "undo", + "--target-dir" + ]) + .arg(&target) + .args(["-j", "2"]) + .current_dir(repo.join("userland")) + .status() + .unwrap() + .success() + ); + assert!( + std::process::Command::new("nu") + .args(["--no-config-file", "userland/brush/build.nu"]) + .env("CARGO_TARGET_DIR", &target) + .current_dir(repo) + .status() + .unwrap() + .success() + ); for since in [false, true] { let temp = tempfile::tempdir().unwrap(); let world = World::open(temp.path()).unwrap();