From 14351f121f6fc8c84b7c6c6eda78ad210e93cfcb Mon Sep 17 00:00:00 2001 From: JJ Liebig Date: Thu, 17 Sep 2026 22:43:35 +0200 Subject: test: skip windows symlink tests without symlink privilege (#4311) Windows refuses file symlinks with ERROR_PRIVILEGE_NOT_HELD (1314) unless the test process is elevated or Developer Mode is enabled, which broke non-admin local runs. Share a helper that reports the missing privilege so the two symlink tests skip only the symlink-dependent assertions. --- src/integration/tests.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/integration/tests.rs') diff --git a/src/integration/tests.rs b/src/integration/tests.rs index f7e2154e..bffe2f45 100644 --- a/src/integration/tests.rs +++ b/src/integration/tests.rs @@ -4,6 +4,8 @@ use super::env::*; use super::file_ops::*; use super::registry::*; use super::targets::*; +#[cfg(windows)] +use super::test_support::symlink_file; use super::types::*; use super::version::*; use super::*; @@ -2565,11 +2567,12 @@ fn opencode_recovery_copy_blocks_retry_before_parsing_or_asset_changes() { fs::write(&referent, "{").unwrap(); let linked_backup = base.join("preferences.json.herdr-backup"); fs::rename(&backup, &linked_backup).unwrap(); - std::os::windows::fs::symlink_file(&referent, &config).unwrap(); - let link_before = fs::read_link(&config).unwrap(); - let error = install_target(target).unwrap_err(); - assert!(error.to_string().contains("preferences.json.herdr-backup")); - assert_eq!(fs::read_link(&config).unwrap(), link_before); + if symlink_file(&referent, &config) { + let link_before = fs::read_link(&config).unwrap(); + let error = install_target(target).unwrap_err(); + assert!(error.to_string().contains("preferences.json.herdr-backup")); + assert_eq!(fs::read_link(&config).unwrap(), link_before); + } assert_eq!(fs::read_to_string(&plugin).unwrap(), "previous integration"); assert!(!dir.join("tui.jsonc").exists()); assert!(!dir.join(OPENCODE_V2_TUI_PLUGIN_DIR).exists()); -- cgit v1.2.3