Skip to content

test: Disable commit signing in tests#582

Open
erezrokah wants to merge 1 commit intoentireio:mainfrom
erezrokah:test/disable_commit_signing
Open

test: Disable commit signing in tests#582
erezrokah wants to merge 1 commit intoentireio:mainfrom
erezrokah:test/disable_commit_signing

Conversation

@erezrokah
Copy link
Contributor

Going through the contributing guide and noticed that if you have commit signing enabled (I do) the tests fail.
This PR fixes the issue by disabling it for the relevant tests.

I could also move the logic to a centralized place but that seems premature

Copilot AI review requested due to automatic review settings March 2, 2026 21:14
@erezrokah erezrokah requested a review from a team as a code owner March 2, 2026 21:14
@erezrokah erezrokah changed the title test: Disable commit signing in test test: Disable commit signing in tests Mar 2, 2026
@erezrokah erezrokah force-pushed the test/disable_commit_signing branch from 74b29c0 to 02107a1 Compare March 2, 2026 21:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes unit tests resilient to developers who have global Git commit signing enabled by explicitly disabling commit.gpgsign inside the temporary repositories created by the tests.

Changes:

  • Set git config commit.gpgsign false in initBareWithMetadataBranch to prevent signed commits during strategy tests.
  • Disable commit signing in hook_registry_test.go before creating initial commits in two hook-related tests.
  • Disable commit signing in explain_test.go’s temporary repo setup to keep the test’s empty commit creation working.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
cmd/entire/cli/strategy/common_test.go Disables commit signing in the helper that creates commits for metadata-branch tests.
cmd/entire/cli/hook_registry_test.go Disables commit signing in two tests that create an initial commit as part of repo setup.
cmd/entire/cli/explain_test.go Disables commit signing in the temp repo initialization used by the explain routing test.

Copy link
Contributor

@toothbrush toothbrush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @erezrokah, thanks for raising a PR to improve the CLI!

Rather than poking at a specific config flag that breaks tests in this particular situation, i think a better approach would be to ensure Git uses a "clean" config by ignoring any user-configured flags on the system, something like this:

#513

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants