Skip to content

Commit

Permalink
Gather traces for TestChannelDeadLetterSinkExtensions (#418)
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 14, 2023
1 parent 3ab6c83 commit 4741ee7
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 @@ -311,6 +312,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 @@ -355,15 +355,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", "http://fake.svc.cluster.local")).
Expand Down Expand Up @@ -400,15 +399,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 @@ -451,15 +449,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 4741ee7

Please sign in to comment.