(t *testing.T)
| 482 | } |
| 483 | |
| 484 | func TestWaitForRepositoryReady(t *testing.T) { |
| 485 | // Given a repository whose initialized default branch appears after creation |
| 486 | checks := []bool{false, false, true} |
| 487 | var sleeps []time.Duration |
| 488 | |
| 489 | // When waiting for repository initialization to finish |
| 490 | err := waitForRepositoryReady(func() (bool, error) { |
| 491 | ready := checks[0] |
| 492 | checks = checks[1:] |
| 493 | return ready, nil |
| 494 | }, func(duration time.Duration) { |
| 495 | sleeps = append(sleeps, duration) |
| 496 | }) |
| 497 | |
| 498 | // Then polling continues until the default branch commit is available |
| 499 | require.NoError(t, err) |
| 500 | assert.Equal(t, []time.Duration{repositoryReadyPollInterval, repositoryReadyPollInterval}, sleeps) |
| 501 | } |
| 502 | |
| 503 | func TestWaitForRepositoryReadyTimesOut(t *testing.T) { |
| 504 | // Given a repository whose default branch remains unavailable |
nothing calls this directly
no test coverage detected