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

Unit testing on macOS invokes keychain #26717

Closed
harryzcy opened this issue Aug 24, 2023 · 5 comments · Fixed by #32813
Closed

Unit testing on macOS invokes keychain #26717

harryzcy opened this issue Aug 24, 2023 · 5 comments · Fixed by #32813
Labels
issue/workaround it is or has a workaround topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile type/testing
Milestone

Comments

@harryzcy
Copy link
Contributor

Description

Running test-sqlite on macOS causes keychain prompt to show up.

Screenshot 2023-08-24 at 4 07 48 PM

Gitea Version

main branch

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

TAGS="sqlite sqlite_unlock_notify" make build test-sqlite

Database

None

@KN4CK3R
Copy link
Member

KN4CK3R commented Aug 26, 2023

Same on WSL because git uses the agent to request credentials.

@wolfogre
Copy link
Member

wolfogre commented Sep 4, 2023

I am also troubled by this issue, and I would appreciate it if someone could solve it.

@wxiaoguang
Copy link
Contributor

Which test triggers it?

@lunny lunny added topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile and removed type/bug labels Mar 27, 2024
@william-allspice
Copy link
Contributor

For anyone else following, you can get around this on a mac by running the tests with the GIT_CONFIG_NOSYSTEM=true flag.

ie. GIT_CONFIG_NOSYSTEM=true make test-sqlite

Credit to @bohde for diagnosing it.

@lunny lunny added the issue/workaround it is or has a workaround label Dec 12, 2024
@bohde
Copy link
Contributor

bohde commented Dec 12, 2024

I think I saw this in TestDumpRestore and TestGit. Dismissing the notification appears to cause the fallback to be cached, which makes it difficult to catch every test that may cause this though.

techknowlogick pushed a commit that referenced this issue Dec 12, 2024
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
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Dec 12, 2024
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 go-gitea#26717
lunny pushed a commit that referenced this issue Dec 12, 2024
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]>
@lunny lunny added this to the 1.22.6 milestone Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/workaround it is or has a workaround topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile type/testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants