Skip to content

Commit

Permalink
Gather traces for TestChannelDeadLetterSinkExtensions (#7441)
Browse files Browse the repository at this point in the history
Also make sure that a dead letter sink is resolved for channel before
the source actually sends the event (moving this check from Requirement
phase to Setup).
  • Loading branch information
mgencur authored Nov 20, 2023
1 parent 2d1bfb5 commit d84daee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions test/rekt/channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"knative.dev/reconciler-test/pkg/k8s"
"knative.dev/reconciler-test/pkg/knative"
"knative.dev/reconciler-test/pkg/manifest"
"knative.dev/reconciler-test/pkg/tracing"

"knative.dev/eventing/test/rekt/features/channel"
ch "knative.dev/eventing/test/rekt/resources/channel"
Expand Down Expand Up @@ -312,6 +313,7 @@ func TestChannelDeadLetterSinkExtensions(t *testing.T) {
knative.WithLoggingConfig,
knative.WithTracingConfig,
k8s.WithEventListener,
tracing.WithGatherer(t),
environment.Managed(t),
)

Expand Down
9 changes: 3 additions & 6 deletions test/rekt/features/channel/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,14 @@ func channelSubscriberUnreachable(createSubscriberFn func(ref *duckv1.KReference
f.Setup("channel is ready", channel_impl.IsReady(channelName))
f.Setup("channel is addressable", channel_impl.IsAddressable(channelName))
f.Setup("subscription is ready", subscription.IsReady(sub))
f.Setup("channel has dead letter sink uri", channel_impl.HasDeadLetterSinkURI(channelName, channel_impl.GVR()))

f.Requirement("install source", eventshub.Install(
sourceName,
eventshub.StartSenderToResource(channel_impl.GVR(), channelName),
eventshub.InputEvent(ev),
))

f.Requirement("Channel has dead letter sink uri", channel_impl.HasDeadLetterSinkURI(channelName, channel_impl.GVR()))

f.Assert("Receives dls extensions when subscriber is unreachable", eventasssert.OnStore(sink).
MatchEvent(
test.HasExtension("knativeerrordest", subscriberUri)).
Expand Down Expand Up @@ -403,15 +402,14 @@ func channelSubscriberReturnedErrorNoData(createSubscriberFn func(ref *duckv1.KR
f.Setup("channel is ready", channel_impl.IsReady(channelName))
f.Setup("channel is addressable", channel_impl.IsAddressable(channelName))
f.Setup("subscription is ready", subscription.IsReady(sub))
f.Setup("channel has dead letter sink uri", channel_impl.HasDeadLetterSinkURI(channelName, channel_impl.GVR()))

f.Requirement("install source", eventshub.Install(
sourceName,
eventshub.StartSenderToResource(channel_impl.GVR(), channelName),
eventshub.InputEvent(ev),
))

f.Requirement("Channel has dead letter sink uri", channel_impl.HasDeadLetterSinkURI(channelName, channel_impl.GVR()))

f.Assert("Receives dls extensions without errordata", assertEnhancedWithKnativeErrorExtensions(
sink,
func(ctx context.Context) test.EventMatcher {
Expand Down Expand Up @@ -454,15 +452,14 @@ func channelSubscriberReturnedErrorWithData(createSubscriberFn func(ref *duckv1.
f.Setup("channel is ready", channel_impl.IsReady(channelName))
f.Setup("channel is addressable", channel_impl.IsAddressable(channelName))
f.Setup("subscription is ready", subscription.IsReady(sub))
f.Setup("channel has dead letter sink uri", channel_impl.HasDeadLetterSinkURI(channelName, channel_impl.GVR()))

f.Requirement("install source", eventshub.Install(
sourceName,
eventshub.StartSenderToResource(channel_impl.GVR(), channelName),
eventshub.InputEvent(ev),
))

f.Requirement("Channel has dead letter sink uri", channel_impl.HasDeadLetterSinkURI(channelName, channel_impl.GVR()))

f.Assert("Receives dls extensions with errordata Base64encoding", assertEnhancedWithKnativeErrorExtensions(
sink,
func(ctx context.Context) test.EventMatcher {
Expand Down

0 comments on commit d84daee

Please sign in to comment.