Skip to content

Commit

Permalink
apply feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Turrado <[email protected]>
  • Loading branch information
Jorge Turrado committed Jul 19, 2022
1 parent cf00024 commit 7a12cdb
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions tests/internals/idle_replicas/idle_replicas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func TestScaler(t *testing.T) {

// scaling to idle replica count
assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 0, 60, 1),
"replica count should be 0 after a minute")
"replica count should be 0 after 1 minute")

// test scaling
// till min replica count
Expand Down Expand Up @@ -187,7 +187,7 @@ func testScaleUp(t *testing.T, kc *kubernetes.Clientset, messageURL azqueue.Mess
}

assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 2, 60, 1),
"replica count should be 2 after a minute")
"replica count should be 2 after 1 minute")
}

func testScaleDown(t *testing.T, kc *kubernetes.Clientset, messageURL azqueue.MessagesURL) {
Expand All @@ -196,7 +196,7 @@ func testScaleDown(t *testing.T, kc *kubernetes.Clientset, messageURL azqueue.Me
assert.NoErrorf(t, err, "cannot clear queue - %s", err)

assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 0, 60, 1),
"replica count should be 0 after a minute")
"replica count should be 0 after 1 minute")
}

func cleanupQueue(t *testing.T, queueURL azqueue.QueueURL) {
Expand Down
6 changes: 3 additions & 3 deletions tests/internals/pause_scaling/pause_scaling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func TestScaler(t *testing.T) {

// scaling to paused replica count
assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 0, 60, 1),
"replica count should be 0 after a minute")
"replica count should be 0 after 1 minute")

// test scaling
testPauseAt0(t, kc, messageURL)
Expand Down Expand Up @@ -218,7 +218,7 @@ func testScaleUp(t *testing.T, kc *kubernetes.Clientset, data templateData) {
KubectlApplyWithTemplate(t, data, "scaledObjectTemplate", scaledObjectTemplate)

assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 2, 60, 1),
"replica count should be 2 after a minute")
"replica count should be 2 after 1 minute")
}

func testPauseAtN(t *testing.T, kc *kubernetes.Clientset, messageURL azqueue.MessagesURL, data templateData, n int) {
Expand All @@ -238,7 +238,7 @@ func testScaleDown(t *testing.T, kc *kubernetes.Clientset, data templateData) {
KubectlApplyWithTemplate(t, data, "scaledObjectTemplate", scaledObjectTemplate)

assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 2, 60, 1),
"replica count should be 2 after a minute")
"replica count should be 2 after 1 minute")
}

func cleanupQueue(t *testing.T, queueURL azqueue.QueueURL) {
Expand Down
6 changes: 3 additions & 3 deletions tests/internals/restore_original/restore_original_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func TestScaler(t *testing.T) {
CreateKubernetesResources(t, kc, testNamespace, data, templates)

assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 2, 60, 1),
"replica count should be 2 after a minute")
"replica count should be 2 after 1 minute")

// test scaling
testScale(t, kc, data)
Expand Down Expand Up @@ -177,15 +177,15 @@ func testScale(t *testing.T, kc *kubernetes.Clientset, data templateData) {
KubectlApplyWithTemplate(t, data, "scaledObjectTemplate", scaledObjectTemplate)

assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 0, 60, 1),
"replica count should be 0 after a minute")
"replica count should be 0 after 1 minute")
}

func testRestore(t *testing.T, kc *kubernetes.Clientset, data templateData) {
t.Log("--- testing restore ---")
KubectlDeleteWithTemplate(t, data, "scaledObjectTemplate", scaledObjectTemplate)

assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 2, 60, 1),
"replica count should be 2 after a minute")
"replica count should be 2 after 1 minute")
}

func cleanupQueue(t *testing.T, queueURL azqueue.QueueURL) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func TestScaler(t *testing.T) {
CreateKubernetesResources(t, kc, testNamespace, data, templates)

assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 0, 60, 1),
"replica count should be 0 after a minute")
"replica count should be 0 after 1 minute")

// test scaling
testActivation(t, kc, client)
Expand Down
4 changes: 2 additions & 2 deletions tests/scalers_go/azure_pipelines/azure_pipelines_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,11 @@ func testScaleUp(t *testing.T, kc *kubernetes.Clientset, connection *azuredevops
t.Log("--- testing scale up ---")
queueBuild(t, connection)
assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, maxReplicaCount, 60, 1),
"replica count should be 2 after a minute")
"replica count should be 2 after 1 minute")
}

func testScaleDown(t *testing.T, kc *kubernetes.Clientset) {
t.Log("--- testing scale down ---")
assert.True(t, WaitForPodCountInNamespace(t, kc, testNamespace, minReplicaCount, 60, 5),
"pod count should be 0 after a minute")
"pod count should be 0 after 1 minute")
}
6 changes: 3 additions & 3 deletions tests/secret-providers/azure_keyvault/azure_keyvault_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func TestScaler(t *testing.T) {
CreateKubernetesResources(t, kc, testNamespace, data, templates)

assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 0, 60, 1),
"replica count should be 0 after a minute")
"replica count should be 0 after 1 minute")

// test scaling
testScaleUp(t, kc, messageURL)
Expand Down Expand Up @@ -229,7 +229,7 @@ func testScaleUp(t *testing.T, kc *kubernetes.Clientset, messageURL azqueue.Mess
}

assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 1, 60, 1),
"replica count should be 0 after a minute")
"replica count should be 0 after 1 minute")
}

func testScaleDown(t *testing.T, kc *kubernetes.Clientset, messageURL azqueue.MessagesURL) {
Expand All @@ -238,7 +238,7 @@ func testScaleDown(t *testing.T, kc *kubernetes.Clientset, messageURL azqueue.Me
assert.NoErrorf(t, err, "cannot clear queue - %s", err)

assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 0, 60, 1),
"replica count should be 0 after a minute")
"replica count should be 0 after 1 minute")
}

func cleanupQueue(t *testing.T, queueURL azqueue.QueueURL) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func TestScaler(t *testing.T) {
CreateKubernetesResources(t, kc, testNamespace, data, templates)

assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 0, 60, 1),
"replica count should be 0 after a minute")
"replica count should be 0 after 1 minute")

// test scaling
testScaleUp(t, kc, sbQueue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func TestScaler(t *testing.T) {
CreateKubernetesResources(t, kc, testNamespace, data, templates)

assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 0, 60, 1),
"replica count should be 0 after a minute")
"replica count should be 0 after 1 minute")

// test scaling
testScaleUpWithIncorrectIdentity(t, kc, sbQueue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func TestScaler(t *testing.T) {
CreateKubernetesResources(t, kc, testNamespace, data, templates)

assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 0, 60, 1),
"replica count should be 0 after a minute")
"replica count should be 0 after 1 minute")

// test scaling
testScaleUp(t, kc, messageURL)
Expand Down Expand Up @@ -202,7 +202,7 @@ func testScaleUp(t *testing.T, kc *kubernetes.Clientset, messageURL azqueue.Mess
}

assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 1, 60, 1),
"replica count should be 1 after a minute")
"replica count should be 1 after 1 minute")
}

func testScaleDown(t *testing.T, kc *kubernetes.Clientset, messageURL azqueue.MessagesURL) {
Expand All @@ -211,7 +211,7 @@ func testScaleDown(t *testing.T, kc *kubernetes.Clientset, messageURL azqueue.Me
assert.NoErrorf(t, err, "cannot clear queue - %s", err)

assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 0, 60, 1),
"replica count should be 0 after a minute")
"replica count should be 0 after 1 minute")
}

func cleanupQueue(t *testing.T, queueURL azqueue.QueueURL) {
Expand Down

0 comments on commit 7a12cdb

Please sign in to comment.