From 0de7e2179090e0e2852ed5f12635137f36b4ee58 Mon Sep 17 00:00:00 2001 From: Scott Date: Thu, 5 Mar 2020 13:59:29 -0500 Subject: [PATCH] Invalid Sink URI CloudEvent test sometimes includes quotes 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. --- pkg/reconciler/taskrun/resources/cloudevent/cloudevent_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/reconciler/taskrun/resources/cloudevent/cloudevent_test.go b/pkg/reconciler/taskrun/resources/cloudevent/cloudevent_test.go index 1498a075cf4..0663bac91dd 100644 --- a/pkg/reconciler/taskrun/resources/cloudevent/cloudevent_test.go +++ b/pkg/reconciler/taskrun/resources/cloudevent/cloudevent_test.go @@ -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,