Skip to content

Commit

Permalink
Invalid Sink URI CloudEvent test sometimes includes quotes
Browse files Browse the repository at this point in the history
In the logs for the latest pipeline nightly we saw a failed unit test
for CloudEvents with the following message:

```
TestSendCloudEvent/send_a_cloud_event_with_invalid_sink_URI:
cloudevent_test.go:106: I expected an error like invalid_URI:
unsupported protocol scheme, but I got Post "invalid_URI": unsupported
protocol scheme ""
```

It appears that sometimes the "invalid_URI" part of the error message
will include quotes, and sometimes (like when running locally) it won't.

This PR updates the regex to allow for these quotes in the error message.
  • Loading branch information
Scott committed Mar 18, 2020
1 parent f66970e commit 0de7e21
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestSendCloudEvent(t *testing.T) {
eventSourceURI: defaultEventSourceURI,
cloudEventClient: defaultCloudEventClient,
wantErr: true,
errRegexp: fmt.Sprintf("%s: unsupported protocol scheme", invalidSinkURI),
errRegexp: fmt.Sprintf("\"?%s\"?: unsupported protocol scheme", invalidSinkURI),
}, {
desc: "send a cloud event, fail to send",
sinkURI: defaultSinkURI,
Expand Down

0 comments on commit 0de7e21

Please # to comment.