Skip to content

test: Isolate fixture repositories from global git configuration - #88

Open
chucklever wants to merge 1 commit into
facebookexperimental:mainfrom
chucklever:isolate-fixture-git-config
Open

chucklever wants to merge 1 commit into
facebookexperimental:mainfrom
chucklever:isolate-fixture-git-config

Conversation

@chucklever

Copy link
Copy Markdown
Contributor

The test helpers that shell out to git pin author and committer identity through the environment but leave configuration inherited, so a fixture repository behaves differently depending on who runs the suite. With tag.gpgSign set, the bare git tag v1 in create_merge_repo() becomes a signed annotated tag and fails for want of a message. All three list_shas_in_range tests then abort during fixture setup. A commit.gpgSign or gpg.format setting breaks every other fixture the same way, at its first git commit.

Point GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM at /dev/null in every git shell-out under src/ and tests/ so a fixture sees only the repository it creates.

The test helpers that shell out to git pin author and committer
identity through the environment but leave configuration inherited,
so a fixture repository behaves differently depending on who runs
the suite. With tag.gpgSign set, the bare `git tag v1` in
create_merge_repo() becomes a signed annotated tag and fails for
want of a message. All three list_shas_in_range tests then abort
during fixture setup. A commit.gpgSign or gpg.format setting breaks
every other fixture the same way, at its first `git commit`.

Point GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM at /dev/null in every
git shell-out under src/ and tests/ so a fixture sees only the
repository it creates.

Fixes: 636e4ea ("test: add regression tests for list_shas_in_range with merge topology")
Signed-off-by: Chuck Lever <cel@kernel.org>
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant