(t *testing.T)
| 231 | } |
| 232 | |
| 233 | func 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 | |
| 265 | func TestMySQLHealthCheck(t *testing.T) { |
| 266 | if testing.Short() { |
nothing calls this directly
no test coverage detected