From 9e719b159d5df8fae75f1c6d05284094118a02cd Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Thu, 24 Sep 2026 13:28:05 -0500 Subject: [PATCH] test(plugin): skip the rollback test where the user can write a read-only file CI runs as root, which ignores a 0444 mode, so the entry write never fails there and there is nothing to roll back. The test now says it skipped instead of failing on a write that worked. Signed-off-by: Diego Resendez --- tests/plugin.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/plugin.rs b/tests/plugin.rs index f4b9b07..62d6b0f 100644 --- a/tests/plugin.rs +++ b/tests/plugin.rs @@ -490,6 +490,12 @@ fn in_app_leaves_nothing_behind_when_the_entry_cannot_be_written() { let d = project(APP); let entry = d.path().join("src/app.ts"); std::fs::set_permissions(&entry, std::fs::Permissions::from_mode(0o444)).unwrap(); + // Root ignores the mode (CI containers run as root), so there is no failed + // write to roll back from. Say so rather than pass on a write that worked. + if std::fs::OpenOptions::new().write(true).open(&entry).is_ok() { + eprintln!("skipped: this user can write a 0444 file, so the failure cannot be staged"); + return; + } matcha(d.path()) .args(["create", "plugin", "algo"]) .assert()