Commit 1ea54e2
test: mock the OS keyring in the cli package TestMain
The cli package's TestMain never routed go-keyring to its in-memory mock,
unlike the auth subpackage. The default tokenstore backend is the real OS
keychain, so any cli test that reaches a credential path without
UseFileBackendForTesting — or runs in the window after such a test restores
the global backend — would read the developer's real keychain and trigger a
macOS unlock prompt during `mise run test:ci`.
Call keyring.MockInit() once in TestMain so no cli test can touch the real
keychain, mirroring cmd/entire/cli/auth's TestMain.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: eb9e9029effe1 parent 3eeb08c commit 1ea54e2
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
13 | 22 | | |
14 | 23 | | |
15 | 24 | | |
| |||
0 commit comments