diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 15:55:12 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 19:16:37 -0300 |
| commit | 8de3d7b4719bddfd2c24a53e6db9278914c16410 (patch) | |
| tree | 5ad303dd91b3b80e4490dbf0a8ce37a527423b57 /test/process.zig | |
| parent | b48f79a1c19c4c96c30d29d5f8ac5ad19c8e3475 (diff) | |
| download | pardes-8de3d7b4719bddfd2c24a53e6db9278914c16410.tar.gz pardes-8de3d7b4719bddfd2c24a53e6db9278914c16410.zip | |
tests: a test session's state file is its HOME's, never the user's: the process harness's child (when it is given a root), daemon.py and soak.py leave XDG_DATA_HOME unset, as they set HOME, so a session's Recent and dumps go to the test's `.local/share/pardes/pardes.xitdb`; with the user's XDG_DATA_HOME passed on, the dumps a run makes (an Upgrade's `upgrade-<pid>`, the Dump cases) would go into the user's state file, which keeps the newest 32, and push the user's own out, where the `.dump` files a test wrote were only added beside theirs; nothing changes where XDG_DATA_HOME is unset, as on this machine
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/process.zig')
| -rw-r--r-- | test/process.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/process.zig b/test/process.zig index a3679dfd..674996d0 100644 --- a/test/process.zig +++ b/test/process.zig @@ -903,6 +903,10 @@ pub const Child = struct { if (root_z) |r| for ([_][2][*:0]const u8{ .{ "HOME", r }, .{ "XDG_RUNTIME_DIR", r }, .{ "XDG_CONFIG_HOME", config }, .{ "PARDES_NOTIME", "1" }, }) |kv| if (setenv(kv[0], kv[1], 1) != 0) _exit(126); + // A test session's state file is its HOME's (.local/share/pardes), + // never the user's: the dumps a test makes there would push the + // user's out. + if (root_z != null) _ = unsetenv("XDG_DATA_HOME"); for ([_][2][*:0]const u8{ .{ "PARDES_DAEMON", "off" }, .{ "PARDES_LSP_RS", "" }, .{ "PARDES_LSP_C", "" }, .{ "PARDES_LSP_GO", "" }, .{ "PARDES_LSP_TS", "" }, .{ "PARDES_LSP_PY", "" }, |
