Skip to content

Commit

Permalink
remove test
Browse files Browse the repository at this point in the history
  • Loading branch information
linkas45 committed Dec 19, 2024
1 parent 30f061d commit 96f356e
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions internal/services/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"reflect"
"strings"
"sync"
"sync/atomic"
Expand All @@ -19,7 +18,6 @@ import (
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"
"go.uber.org/goleak"
appsv1 "k8s.io/api/apps/v1"
authorizationv1 "k8s.io/api/authorization/v1"
autoscalingv1 "k8s.io/api/autoscaling/v1"
v1 "k8s.io/api/core/v1"
Expand All @@ -34,7 +32,6 @@ import (
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/wait"
dynamic_fake "k8s.io/client-go/dynamic/fake"
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes/fake"
authfakev1 "k8s.io/client-go/kubernetes/typed/authorization/v1/fake"
k8stesting "k8s.io/client-go/testing"
Expand Down Expand Up @@ -1179,44 +1176,6 @@ func loadInitialHappyPathData(t *testing.T, scheme *runtime.Scheme) ([]sampleObj
return objects, clientset, dynamicClient, metricsClient
}

func TestDefaultInformers_MatchFilters(t *testing.T) {
tests := map[string]struct {
obj runtime.Object
eventType castai.EventType
expectedMatch bool
}{
"dont discard if replicaset has zero replicas": {
obj: &appsv1.ReplicaSet{
ObjectMeta: metav1.ObjectMeta{
Namespace: "test",
},
Spec: appsv1.ReplicaSetSpec{
Replicas: lo.ToPtr(int32(0)),
},
Status: appsv1.ReplicaSetStatus{
Replicas: 0,
},
},
eventType: castai.EventAdd,
expectedMatch: true,
},
}

for name, data := range tests {
t.Run(name, func(t *testing.T) {
r := require.New(t)
f := informers.NewSharedInformerFactory(fake.NewSimpleClientset(data.obj), 0)

defaultInformers := getDefaultInformers(f)
objInformer := defaultInformers[reflect.TypeOf(data.obj)]

match := objInformer.filters.Apply(data.eventType, data.obj)

r.Equal(data.expectedMatch, match)
})
}
}

func TestCollectSingleSnapshot(t *testing.T) {
r := require.New(t)

Expand Down

0 comments on commit 96f356e

Please sign in to comment.