Skip to content

Commit

Permalink
Include context in channel tests for oidc feature disabled
Browse files Browse the repository at this point in the history
Signed-off-by: Dharmjit Singh <dharmjit.bti@gmail.com>
  • Loading branch information
dharmjit committed Jul 19, 2024
1 parent f7bc7ff commit 4212eec
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions pkg/reconciler/channel/channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ func TestReconcile(t *testing.T) {
WithChannelAddress(&backingChannelAddressable),
WithChannelEventPoliciesReadyBecauseOIDCDisabled()),
}},
Ctx: feature.ToContext(context.Background(), feature.Flags{
feature.OIDCAuthentication: feature.Disabled,
}),
}, {
Name: "Already reconciled",
Key: testKey,
Expand All @@ -191,6 +194,9 @@ func TestReconcile(t *testing.T) {
WithInMemoryChannelDLSUnknown(),
WithInMemoryChannelEventPoliciesReady()),
},
Ctx: feature.ToContext(context.Background(), feature.Flags{
feature.OIDCAuthentication: feature.Disabled,
}),
}, {
Name: "Backing channel created",
Key: testKey,
Expand All @@ -215,6 +221,9 @@ func TestReconcile(t *testing.T) {
WithBackingChannelUnknown("BackingChannelNotConfigured", "BackingChannel has not yet been reconciled."),
WithChannelEventPoliciesReadyBecauseOIDCDisabled()),
}},
Ctx: feature.ToContext(context.Background(), feature.Flags{
feature.OIDCAuthentication: feature.Disabled,
}),
}, {
Name: "Backing channel created with delivery",
Key: testKey,
Expand Down Expand Up @@ -266,6 +275,9 @@ func TestReconcile(t *testing.T) {
WithBackingChannelUnknown("BackingChannelNotConfigured", "BackingChannel has not yet been reconciled."),
WithChannelEventPoliciesReadyBecauseOIDCDisabled()),
}},
Ctx: feature.ToContext(context.Background(), feature.Flags{
feature.OIDCAuthentication: feature.Disabled,
}),
}, {
Name: "Generation Bump",
Key: testKey,
Expand Down Expand Up @@ -301,6 +313,9 @@ func TestReconcile(t *testing.T) {
WithChannelObservedGeneration(42),
WithChannelEventPoliciesReadyBecauseOIDCDisabled()),
}},
Ctx: feature.ToContext(context.Background(), feature.Flags{
feature.OIDCAuthentication: feature.Disabled,
}),
}, {
Name: "Updating subscribers statuses",
Key: testKey,
Expand Down Expand Up @@ -336,6 +351,9 @@ func TestReconcile(t *testing.T) {
WithChannelDLSUnknown(),
WithChannelEventPoliciesReadyBecauseOIDCDisabled()),
}},
Ctx: feature.ToContext(context.Background(), feature.Flags{
feature.OIDCAuthentication: feature.Disabled,
}),
}, {
Name: "Should provision applying EventPolicies",
Key: testKey,
Expand Down Expand Up @@ -577,9 +595,6 @@ func TestReconcile(t *testing.T) {
table.Test(t, MakeFactory(func(ctx context.Context, listers *Listers, cmw configmap.Watcher) controller.Reconciler {
ctx = channelable.WithDuck(ctx)
ctx = v1addr.WithDuck(ctx)
ctx = feature.ToContext(ctx, feature.Flags{
feature.OIDCAuthentication: feature.Enabled,
})
r := &Reconciler{
dynamicClientSet: fakedynamicclient.Get(ctx),
channelLister: listers.GetMessagingChannelLister(),
Expand Down

0 comments on commit 4212eec

Please sign in to comment.