MCPcopy Create free account
hub / github.com/cli/cli / TestWaitForRepositoryReady

Function TestWaitForRepositoryReady

acceptance/acceptance_test.go:484–501  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

482}
483
484func 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
503func TestWaitForRepositoryReadyTimesOut(t *testing.T) {
504 // Given a repository whose default branch remains unavailable

Callers

nothing calls this directly

Calls 2

waitForRepositoryReadyFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected