Skip to content

Commit 4fe19fc

Browse files
GiteaBotbohde
andauthored
Avoid MacOS keychain dialog in integration tests (#32813) (#32816)
Backport #32813 by @bohde 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 Co-authored-by: Rowan Bohde <[email protected]>
1 parent b54b6d1 commit 4fe19fc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: tests/integration/integration_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ func TestMain(m *testing.M) {
118118
os.Unsetenv("GIT_COMMITTER_EMAIL")
119119
os.Unsetenv("GIT_COMMITTER_DATE")
120120

121+
// Avoid loading the default system config. On MacOS, this config
122+
// sets the osxkeychain credential helper, which will cause tests
123+
// to freeze with a dialog.
124+
os.Setenv("GIT_CONFIG_NOSYSTEM", "true")
125+
121126
err := unittest.InitFixtures(
122127
unittest.FixturesOptions{
123128
Dir: filepath.Join(filepath.Dir(setting.AppPath), "models/fixtures/"),

0 commit comments

Comments
 (0)