MCPcopy Index your code
hub / github.com/GoogleCloudPlatform/cloud-sql-proxy / invokeProxyCommand

Function invokeProxyCommand

cmd/root_test.go:82–96  ·  view source on GitHub ↗
(args []string)

Source from the content-addressed store, hash-verified

80}
81
82func 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
98func TestUserAgentWithVersionEnvVar(t *testing.T) {
99 os.Setenv("CSQL_PROXY_USER_AGENT", "cloud-sql-proxy-operator/0.0.1")

Calls 2

NewCommandFunction · 0.85
ExecuteMethod · 0.80

Tested by

no test coverage detected