MonitorPipeline FIXME
(id uint64)
| 389 | |
| 390 | // MonitorPipeline FIXME |
| 391 | func (d *DevlakeClient) monitorPipeline(id uint64) models.Pipeline { |
| 392 | d.testCtx.Helper() |
| 393 | var previousResult models.Pipeline |
| 394 | endpoint := fmt.Sprintf("%s/pipelines/%d", d.Endpoint, id) |
| 395 | coloredPrintf("calling:\n\t%s %s\nwith:\n%s\n", http.MethodGet, endpoint, string(ToCleanJson(false, nil))) |
| 396 | var pipelineResult models.Pipeline |
| 397 | require.NoError(d.testCtx, runWithTimeout(d.pipelineTimeout, func() (bool, errors.Error) { |
| 398 | pipelineResult = sendHttpRequest[models.Pipeline](d.testCtx, d.pipelineTimeout, &testContext{ |
| 399 | client: d, |
| 400 | printPayload: false, |
| 401 | }, http.MethodGet, fmt.Sprintf("%s/pipelines/%d", d.Endpoint, id), nil, nil) |
| 402 | if pipelineResult.Status == models.TASK_COMPLETED { |
| 403 | coloredPrintf("result: %s\n", ToCleanJson(true, &pipelineResult)) |
| 404 | return true, nil |
| 405 | } |
| 406 | if pipelineResult.Status == models.TASK_FAILED { |
| 407 | coloredPrintf("result: %s\n", ToCleanJson(true, &pipelineResult)) |
| 408 | return true, errors.Default.New("pipeline task failed") |
| 409 | } |
| 410 | if !reflect.DeepEqual(pipelineResult, previousResult) { |
| 411 | coloredPrintf("result: %s\n", ToCleanJson(true, &pipelineResult)) |
| 412 | } |
| 413 | previousResult = pipelineResult |
| 414 | return false, nil |
| 415 | })) |
| 416 | return pipelineResult |
| 417 | } |
| 418 | |
| 419 | func getScopeResponse(scopeRaw map[string]any) ScopeResponse { |
| 420 | response := Cast[ScopeResponse](scopeRaw) |
no test coverage detected