Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for failing tests when GPG Signing is enabled globally #949

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DominikJaniec
Copy link

Have a global .gitconfig with:

[commit]
    gpgSign = true

Which makes Invoke-Pester to fail tests with:

  • One in Get-GitDirectory.Tests.ps1: Returns the correct dir when under a worktree
  • Three of Get-GitStatus.Tests.ps1 - all under: Context Branch progress suffix
  • A few from TabExpansion.Tests.ps1 - in contexts as:
    • Git Config Alias TabExpansion Tests
    • PowerShell Alias TabExpansion Tests
    • PowerShell Special Chars Tests

Those tests will fail, as they could not make commits. Moreover, some tests were being "polluting" global configuration with some test aliases, which were not removed after theirs execution.

Thus, your .gitconfig file became something like:

[commit]
    gpgSign = true
[alias]
	test-944577f4-7f84-4473-931d-93b95d9a65fd = config
	co = checkout

This PR should fix that, and tests should not be broken due to GPG configuration, and no foreign aliases should stay.

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.

1 participant