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

Function TestMySQLGcloudAuth

tests/mysql_test.go:233–263  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

231}
232
233func TestMySQLGcloudAuth(t *testing.T) {
234 if testing.Short() {
235 t.Skip("skipping MySQL integration tests")
236 }
237 if v := os.Getenv("IP_TYPE"); v == "private" || v == "psc" {
238 t.Skipf("skipping test because IP_TYPE is set to %v", v)
239 }
240 requireMySQLVars(t)
241
242 tcs := []struct {
243 desc string
244 args []string
245 }{
246 {
247 desc: "gcloud user authentication",
248 args: []string{"--gcloud-auth", *mysqlConnName},
249 },
250 {
251 desc: "gcloud user authentication with impersonation",
252 args: []string{
253 "--gcloud-auth",
254 "--impersonate-service-account", *impersonatedUser,
255 *mysqlConnName},
256 },
257 }
258 for _, tc := range tcs {
259 t.Run(tc.desc, func(t *testing.T) {
260 proxyConnTest(t, AddIPTypeFlag(tc.args), "mysql", mysqlDSN())
261 })
262 }
263}
264
265func TestMySQLHealthCheck(t *testing.T) {
266 if testing.Short() {

Callers

nothing calls this directly

Calls 4

requireMySQLVarsFunction · 0.85
proxyConnTestFunction · 0.85
AddIPTypeFlagFunction · 0.85
mysqlDSNFunction · 0.85

Tested by

no test coverage detected