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

Function TestWaitForWorkflow

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

Source from the content-addressed store, hash-verified

442}
443
444func TestWaitForWorkflow(t *testing.T) {
445 // Given a workflow definition that appears after GitHub processes the pushed file
446 var attempts int
447 var sleeps []time.Duration
448
449 // When waiting for the workflow by name
450 err := waitForWorkflow(func() ([]string, error) {
451 attempts++
452 if attempts == 3 {
453 return []string{"Other Workflow", "Test Workflow Name"}, nil
454 }
455 return []string{"Other Workflow"}, nil
456 }, "Test Workflow Name", func(duration time.Duration) {
457 sleeps = append(sleeps, duration)
458 })
459
460 // Then polling continues until that exact workflow is registered
461 require.NoError(t, err)
462 assert.Equal(t, []time.Duration{workflowPollInterval, workflowPollInterval}, sleeps)
463}
464
465func TestWaitForWorkflowTimesOut(t *testing.T) {
466 // Given a pushed workflow definition that never appears

Callers

nothing calls this directly

Calls 2

waitForWorkflowFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected