Skip to content

Commit

Permalink
fix: rename field
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Sukhin <vladislav@kubeshop.io>
  • Loading branch information
vsukhin committed Feb 5, 2025
1 parent 96e04d7 commit 5ecab91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/cloud/data/webhook/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "github.com/kubeshop/testkube/pkg/api/v1/testkube"

type WebhookExecutionCollectResultRequest struct {
ExecutionID string `json:"executionId"`
Name string `json:"name"`
TestName string `json:"testName"`
WebhookName string `json:"webhookName"`
EventType testkube.EventType `json:"eventType"`
ErrorMessage string `json:"errorMessage"`
Expand Down
10 changes: 5 additions & 5 deletions pkg/cloud/data/webhook/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ func NewCloudRepository(cloudClient cloud.TestKubeCloudAPIClient, apiKey string)
}

func (c *CloudRepository) CollectExecutionResult(ctx context.Context, event testkube.Event, webhookName, errorMessage string, statusCode int) error {
var executionID, name string
var executionID, testName string
if event.TestExecution != nil {
executionID = event.TestExecution.Id
name = event.TestExecution.TestName
testName = event.TestExecution.TestName
}

if event.TestSuiteExecution != nil {
executionID = event.TestSuiteExecution.Id
if event.TestSuiteExecution.TestSuite != nil {
name = event.TestSuiteExecution.TestSuite.Name
testName = event.TestSuiteExecution.TestSuite.Name
}
}

if event.TestWorkflowExecution != nil {
executionID = event.TestWorkflowExecution.Id
if event.TestWorkflowExecution.Workflow != nil {
name = event.TestWorkflowExecution.Workflow.Name
testName = event.TestWorkflowExecution.Workflow.Name
}
}

Expand All @@ -49,7 +49,7 @@ func (c *CloudRepository) CollectExecutionResult(ctx context.Context, event test

req := WebhookExecutionCollectResultRequest{
ExecutionID: executionID,
Name: name,
TestName: testName,
WebhookName: webhookName,
EventType: eventType,
ErrorMessage: errorMessage,
Expand Down

0 comments on commit 5ecab91

Please sign in to comment.