(t *testing.T)
| 569 | } |
| 570 | |
| 571 | func TestWaitForWorkflowRunStatusTimesOut(t *testing.T) { |
| 572 | // Given a workflow run that remains queued |
| 573 | var attempts int |
| 574 | var sleeps int |
| 575 | |
| 576 | // When waiting for it to start |
| 577 | err := waitForWorkflowRunStatus(func() (string, error) { |
| 578 | attempts++ |
| 579 | return "queued", nil |
| 580 | }, "in_progress", func(time.Duration) { |
| 581 | sleeps++ |
| 582 | }) |
| 583 | |
| 584 | // Then the wait stops after one minute |
| 585 | require.EqualError(t, err, `workflow run did not reach status "in_progress" within 60 seconds`) |
| 586 | assert.Equal(t, 61, attempts) |
| 587 | assert.Equal(t, 60, sleeps) |
| 588 | } |
| 589 | |
| 590 | func TestOutputForEnvironment(t *testing.T) { |
| 591 | value, err := outputForEnvironment("1234\n") |
nothing calls this directly
no test coverage detected