fix(test): resolve HOME env race condition in parallel tests

- Use get_home_dir() instead of dirs::home_dir() in get_opencode_dir()
  and get_openclaw_dir() to respect CC_SWITCH_TEST_HOME override
- Add CC_SWITCH_TEST_HOME to all TempHome implementations
- Add #[serial] to all with_test_home tests to share serialization
  with other env-mutating tests
- Remove --test-threads=1 workaround from CI
This commit is contained in:
Jason
2026-04-02 22:08:12 +08:00
parent 8cdc07c860
commit 8b44d9f54d
6 changed files with 46 additions and 7 deletions
+3 -3
View File
@@ -37,9 +37,9 @@ pub fn get_opencode_dir() -> PathBuf {
return override_dir;
}
dirs::home_dir()
.map(|h| h.join(".config").join("opencode"))
.unwrap_or_else(|| PathBuf::from(".config").join("opencode"))
crate::config::get_home_dir()
.join(".config")
.join("opencode")
}
pub fn get_opencode_config_path() -> PathBuf {