MCPcopy Create free account
hub / github.com/conforma/cli / processTaskCompletedStatus

Function processTaskCompletedStatus

acceptance/kubernetes/kubernetes.go:268–288  ·  view source on GitHub ↗
(ctx context.Context, want bool)

Source from the content-addressed store, hash-verified

266}
267
268func processTaskCompletedStatus(ctx context.Context, want bool) error {
269 c := testenv.FetchState[ClusterState](ctx)
270
271 if err := mustBeUp(ctx, *c); err != nil {
272 return err
273 }
274
275 got, err := c.cluster.AwaitUntilTaskIsDone(ctx)
276 if err != nil {
277 return err
278 }
279
280 if got != want {
281 if err := logTaskOutput(ctx, *c); err != nil {
282 return err
283 }
284 return fmt.Errorf("the TaskRun did not complete as expected: want=%v, got=%v", want, got)
285 }
286
287 return nil
288}
289
290func logTaskOutput(ctx context.Context, c ClusterState) error {
291 info, err := c.cluster.TaskInfo(ctx)

Callers 2

theTaskShouldSucceedFunction · 0.85
theTaskShouldFailFunction · 0.85

Calls 4

mustBeUpFunction · 0.85
logTaskOutputFunction · 0.85
AwaitUntilTaskIsDoneMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected