Skip to content

Harden deep worktree process fixtures - #575

Merged
coneilen merged 1 commit into
mainfrom
coneilen-microsoft-fix-deep-worktree-fixtures
Oct 2, 2026
Merged

coneilen merged 1 commit into
mainfrom
coneilen-microsoft-fix-deep-worktree-fixtures

Conversation

@coneilen

@coneilen coneilen commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Make the Windows WorktreeGitProcess fixtures reliable from app-managed deep worktrees by keeping immutable evidence under the checkout while moving disposable executables, caches, TEMP/TMP, and Git repositories to a bounded short per-run root.

Closes #561.

Changes

  • Add an isolated FixtureDirectory for all disposable process-test state and clean it after every run.
  • Reject overlapping evidence/fixture roots and projected Git metadata paths above the 259-character legacy Win32 budget before setup.
  • Preserve immutable logs, invalid-selector rejection, child-process cleanup, output-ownership cases, and explicit positive executed-case counts.
  • Register the Windows shell suite with a unique fixture root under the process TEMP directory.

Test plan

The checkout root was 112 characters. Before the fix, the focused case root reached 218 characters and failed during git init. The corrected focused run used a 28-character fixture root with a 131-character longest projected Git metadata path. The final full run used a 27-character fixture root with a 130-character projection.

An initial post-pass wrapper expected a 138-character projection instead of the measured 130 and returned failure after the suite itself passed; the corrected focused run below is the canonical GREEN evidence.

RED: pwsh -NoProfile -File Tools\windows\Tests\WorktreeGitProcess.Tests.ps1 -Zig C:\gc561-tools-ac495172\zig-0.15.2\zig.exe -EvidenceDirectory graphcode-windows.zig-cache\worktree-process-red-561 -Cases scope-config-count -> 1 process regression case failed at a 218-character fixture root
GREEN: pwsh -NoProfile -File Tools\windows\Tests\WorktreeGitProcess.Tests.ps1 -Zig C:\gc561-tools-ac495172\zig-0.15.2\zig.exe -EvidenceDirectory graphcode-windows.zig-cache\worktree-process-green2-561 -FixtureDirectory C:\gc561-run-green2-ac495172 -Cases scope-config-count -> requested=1 rejection=4 executed=5 PASS
REGRESSION: pwsh -NoProfile -File Tools\windows\Tests\WorktreeGitProcess.Tests.ps1 -Zig C:\gc561-tools-ac495172\zig-0.15.2\zig.exe -EvidenceDirectory graphcode-windows.zig-cache\worktree-process-regression2-561 -FixtureDirectory C:\gc561-run-final-ac495172 -> requested=17 rejection=4 executed=21 PASS with 21 immutable case logs

Also verified that a 263-character projected Git metadata path fails before evidence creation with the path-budget diagnostic, overlapping evidence/fixture roots are rejected, both PowerShell files parse, git diff --check passes, and the Windows shell eight-shard plan builds successfully.

make test and make check were not run because this is a Windows-only PowerShell validation-harness change; the focused and adjacent executable fixture suites above cover the changed behavior.

Checklist

  • I have read the Contributing Guidelines
  • I have signed off my commits (git commit -s) per the DCO
  • Tests pass locally (make test)
  • Code follows the existing style (make check)
  • I added the test/contract before the implementation and observed the intended RED failure

@coneilen
coneilen force-pushed the coneilen-microsoft-fix-deep-worktree-fixtures branch 5 times, most recently from 3dcd803 to a2c9594 Compare October 2, 2026 01:43
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@coneilen
coneilen force-pushed the coneilen-microsoft-fix-deep-worktree-fixtures branch from a2c9594 to c0f3a8e Compare October 2, 2026 03:41
@coneilen
coneilen merged commit 7d38268 into main Oct 2, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WorktreeGitProcess.Tests.ps1 fails when the checkout path is deep (fixture paths exceed MAX_PATH)

1 participant