Skip to content

Commit

Permalink
Fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
creydr committed Oct 11, 2023
1 parent 2913d0c commit c306fac
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions test/rekt/features/broker/data_plane.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func brokerAcceptsBinaryContentMode(ctx context.Context, t feature.T) {
)(ctx, t)

store := eventshub.StoreFromContext(ctx, source)
events := knconf.Correlate(store.AssertAtLeast(t, 2, knconf.SentEventMatcher("")))
events := knconf.Correlate(store.AssertAtLeast(ctx, t, 2, knconf.SentEventMatcher("")))
for _, e := range events {
if e.Response.StatusCode < 200 || e.Response.StatusCode > 299 {
t.Errorf("Expected statuscode 2XX for sequence %d got %d", e.Response.Sequence, e.Response.StatusCode)
Expand Down Expand Up @@ -245,7 +245,7 @@ func brokerAcceptsStructuredContentMode(ctx context.Context, t feature.T) {
)(ctx, t)

store := eventshub.StoreFromContext(ctx, source)
events := knconf.Correlate(store.AssertAtLeast(t, 2, knconf.SentEventMatcher("")))
events := knconf.Correlate(store.AssertAtLeast(ctx, t, 2, knconf.SentEventMatcher("")))
for _, e := range events {
if e.Response.StatusCode < 200 || e.Response.StatusCode > 299 {
t.Errorf("Expected statuscode 2XX for sequence %d got %d", e.Response.Sequence, e.Response.StatusCode)
Expand Down Expand Up @@ -278,7 +278,7 @@ func brokerRejectsUnknownCEVersion(ctx context.Context, t feature.T) {
// response was what was expected.
// Note: We pass in "" for the match ID because when we construct the headers manually
// above, they do not get stuff into the sent/response SentId fields.
events := knconf.Correlate(store.AssertAtLeast(t, 2, knconf.SentEventMatcher("")))
events := knconf.Correlate(store.AssertAtLeast(ctx, t, 2, knconf.SentEventMatcher("")))
for _, e := range events {
// Make sure HTTP response code is 4XX
if e.Response.StatusCode < 400 || e.Response.StatusCode > 499 {
Expand Down Expand Up @@ -307,7 +307,7 @@ func brokerAcceptResponseSuccess(ctx context.Context, t feature.T) {
)(ctx, t)

store := eventshub.StoreFromContext(ctx, source)
events := knconf.Correlate(store.AssertAtLeast(t, 2, knconf.SentEventMatcher("")))
events := knconf.Correlate(store.AssertAtLeast(ctx, t, 2, knconf.SentEventMatcher("")))
for _, e := range events {
// Make sure HTTP response code is 200
if e.Response.StatusCode < 200 || e.Response.StatusCode > 299 {
Expand Down Expand Up @@ -343,7 +343,7 @@ func brokerRejectsGetRequest(ctx context.Context, t feature.T) {
// response was what was expected.
// Note: We pass in "" for the match ID because when we construct the headers manually
// above, they do not get stuff into the sent/response SentId fields.
events := knconf.Correlate(store.AssertAtLeast(t, 2, knconf.SentEventMatcher("")))
events := knconf.Correlate(store.AssertAtLeast(ctx, t, 2, knconf.SentEventMatcher("")))
for _, e := range events {
// Make sure HTTP response code is 405
if e.Response.StatusCode != 405 {
Expand Down Expand Up @@ -390,7 +390,7 @@ func brokerRejectsMalformedCE(ctx context.Context, t feature.T) {
// response was what was expected.
// Note: We pass in "" for the match ID because when we construct the headers manually
// above, they do not get stuff into the sent/response SentId fields.
events := knconf.Correlate(store.AssertAtLeast(t, 2, knconf.SentEventMatcher("")))
events := knconf.Correlate(store.AssertAtLeast(ctx, t, 2, knconf.SentEventMatcher("")))
for _, e := range events {
// Make sure HTTP response code is 4XX
if e.Response.StatusCode < 400 || e.Response.StatusCode > 499 {
Expand Down
1 change: 1 addition & 0 deletions test/rekt/features/broker/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,7 @@ func assertEnhancedWithKnativeErrorExtensions(sinkName string, matcherfns ...fun
matchers[i] = fn(ctx)
}
_ = eventshub.StoreFromContext(ctx, sinkName).AssertExact(
ctx,
t,
1,
eventasssert.MatchKind(eventshub.EventReceived),
Expand Down
2 changes: 1 addition & 1 deletion test/rekt/features/channel/data_plane.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func channelRejectsMalformedCE(ctx context.Context, t feature.T) {
// response was what was expected.
// Note: We pass in "" for the match ID because when we construct the headers manually
// above, they do not get stuff into the sent/response SentId fields.
events := knconf.Correlate(store.AssertAtLeast(t, 2, knconf.SentEventMatcher("")))
events := knconf.Correlate(store.AssertAtLeast(ctx, t, 2, knconf.SentEventMatcher("")))
for _, e := range events {
// Make sure HTTP response code is 4XX
if e.Response.StatusCode < 400 || e.Response.StatusCode > 499 {
Expand Down
1 change: 1 addition & 0 deletions test/rekt/features/channel/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ func assertEnhancedWithKnativeErrorExtensions(sinkName string, matcherfns ...fun
matchers[i] = fn(ctx)
}
_ = eventshub.StoreFromContext(ctx, sinkName).AssertExact(
ctx,
t,
1,
assert.MatchKind(eventshub.EventReceived),
Expand Down
2 changes: 1 addition & 1 deletion test/rekt/features/knconf/data_plane.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func AcceptsCEVersions(ctx context.Context, t feature.T, gvr schema.GroupVersion
// We are looking for two events, one of them is the sent event and the other
// is Response, so correlate them first. We want to make sure the event was sent and that the
// response was what was expected.
events := Correlate(store.AssertAtLeast(t, 2, SentEventMatcher(id)))
events := Correlate(store.AssertAtLeast(ctx, t, 2, SentEventMatcher(id)))
for _, e := range events {
// Make sure HTTP response code is 2XX
if e.Response.StatusCode < 200 || e.Response.StatusCode > 299 {
Expand Down

0 comments on commit c306fac

Please sign in to comment.