From 599eb74a791f72a37d2f1a6c756ab99ffc09cc1d Mon Sep 17 00:00:00 2001 From: Mulham Raee Date: Thu, 13 Jun 2024 09:37:51 +0200 Subject: [PATCH] updated TestNodePoolToRosaMachinePoolSpec unit test --- exp/controllers/rosamachinepool_controller_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exp/controllers/rosamachinepool_controller_test.go b/exp/controllers/rosamachinepool_controller_test.go index 4ab87cbcf7..a17dd0c922 100644 --- a/exp/controllers/rosamachinepool_controller_test.go +++ b/exp/controllers/rosamachinepool_controller_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp/cmpopts" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" @@ -28,7 +29,8 @@ func TestNodePoolToRosaMachinePoolSpec(t *testing.T) { }, UpdateConfig: &expinfrav1.RosaUpdateConfig{ RollingUpdate: &expinfrav1.RollingUpdate{ - MaxSurge: &intstr.IntOrString{IntVal: 3}, + MaxSurge: ptr.To(intstr.FromInt32(3)), + MaxUnavailable: ptr.To(intstr.FromInt32(5)), }, }, } @@ -44,5 +46,5 @@ func TestNodePoolToRosaMachinePoolSpec(t *testing.T) { expectedSpec := nodePoolToRosaMachinePoolSpec(nodePoolSpec) - g.Expect(expectedSpec).To(Equal(rosaMachinePoolSpec)) + g.Expect(rosaMachinePoolSpec).To(BeComparableTo(expectedSpec, cmpopts.EquateEmpty())) }