(t *testing.T)
| 211 | } |
| 212 | |
| 213 | func TestPostgresGcloudAuth(t *testing.T) { |
| 214 | if testing.Short() { |
| 215 | t.Skip("skipping Postgres integration tests") |
| 216 | } |
| 217 | if v := os.Getenv("IP_TYPE"); v == "private" || v == "psc" { |
| 218 | t.Skipf("skipping test because IP_TYPE is set to %v", v) |
| 219 | } |
| 220 | requirePostgresVars(t) |
| 221 | |
| 222 | tcs := []struct { |
| 223 | desc string |
| 224 | args []string |
| 225 | }{ |
| 226 | { |
| 227 | desc: "gcloud user authentication", |
| 228 | args: []string{"--gcloud-auth", *postgresConnName}, |
| 229 | }, |
| 230 | { |
| 231 | desc: "gcloud user authentication with impersonation", |
| 232 | args: []string{ |
| 233 | "--gcloud-auth", |
| 234 | "--impersonate-service-account", *impersonatedUser, |
| 235 | *postgresConnName}, |
| 236 | }, |
| 237 | } |
| 238 | for _, tc := range tcs { |
| 239 | t.Run(tc.desc, func(t *testing.T) { |
| 240 | proxyConnTest(t, AddIPTypeFlag(tc.args), "pgx", postgresDSN()) |
| 241 | }) |
| 242 | } |
| 243 | |
| 244 | } |
| 245 | |
| 246 | func TestPostgresIAMDBAuthn(t *testing.T) { |
| 247 | if testing.Short() { |
nothing calls this directly
no test coverage detected