Skip to content

Commit a03fdd9

Browse files
authored
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
1 parent ab6d819 commit a03fdd9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/integration/integration_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ func TestMain(m *testing.M) {
9595
os.Unsetenv("GIT_COMMITTER_EMAIL")
9696
os.Unsetenv("GIT_COMMITTER_DATE")
9797

98+
// Avoid loading the default system config. On MacOS, this config
99+
// sets the osxkeychain credential helper, which will cause tests
100+
// to freeze with a dialog.
101+
os.Setenv("GIT_CONFIG_NOSYSTEM", "true")
102+
98103
err := unittest.InitFixtures(
99104
unittest.FixturesOptions{
100105
Dir: filepath.Join(filepath.Dir(setting.AppPath), "models/fixtures/"),

0 commit comments

Comments
 (0)