Skip to content

Commit

Permalink
Reuse predefined value to increase consistency
Browse files Browse the repository at this point in the history
Signed-off-by: Yoon Park <[email protected]>
  • Loading branch information
yoongon committed Jun 30, 2023
1 parent f99b0ea commit d9c88aa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/scaling/executor/scale_scaledobjects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package executor

import (
"context"
"strconv"
"testing"

"github.com/golang/mock/gomock"
Expand Down Expand Up @@ -409,12 +410,15 @@ func TestScaleToPausedReplicasCount(t *testing.T) {

scaleExecutor := NewScaleExecutor(client, mockScaleClient, nil, recorder)

pausedReplicaCount := int32(0)
replicaCount := int32(2)

scaledObject := v1alpha1.ScaledObject{
ObjectMeta: v1.ObjectMeta{
Name: "name",
Namespace: "namespace",
Annotations: map[string]string{
"autoscaling.keda.sh/paused-replicas": "0",
"autoscaling.keda.sh/paused-replicas": strconv.Itoa(int(pausedReplicaCount)),
},
},
Spec: v1alpha1.ScaledObjectSpec{
Expand All @@ -432,9 +436,6 @@ func TestScaleToPausedReplicasCount(t *testing.T) {

scaledObject.Status.Conditions = *v1alpha1.GetInitializedConditions()

pausedReplicaCount := int32(0)
replicaCount := int32(2)

client.EXPECT().Get(gomock.Any(), gomock.Any(), gomock.Any()).SetArg(2, appsv1.Deployment{
Spec: appsv1.DeploymentSpec{
Replicas: &replicaCount,
Expand Down

0 comments on commit d9c88aa

Please sign in to comment.