github.com/kubeshop/testkube@v1.17.23/pkg/mapper/executions/summary.go (about)

     1  package executions
     2  
     3  import "github.com/kubeshop/testkube/pkg/api/v1/testkube"
     4  
     5  // MapToSummary maps testkube.Execution to testkube.ExecutionSummary for lists without so many details.
     6  func MapToSummary(execution *testkube.Execution) *testkube.ExecutionSummary {
     7  	var status *testkube.ExecutionStatus
     8  	if execution.ExecutionResult != nil {
     9  		status = execution.ExecutionResult.Status
    10  	}
    11  
    12  	return &testkube.ExecutionSummary{
    13  		Id:        execution.Id,
    14  		Name:      execution.Name,
    15  		Number:    execution.Number,
    16  		TestName:  execution.TestName,
    17  		TestType:  execution.TestType,
    18  		Status:    status,
    19  		StartTime: execution.StartTime,
    20  		EndTime:   execution.EndTime,
    21  	}
    22  }