(t *testing.T)
| 554 | } |
| 555 | |
| 556 | func TestWaitForWorkflowRunStatusStopsWhenRunCompletes(t *testing.T) { |
| 557 | // Given a workflow run that completed before reaching the expected status |
| 558 | view := func() (string, error) { |
| 559 | return "completed", nil |
| 560 | } |
| 561 | |
| 562 | // When waiting for a status the run can no longer reach |
| 563 | err := waitForWorkflowRunStatus(view, "in_progress", func(time.Duration) { |
| 564 | t.Fatal("unexpected sleep") |
| 565 | }) |
| 566 | |
| 567 | // Then the failed precondition is reported immediately |
| 568 | require.EqualError(t, err, `workflow run completed before reaching status "in_progress"`) |
| 569 | } |
| 570 | |
| 571 | func TestWaitForWorkflowRunStatusTimesOut(t *testing.T) { |
| 572 | // Given a workflow run that remains queued |
nothing calls this directly
no test coverage detected