Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: zirain <zirain2009@gmail.com>
  • Loading branch information
zirain committed Apr 26, 2024
1 parent 48379cb commit 720dec7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion internal/provider/kubernetes/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func TestHasManagedClass(t *testing.T) {

testCases := []struct {
name string
ep client.Object
ep *egv1a1.EnvoyProxy
classes []*gwapiv1.GatewayClass
expected bool
}{
Expand Down
8 changes: 4 additions & 4 deletions internal/provider/kubernetes/predicates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ import (
func TestGatewayClassHasMatchingController(t *testing.T) {
testCases := []struct {
name string
obj client.Object
gc *gwapiv1.GatewayClass
client client.Client
expect bool
}{
{
name: "matching controller name",
obj: test.GetGatewayClass("test-gc", v1alpha1.GatewayControllerName, nil),
gc: test.GetGatewayClass("test-gc", v1alpha1.GatewayControllerName, nil),
expect: true,
},
{
name: "non-matching controller name",
obj: test.GetGatewayClass("test-gc", "not.configured/controller", nil),
gc: test.GetGatewayClass("test-gc", "not.configured/controller", nil),
expect: false,
},
}
Expand All @@ -60,7 +60,7 @@ func TestGatewayClassHasMatchingController(t *testing.T) {
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
res := r.hasMatchingController(tc.obj)
res := r.hasMatchingController(tc.gc)
require.Equal(t, tc.expect, res)
})
}
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/kubernetes/sources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ func TestSources(t *testing.T) {
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
cond := make(chan struct{})
store := NewWatchAndReconcileSource(cond, tc.obj)
err := store.Start(tc.ctx, tc.handler, tc.queue)
store := NewWatchAndReconcileSource(cond, tc.obj, tc.handler)
err := store.Start(tc.ctx, tc.queue)
if !tc.expected {
require.Error(t, err)
} else {
Expand Down

0 comments on commit 720dec7

Please sign in to comment.