Skip to content

Commit

Permalink
Merge pull request #4505 from enxebre/rename-unit-calculatestatus
Browse files Browse the repository at this point in the history
🌱 Rename unit test to TestCalculateStatus
  • Loading branch information
k8s-ci-robot authored Apr 21, 2021
2 parents 102c753 + dcfd306 commit 46dc43a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion controllers/machinedeployment_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions controllers/machinedeployment_sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 46dc43a

Please sign in to comment.