From c869fdb23c4dc96b614f967688bb4859d9f66f7b Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 29 Nov 2026 15:12:20 -0500 Subject: [PATCH] test(nightly): preserve startup failure without stable fallback (#4911) --- apps/gridcraft/src/profile_root.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/gridcraft/src/profile_root.rs b/apps/gridcraft/src/profile_root.rs index d03cb49e3..cc6c6e587 100644 --- a/apps/gridcraft/src/profile_root.rs +++ b/apps/gridcraft/src/profile_root.rs @@ -182,6 +182,18 @@ mod tests { } } + #[test] + fn failed_profile_preparation_does_not_start_with_stable() { + let tmp = TempDir::new("file-root"); + let root = tmp.path().join("not-a-directory"); + std::fs::write(&root, b"an ordinary file").unwrap(); + let argv = craft_nightly::launch_arguments(&root, &[]); + let result = + craft_nightly::prepare_launch(craft_nightly::BuildFlavor::NightlyV1, &app_spec(), argv, &craft_nightly::StartupOptions::default()); + assert!(matches!(result, Err(ProfileError::NotADirectory(_)))); + assert_eq!(std::fs::read(&root).unwrap(), b"an ordinary file"); + } + #[test] fn app_spec_preserves_gridcraft_identifiers_and_folder_entries() { let spec = app_spec();