(args []string)
| 80 | } |
| 81 | |
| 82 | func invokeProxyCommand(args []string) (*Command, error) { |
| 83 | c := NewCommand() |
| 84 | // Keep the test output quiet |
| 85 | c.SilenceUsage = true |
| 86 | c.SilenceErrors = true |
| 87 | // Disable execute behavior |
| 88 | c.RunE = func(*cobra.Command, []string) error { |
| 89 | return nil |
| 90 | } |
| 91 | c.SetArgs(args) |
| 92 | |
| 93 | err := c.Execute() |
| 94 | |
| 95 | return c, err |
| 96 | } |
| 97 | |
| 98 | func TestUserAgentWithVersionEnvVar(t *testing.T) { |
| 99 | os.Setenv("CSQL_PROXY_USER_AGENT", "cloud-sql-proxy-operator/0.0.1") |
no test coverage detected