Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Turrado <[email protected]>
  • Loading branch information
JorTurFer committed Oct 30, 2024
1 parent a2d5439 commit 5c49097
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/scalers/external_scaler_sj/external_scaler_sj_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/joho/godotenv"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"k8s.io/client-go/kubernetes"

. "github.com/kedacore/keda/v2/tests/helper"
Expand Down Expand Up @@ -139,6 +140,9 @@ func TestScaler(t *testing.T) {

CreateKubernetesResources(t, kc, testNamespace, data, templates)

require.True(t, WaitForDeploymentReplicaReadyCount(t, kc, scalerName, testNamespace, 1, 60, 1),
"replica count should be 1 after 1 minute")

assert.True(t, WaitForJobCount(t, kc, testNamespace, 0, 60, 1),
"job count should be 0 after 1 minute")

Expand Down Expand Up @@ -184,7 +188,7 @@ func testScaleIn(t *testing.T, kc *kubernetes.Clientset, data templateData) {
data.MetricValue = 0
KubectlReplaceWithTemplate(t, data, "updateMetricTemplate", updateMetricTemplate)

assert.True(t, WaitForScaledJobCount(t, kc, scaledJobName, testNamespace, 0, 60, 1),
"job count should be 0 after 1 minute")
assert.True(t, WaitForScaledJobCount(t, kc, scaledJobName, testNamespace, 0, 120, 1),
"job count should be 0 after 2 minute")
KubectlDeleteWithTemplate(t, data, "updateMetricTemplate", updateMetricTemplate)
}

0 comments on commit 5c49097

Please sign in to comment.