Summary
ProgramRunnerTests.GlobalToolLog_OverrideDirectory_ExpandsHomeShorthand fails when the test process runs with HOME redirected to a sandbox directory. The production resolver expands ~, $HOME, and ${HOME} from the environment, while the test builds its expected path with Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), which can continue to return the OS account profile.
Observed behavior
A wider ProgramRunnerTests run during Codex adversarial review failed all three theory cases:
~/cdidx-logs
$HOME/cdidx-logs
${HOME}/cdidx-logs
Expected: /Users/widthdom/cdidx-logs
Actual: the sandboxed /var/folders/.../cdidx-logs path selected through HOME.
Reproduction context
dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --no-restore --no-build -f net8.0 --filter "FullyQualifiedName~ProgramRunnerTests" --logger "console;verbosity=minimal"
The failure is environment-dependent and was observed with HOME intentionally redirected by the review sandbox. The test should derive its expectation from the environment semantics it is exercising, or explicitly establish the intended user-profile contract before resolving the path.
Discovered while validating #4801; unrelated to that fix.
Summary
ProgramRunnerTests.GlobalToolLog_OverrideDirectory_ExpandsHomeShorthandfails when the test process runs withHOMEredirected to a sandbox directory. The production resolver expands~,$HOME, and${HOME}from the environment, while the test builds its expected path withEnvironment.GetFolderPath(Environment.SpecialFolder.UserProfile), which can continue to return the OS account profile.Observed behavior
A wider
ProgramRunnerTestsrun during Codex adversarial review failed all three theory cases:~/cdidx-logs$HOME/cdidx-logs${HOME}/cdidx-logsExpected:
/Users/widthdom/cdidx-logsActual: the sandboxed
/var/folders/.../cdidx-logspath selected throughHOME.Reproduction context
The failure is environment-dependent and was observed with
HOMEintentionally redirected by the review sandbox. The test should derive its expectation from the environment semantics it is exercising, or explicitly establish the intended user-profile contract before resolving the path.Discovered while validating #4801; unrelated to that fix.