| 71 | } |
| 72 | |
| 73 | func NewWithCommand( |
| 74 | t testing.TB, cmd *serpent.Command, args ...string, |
| 75 | ) (*serpent.Invocation, config.Root) { |
| 76 | configDir := config.Root(t.TempDir()) |
| 77 | // Keyring usage is disabled here when --global-config is set because many existing |
| 78 | // tests expect the session token to be stored on disk and is not properly instrumented |
| 79 | // for parallel testing against the actual operating system keyring. |
| 80 | invArgs := append([]string{"--global-config", string(configDir)}, args...) |
| 81 | return setupInvocation(t, cmd, invArgs...), configDir |
| 82 | } |
| 83 | |
| 84 | func setupInvocation(t testing.TB, cmd *serpent.Command, args ...string, |
| 85 | ) *serpent.Invocation { |