forked from 1b-agent/opencadstudio-upstream
fix(test): keep tests out of the user's config folder
Tests resolved the real per-user config dir. When the alias table version moved, parallel tests migrated and rewrote the user's alias file concurrently and one left it holding a single alias. Under test, config_dir() is a per-process temp folder and the alias table comes from the shipped defaults with no file I/O. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
163763c42a
commit
eae5662099
2 files changed
+12
No files matched your search
@@ -35,6 +35,11 @@ const DEFAULT_ALIASES_PGP: &str = include_str!("../../assets/ocad.pgp");
|
||||
/// config base can't be resolved (headless, no `HOME`).
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
fn alias_file_path() -> Option<PathBuf> {
|
||||
// Tests read the shipped defaults: parallel tests seeding and migrating one
|
||||
// shared file race, and a half-written table fails unrelated alias tests.
|
||||
if cfg!(test) {
|
||||
return None;
|
||||
}
|
||||
Some(crate::config::config_dir()?.join("ocad.pgp"))
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user