(t *testing.T, client *github.Client, owner, repo string)
| 514 | } |
| 515 | |
| 516 | func waitForGithubRepo(t *testing.T, client *github.Client, owner, repo string) { |
| 517 | t.Helper() |
| 518 | ctx, cancel := context.WithTimeout(t.Context(), 2*time.Minute) |
| 519 | defer cancel() |
| 520 | for { |
| 521 | select { |
| 522 | case <-ctx.Done(): |
| 523 | require.NoError(t, ctx.Err(), "timed out waiting for github repo %s/%s to be ready", owner, repo) |
| 524 | case <-time.After(2 * time.Second): |
| 525 | } |
| 526 | _, _, err := client.Repositories.Get(ctx, owner, repo) |
| 527 | if err == nil { |
| 528 | return |
| 529 | } |
| 530 | } |
| 531 | } |
no test coverage detected