Skip to content

Commit 13501a7

Browse files
committed
removed test files
1 parent 36eb2d6 commit 13501a7

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

npm/pkg/controlplane/controllers/v2/namespaceController_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ func newNameSpace(name, rv string, labels map[string]string) *corev1.Namespace {
120120
}
121121

122122
func addNamespace(t *testing.T, f *nameSpaceFixture, nsObj *corev1.Namespace) {
123+
t.Logf("Calling add namespace event")
123124
f.nsController.addNamespace(nsObj)
124125
if f.nsController.workqueue.Len() == 0 {
125126
t.Logf("Add Namespace: worker queue length is 0 ")
@@ -130,11 +131,15 @@ func addNamespace(t *testing.T, f *nameSpaceFixture, nsObj *corev1.Namespace) {
130131

131132
func updateNamespace(t *testing.T, f *nameSpaceFixture, oldNsObj, newNsObj *corev1.Namespace) {
132133
addNamespace(t, f, oldNsObj)
134+
t.Logf("Complete add namespace event")
135+
136+
t.Logf("Updating kubeinformer namespace object")
133137
err := f.kubeInformer.Core().V1().Namespaces().Informer().GetIndexer().Update(newNsObj)
134138
if err != nil {
135139
f.t.Errorf("Error updating namespace to informer: %v", err)
136140
}
137141

142+
t.Logf("Calling update namespace event")
138143
f.nsController.updateNamespace(oldNsObj, newNsObj)
139144
if f.nsController.workqueue.Len() == 0 {
140145
t.Logf("Update Namespace: worker queue length is 0 ")
@@ -145,10 +150,14 @@ func updateNamespace(t *testing.T, f *nameSpaceFixture, oldNsObj, newNsObj *core
145150

146151
func deleteNamespace(t *testing.T, f *nameSpaceFixture, nsObj *corev1.Namespace, isDeletedFinalStateUnknownObject IsDeletedFinalStateUnknownObject) {
147152
addNamespace(t, f, nsObj)
153+
t.Logf("Complete add namespace event")
154+
155+
t.Logf("Updating kubeinformer namespace object")
148156
err := f.kubeInformer.Core().V1().Namespaces().Informer().GetIndexer().Delete(nsObj)
149157
if err != nil {
150158
f.t.Errorf("Error deleting namespace to informer: %v", err)
151159
}
160+
t.Logf("Calling delete namespace event")
152161
if isDeletedFinalStateUnknownObject {
153162
tombstone := cache.DeletedFinalStateUnknown{
154163
Key: nsObj.Name,

npm/pkg/controlplane/controllers/v2/networkPolicyController_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ func addNetPol(f *netPolFixture, netPolObj *networkingv1.NetworkPolicy) {
179179

180180
func deleteNetPol(t *testing.T, f *netPolFixture, netPolObj *networkingv1.NetworkPolicy, isDeletedFinalStateUnknownObject IsDeletedFinalStateUnknownObject) {
181181
addNetPol(f, netPolObj)
182+
t.Logf("Complete adding network policy event")
182183

183184
// simulate network policy deletion event and delete network policy object from sharedInformer cache
184185
err := f.kubeInformer.Networking().V1().NetworkPolicies().Informer().GetIndexer().Delete(netPolObj)
@@ -205,6 +206,7 @@ func deleteNetPol(t *testing.T, f *netPolFixture, netPolObj *networkingv1.Networ
205206

206207
func updateNetPol(t *testing.T, f *netPolFixture, oldNetPolObj, netNetPolObj *networkingv1.NetworkPolicy) {
207208
addNetPol(f, oldNetPolObj)
209+
t.Logf("Complete adding network policy event")
208210

209211
// simulate network policy update event and update the network policy to shared informer's cache
210212
err := f.kubeInformer.Networking().V1().NetworkPolicies().Informer().GetIndexer().Update(netNetPolObj)

npm/pkg/controlplane/controllers/v2/podController_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ func addPod(t *testing.T, f *podFixture, podObj *corev1.Pod) {
143143

144144
func deletePod(t *testing.T, f *podFixture, podObj *corev1.Pod, isDeletedFinalStateUnknownObject IsDeletedFinalStateUnknownObject) {
145145
addPod(t, f, podObj)
146+
t.Logf("Complete add pod event")
146147

147148
// simulate pod delete event and delete pod object from sharedInformer cache
148149
err := f.kubeInformer.Core().V1().Pods().Informer().GetIndexer().Delete(podObj)
@@ -172,6 +173,7 @@ func deletePod(t *testing.T, f *podFixture, podObj *corev1.Pod, isDeletedFinalSt
172173
// Need to make more cases - interestings..
173174
func updatePod(t *testing.T, f *podFixture, oldPodObj, newPodObj *corev1.Pod) {
174175
addPod(t, f, oldPodObj)
176+
t.Logf("Complete add pod event")
175177

176178
// simulate pod update event and update the pod to shared informer's cache
177179
err := f.kubeInformer.Core().V1().Pods().Informer().GetIndexer().Update(newPodObj)

0 commit comments

Comments
 (0)