Run starts the named workflow and waits for it to reach a terminal state. Fails the test on any error via require — top-level test usage: status := httpapi.Run(t, ctx, httpClient, port, name, input, 30*time.Second) require.Equal(t, httpapi.StatusCompleted, status.RuntimeStatus) Inside an assert.
(t *testing.T, ctx context.Context, httpClient *http.Client, httpPort int, workflowName string, input any, timeout time.Duration)
| 66 | // Inside an assert.EventuallyWithT closure, use TryRun instead — it returns |
| 67 | // an error so the caller can decide whether to fail the tick. |
| 68 | func Run(t *testing.T, ctx context.Context, httpClient *http.Client, httpPort int, workflowName string, input any, timeout time.Duration) Status { |
| 69 | t.Helper() |
| 70 | status, err := TryRun(ctx, httpClient, httpPort, workflowName, input, timeout) |
| 71 | require.NoError(t, err) |
| 72 | return status |
| 73 | } |
| 74 | |
| 75 | // TryRun is the error-returning variant of Run. Synchronous polling, no |
| 76 | // internal goroutines, so it is safe to call from inside an |