aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRowan Bohde <rowan.bohde@gmail.com>2024-12-12 15:10:47 -0600
committerGitHub <noreply@github.com>2024-12-12 21:10:47 +0000
commita03fdd9566d62abd208af9ae30e58802a658e358 (patch)
treeebb90c2c5faff60cd4e60b2264c2c2374bc596fa /tests
parentab6d819a89c11d2a2ca226c0728dc8c6d58d61cd (diff)
downloadgitea-a03fdd9566d62abd208af9ae30e58802a658e358.tar.gz
gitea-a03fdd9566d62abd208af9ae30e58802a658e358.zip
Avoid MacOS keychain dialog in integration tests (#32813)
Mac's git installation ships with a system wide config that configures the credential helper `osxkeychain`, which will prompt the user with a dialog. ``` $ git config list --system credential.helper=osxkeychain ``` By setting the environment variable [`GIT_CONFIG_NOSYSTEM=true`](https://git-scm.com/docs/git-config#ENVIRONMENT), Git will not load the system wide config, preventing the dialog from populating. Closes #26717
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/integration_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/integration/integration_test.go b/tests/integration/integration_test.go
index 8b6605eac8..6b1b6b8b21 100644
--- a/tests/integration/integration_test.go
+++ b/tests/integration/integration_test.go
@@ -95,6 +95,11 @@ func TestMain(m *testing.M) {
os.Unsetenv("GIT_COMMITTER_EMAIL")
os.Unsetenv("GIT_COMMITTER_DATE")
+ // Avoid loading the default system config. On MacOS, this config
+ // sets the osxkeychain credential helper, which will cause tests
+ // to freeze with a dialog.
+ os.Setenv("GIT_CONFIG_NOSYSTEM", "true")
+
err := unittest.InitFixtures(
unittest.FixturesOptions{
Dir: filepath.Join(filepath.Dir(setting.AppPath), "models/fixtures/"),