(t *testing.T, creds *Credentials)
| 271 | } |
| 272 | |
| 273 | func backendForCreds(t *testing.T, creds *Credentials) *Backend { |
| 274 | t.Helper() |
| 275 | t.Setenv("AWS_ACCESS_KEY_ID", "test") |
| 276 | t.Setenv("AWS_SECRET_ACCESS_KEY", "test") |
| 277 | t.Setenv("AWS_REGION", "us-east-1") |
| 278 | // EC2_METADATA_SERVICE_ENDPOINT to a bogus host stops the SDK from |
| 279 | // trying IMDS during config load when no static creds are picked |
| 280 | // up — defensive in case the env-var pickup order changes. |
| 281 | t.Setenv("AWS_EC2_METADATA_DISABLED", "true") |
| 282 | |
| 283 | b, err := NewBackend(context.Background(), creds) |
| 284 | require.NoError(t, err) |
| 285 | return b |
| 286 | } |
| 287 | |
| 288 | // assertFailedClosed checks that an error originated from the |
| 289 | // missing-context guard, whether returned directly or wrapped by the |
no test coverage detected