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

Function TestWaitForWorkflowRunStatus

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

Source from the content-addressed store, hash-verified

535}
536
537func TestWaitForWorkflowRunStatus(t *testing.T) {
538 // Given a workflow run that is registered but still queued
539 statuses := []string{"queued", "in_progress"}
540 var sleeps []time.Duration
541
542 // When waiting for the run to start
543 err := waitForWorkflowRunStatus(func() (string, error) {
544 status := statuses[0]
545 statuses = statuses[1:]
546 return status, nil
547 }, "in_progress", func(duration time.Duration) {
548 sleeps = append(sleeps, duration)
549 })
550
551 // Then polling continues until cancellation can target the active run
552 require.NoError(t, err)
553 assert.Equal(t, []time.Duration{workflowRunStatusPollInterval}, sleeps)
554}
555
556func TestWaitForWorkflowRunStatusStopsWhenRunCompletes(t *testing.T) {
557 // Given a workflow run that completed before reaching the expected status

Callers

nothing calls this directly

Calls 2

waitForWorkflowRunStatusFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected