From dcfd306016534f363ea1d03a6178eaaa88b7214a Mon Sep 17 00:00:00 2001 From: Enxebre Date: Wed, 21 Apr 2021 14:59:21 +0200 Subject: [PATCH] Rename unit test to TestCalculateStatus --- controllers/machinedeployment_sync.go | 2 +- controllers/machinedeployment_sync_test.go | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/controllers/machinedeployment_sync.go b/controllers/machinedeployment_sync.go index ee36fc6ba19f..06537031aab2 100644 --- a/controllers/machinedeployment_sync.go +++ b/controllers/machinedeployment_sync.go @@ -356,7 +356,7 @@ func (r *MachineDeploymentReconciler) syncDeploymentStatus(allMSs []*clusterv1.M return nil } -// calculateStatus calculates the latest status for the provided deployment by looking into the provided machine sets. +// calculateStatus calculates the latest status for the provided deployment by looking into the provided MachineSets. func calculateStatus(allMSs []*clusterv1.MachineSet, newMS *clusterv1.MachineSet, deployment *clusterv1.MachineDeployment) clusterv1.MachineDeploymentStatus { availableReplicas := mdutil.GetAvailableReplicaCountForMachineSets(allMSs) totalReplicas := mdutil.GetReplicaCountForMachineSets(allMSs) diff --git a/controllers/machinedeployment_sync_test.go b/controllers/machinedeployment_sync_test.go index 8c9c4af59cb9..b42369e164ec 100644 --- a/controllers/machinedeployment_sync_test.go +++ b/controllers/machinedeployment_sync_test.go @@ -20,14 +20,13 @@ import ( "testing" . "github.com/onsi/gomega" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" capierrors "sigs.k8s.io/cluster-api/errors" ) -func TestMachineDeploymentSyncStatus(t *testing.T) { +func TestCalculateStatus(t *testing.T) { msStatusError := capierrors.MachineSetStatusError("some failure") var tests = map[string]struct { @@ -165,7 +164,7 @@ func TestMachineDeploymentSyncStatus(t *testing.T) { Phase: "ScalingDown", }, }, - "machine set failed": { + "MachineSet failed": { machineSets: []*clusterv1.MachineSet{{ Spec: clusterv1.MachineSetSpec{ Replicas: pointer.Int32Ptr(2),