Skip to content

Commit 229e7bb

Browse files
committed
fixed go fmt
1 parent 19f4d6e commit 229e7bb

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

cmd/cluster/resize/infra_node_test.go

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ func TestNodesMatchExpectedCount(t *testing.T) {
261261
}
262262

263263
func TestGetInfraMachinePool(t *testing.T) {
264-
// Create a test namespace
265264
testNamespace := &corev1.Namespace{
266265
ObjectMeta: metav1.ObjectMeta{
267266
Name: "test-namespace",
@@ -271,14 +270,13 @@ func TestGetInfraMachinePool(t *testing.T) {
271270
},
272271
}
273272

274-
// Create a test machine pool with name exactly matching "infra"
275273
testMachinePool := &hivev1.MachinePool{
276274
ObjectMeta: metav1.ObjectMeta{
277-
Name: "test-cluster-infra", // Name in metadata
275+
Name: "test-cluster-infra",
278276
Namespace: "test-namespace",
279277
},
280278
Spec: hivev1.MachinePoolSpec{
281-
Name: "infra", // This is what the code checks for
279+
Name: "infra",
282280
Platform: hivev1.MachinePoolPlatform{
283281
AWS: &hivev1aws.MachinePoolPlatform{
284282
InstanceType: "r5.xlarge",
@@ -287,10 +285,7 @@ func TestGetInfraMachinePool(t *testing.T) {
287285
},
288286
}
289287

290-
// Create mock client
291288
mockHive := &MockClient{}
292-
293-
// Set up mock expectations for namespace list - first call
294289
firstCall := mockHive.On("List", mock.Anything, mock.MatchedBy(func(obj interface{}) bool {
295290
_, ok := obj.(*corev1.NamespaceList)
296291
return ok
@@ -300,7 +295,6 @@ func TestGetInfraMachinePool(t *testing.T) {
300295
nsList.Items = []corev1.Namespace{*testNamespace}
301296
})
302297

303-
// Set up mock expectations for machine pool list - second call
304298
secondCall := mockHive.On("List", mock.Anything, mock.MatchedBy(func(obj interface{}) bool {
305299
_, ok := obj.(*hivev1.MachinePoolList)
306300
return ok
@@ -310,22 +304,17 @@ func TestGetInfraMachinePool(t *testing.T) {
310304
mpList.Items = []hivev1.MachinePool{*testMachinePool}
311305
})
312306

313-
// Create Infra instance
314307
infra := &Infra{
315308
clusterId: "test-cluster",
316309
hive: mockHive,
317310
}
318311

319-
// Call the function
320312
mp, err := infra.getInfraMachinePool(context.Background())
321313

322-
// Verify results
323314
assert.NoError(t, err)
324315
assert.NotNil(t, mp)
325316
assert.Equal(t, "infra", mp.Spec.Name)
326317
assert.Equal(t, "r5.xlarge", mp.Spec.Platform.AWS.InstanceType)
327-
328-
// Verify mock was called correctly
329318
mockHive.AssertExpectations(t)
330319
}
331320

@@ -428,5 +417,3 @@ func TestGetInfraMachinePoolNoInfraPool(t *testing.T) {
428417
// Verify mock was called correctly
429418
mockHive.AssertExpectations(t)
430419
}
431-
432-

0 commit comments

Comments
 (0)