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

test_helper: make test setup more hermetic #155

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nasamuffin
Copy link

When running tests locally outside of a container (e.g. git clone
git-secrets; make test), if a user is already using git-secrets by
default in their system config and default gitdir template, tests which
expect not to have git-secrets installed will fail. Instead, let's
remove all hooks when we create a directory without the testbench's
template and ignore the system config which may contain patterns that
conflict with the testbench.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

When running tests locally outside of a container (e.g. git clone
git-secrets; make test), if a user is already using git-secrets by
default in their system config and default gitdir template, tests which
expect not to have git-secrets installed will fail. Instead, let's
remove all hooks when we create a directory without the testbench's
template and ignore the system config which may contain patterns that
conflict with the testbench.
@@ -1,4 +1,6 @@
#!/bin/bash
# Disallow any system-level git-secret pattern configs
export GIT_CONFIG_NOSYSTEM="true"
Copy link
Contributor

@sparr sparr Jun 21, 2023

Choose a reason for hiding this comment

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

I think GIT_CONFIG_SYSTEM="" is the modern (git 2.32+) equivalent of this.
This might need GIT_CONFIG_GLOBAL="" as well.
Doing all three, plus the now removed GIT_CONFIG_NOGLOBAL="true", will likely produce the widest range of supported git versions.

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.

2 participants