Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DDO-3289] Improve error text in deploy hook test routes #351

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func githubActionsDeployHooksV3TestRun(ctx *gin.Context) {
*hook.GithubActionsWorkflowPath,
*hook.GithubActionsDefaultRef,
workflowInputs); err != nil {
errors.AbortRequest(ctx, err)
errors.AbortRequest(ctx, fmt.Errorf("error between Sherlock and GitHub: %w", err))
return
}
ctx.JSON(http.StatusOK, GithubActionsDeployHookTestRunResponse{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (s *handlerSuite) TestGithubActionsDeployHooksV3TestRun() {
GithubActionsDeployHookTestRunRequest{Execute: utils.PointerTo(true)}),
&got)
s.Equal(http.StatusBadRequest, code)
s.Equal(errors.BadRequest, got.Message)
s.Equal(fmt.Sprintf("error between Sherlock and GitHub: %s", errors.BadRequest), got.Message)
})
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func slackDeployHooksV3TestRun(ctx *gin.Context) {
}
if err = slack.SendMessageReturnError(ctx, *hook.SlackChannel,
fmt.Sprintf("This is a deploy hook test message from Beehive, triggered by %s", user.SlackReference())); err != nil {
errors.AbortRequest(ctx, err)
errors.AbortRequest(ctx, fmt.Errorf("error between Sherlock and Slack: %w", err))
return
}
ctx.JSON(http.StatusOK, SlackDeployHookTestRunResponse{OK: true})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (s *handlerSuite) TestSlackDeployHooksV3TestRun() {
SlackDeployHookTestRunRequest{Execute: utils.PointerTo(true)}),
&got)
s.Equal(http.StatusBadRequest, code)
s.Equal(errors.BadRequest, got.Message)
s.Equal(fmt.Sprintf("error between Sherlock and Slack: %s", errors.BadRequest), got.Message)
})
})
}
Loading