Skip to content

test: self-manage .git in gitignore fixture tests#2908

Open
vmaerten wants to merge 1 commit into
mainfrom
test/gitignore-self-manage-git
Open

test: self-manage .git in gitignore fixture tests#2908
vmaerten wants to merge 1 commit into
mainfrom
test/gitignore-self-manage-git

Conversation

@vmaerten

@vmaerten vmaerten commented Jul 3, 2026

Copy link
Copy Markdown
Member

Summary

fixes #2907

The use_gitignore filtering added in 616433d resolves a repository root by walking up the directory tree to a .git entry (internal/fingerprint/gitignore.go). When the tests run inside an in-tree checkout, the fixtures under testdata/gitignore* inherit go-task's own .git, so filtering activates and the golden fixtures match.

Test plan

  • Simulated a tarball build by copying the tree without .git:
    • Before: go test . -run TestGitignore fails on the ignored file modified steps.
    • After: passes.
  • In a normal git checkout: go test . -run TestGitignore still passes, no golden files changed, git status clean after the run (fixture .git is cleaned up).
  • Full suite go test ./... passes with no regressions.

The use_gitignore filtering resolves a repo root by walking up to a
.git entry. An in-tree checkout inherits go-task's own .git, but a
GitHub source tarball (common for distro packaging) has none, which
silently disabled filtering and broke the golden fixtures.

Have the gitignore integration tests create and clean up their own
.git marker in the fixture dir so they validate real behavior
regardless of the build source.
@vmaerten vmaerten marked this pull request as ready for review July 3, 2026 14:21
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.

[v3.52.0 regression] Tests fail when built from source archive

1 participant