Skip to content

Commit

Permalink
Bug Fix e2e tests
Browse files Browse the repository at this point in the history
This Commit,
- Fixes build failure due to e2e tests
  • Loading branch information
codenio committed Oct 1, 2020
1 parent bc983c3 commit c6b2e09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/notify/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func NewWebhook(c config.CommunicationsConfig) Notifier {

// SendEvent sends event notification to Webhook url
func (w *Webhook) SendEvent(event events.Event) (err error) {
// log.Debugf("Event Received : %#v", event)
jsonPayload := &WebhookPayload{
EventMeta: EventMeta{
Kind: event.Kind,
Expand Down Expand Up @@ -127,7 +128,7 @@ func (w *Webhook) PostWebhook(jsonPayload *WebhookPayload) error {
return err
}
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("Error Posting Webhook: %s", string(resp.StatusCode))
return fmt.Errorf("Error Posting Webhook: %s", fmt.Sprint(resp.StatusCode))
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/notify/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestPostWebhook(t *testing.T) {
httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusServiceUnavailable)
})),
fmt.Errorf("Error Posting Webhook: %s", string(http.StatusServiceUnavailable)),
fmt.Errorf("Error Posting Webhook: %s", fmt.Sprint(http.StatusServiceUnavailable)),
},
`Status Ok`: {
httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit c6b2e09

Please sign in to comment.