Three tests pass on Windows with an 8.3 TEMP path (#8968)

On a Windows account whose %TEMP% is a short (8.3) path, such as
C:\Users\MATHEU~1\AppData\Local\Temp, three tests failed because they built
their folders from std::env::temp_dir(), and the agent file scope refuses short
names ("not allowed for this agent: short (8.3) names such as `PROGRA~1`"):

- engine: cmd::render::settings_tests::embedded_hdr_capture_rejects_parameters_scope_and_cpu_primaries_without_mutation
- ui-egui: agent_chat::tests::file_actions_wait_for_the_user
- ui-egui: agent_chat::tests::permission_modes_decide_what_asks

They now use vfs::temp_dir(), which spells the folder with long names, as
libraries_tests and motion_tests already do (#1385, #1211).

Checked on Windows 11 x64 with the 8.3 TEMP: the agent_chat and
render::settings tests (113) pass, and clippy -D warnings is clean for both
crates.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MATHEUS PINHEIRO RAPOSO
2026-10-29 19:13:36 +00:00
committed by GitHub
parent a4fd998539
commit 70d39bb4f3
2 changed files with 3 additions and 3 deletions
@@ -625,7 +625,7 @@ fn embedded_hdr_capture_rejects_parameters_scope_and_cpu_primaries_without_mutat
assert_eq!(state, (s.revision, s.undo.len(), s.redo.len()));
}
let nonce = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_nanos();
let dir = std::env::temp_dir().join(format!("solidcraft-hdr-scope-{}-{nonce}", std::process::id()));
let dir = solidcraft_io::vfs::temp_dir().join(format!("solidcraft-hdr-scope-{}-{nonce}", std::process::id()));
std::fs::create_dir(&dir).unwrap();
let allowed = dir.join("allowed");
std::fs::create_dir(&allowed).unwrap();
+2 -2
View File
@@ -214,7 +214,7 @@ fn a_messages_changes_undo_as_one_step() {
#[test]
fn file_actions_wait_for_the_user() {
let (mut app, tx) = app_in_a_turn();
let dir = std::env::temp_dir().join(format!("sc-agent-chat-approve-{}", std::process::id()));
let dir = solidcraft_engine::io::vfs::temp_dir().join(format!("sc-agent-chat-approve-{}", std::process::id()));
std::fs::create_dir_all(&dir).unwrap();
let path = dir.join("a.solidcraft");
let save = json!({"command": "file.save", "params": {"path": path.to_string_lossy()}, "allow_paths": [dir.to_string_lossy()]});
@@ -466,7 +466,7 @@ fn permission_modes_decide_what_asks() {
decline_all(&mut app, "test");
// Allow everything, set for this agent only.
app.preferences.agent_permissions.insert("codex".into(), agents::Mode::All);
let dir = std::env::temp_dir().join(format!("sc-agent-chat-all-{}", std::process::id()));
let dir = solidcraft_engine::io::vfs::temp_dir().join(format!("sc-agent-chat-all-{}", std::process::id()));
std::fs::create_dir_all(&dir).unwrap();
let path = dir.join("b.solidcraft");
let save = ask(