Skip to content

Isolate Git-based tests from user configuration - #231

Merged
Widthdom merged 1 commit into
mainfrom
agent/isolate-test-git-config-217
Jul 25, 2026
Merged

Isolate Git-based tests from user configuration#231
Widthdom merged 1 commit into
mainfrom
agent/isolate-test-git-config-217

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

CLOSES #217

Summary

  • add a shared TestGitRepository initialization path for every temporary Git repository used by the test suite
  • isolate global/system Git configuration, user home/XDG files, attributes, templates, hooks, repository/identity environment variables, and interactive prompts
  • set deterministic local identity and explicitly disable commit/tag signing without modifying user configuration
  • migrate the three release tag-resolution tests to the shared helper
  • add regression coverage for global commit/tag signing, missing signing keys, default user excludes, and annotated tags
  • document the common setup in the bilingual testing guide and changelog

Root cause and impact

The existing tests initialized repositories directly and therefore inherited settings such as commit.gpgSign=true. Signed commits could prompt, fail, or hang on developer machines. Other inherited inputs such as GIT_CONFIG and per-user ignore files could also make otherwise deterministic test setup fail.

Validation

  • dotnet build FolderDiffIL4DotNet.sln --configuration Release --no-restore --nologo -m:1
  • dotnet test FolderDiffIL4DotNet.Tests/FolderDiffIL4DotNet.Tests.csproj --configuration Release --no-restore --nologo -m:1 — 2035 passed, 1 existing E2E opt-in skip
  • focused regression run with parent GIT_CONFIG=/dev/null — 4 passed
  • changed C# files pass dotnet format --verify-no-changes
  • python3 scripts/validate-test-scope-map.py — 93/93 test classes documented
  • git diff --check
  • adversarial review of origin/main..HEAD — no remaining findings

The repository-wide format check still reports pre-existing whitespace findings in unrelated files; all C# files changed by this PR pass the scoped format check.

@Widthdom
Widthdom marked this pull request as ready for review July 25, 2026 06:37
@Widthdom
Widthdom merged commit 4f0a9c5 into main Jul 25, 2026
9 checks passed
@Widthdom
Widthdom deleted the agent/isolate-test-git-config-217 branch July 25, 2026 06:37
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.

Make Git-based tests independent of user Git configuration

1 participant