Skip to content

Commit

Permalink
https://github.com/kedacore/keda/issues/2214
Browse files Browse the repository at this point in the history
  • Loading branch information
Siva Guruvareddiar committed Dec 29, 2023
1 parent 8575dbc commit 2abcf4a
Showing 1 changed file with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
var _ = godotenv.Load("../../../.env")

const (
testName = "aws-amp-test"
testName = "aws-prometheus-test"
)

type templateData struct {
Expand Down Expand Up @@ -142,30 +142,29 @@ func TestScaler(t *testing.T) {
workspaceOutput, _ := ampClient.CreateWorkspace(context.Background(), nil)
workspaceId = *workspaceOutput.WorkspaceId

t.Log("--- workspaceId ---", workspaceId)

kc := GetKubernetesClient(t)

data, templates := getTemplateData()
CreateKubernetesResources(t, kc, testNamespace, data, templates)

t.Log("--- assert ---")
expectedReplicaCountNumber := 0 // as mentioned above, as the AMP returns 100 and the threshold set to 50, the expected replica count is 100 / 50 = 2
assert.Truef(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, expectedReplicaCountNumber, 60, 1),
expectedReplicaCountNumber := 2 // as mentioned above, as the AMP returns 100 and the threshold set to 50, the expected replica count is 100 / 50 = 2
assert.Truef(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 0, 60, 1),
"replica count should be %d after a minute", expectedReplicaCountNumber)

t.Log("--- cleaning up ---")
// deleteWSInput := &amp.DeleteWorkspaceInput{
// WorkspaceId: &workspaceId,
// }
// ampClient.DeleteWorkspace(context.Background(), deleteWSInput, nil)
deleteWSInput := amp.DeleteWorkspaceInput{
WorkspaceId: &workspaceId,
}
input := &deleteWSInput
_, err := ampClient.DeleteWorkspace(context.Background(), input)
if err != nil {
t.Log("Unable to delete AMP workspace", err)
}
DeleteKubernetesResources(t, testNamespace, data, templates)

}

func getTemplateData() (templateData, []Template) {
fmt.Print("--- workspaceId ---", workspaceId)

return templateData{
TestNamespace: testNamespace,
SecretName: secretName,
Expand Down

0 comments on commit 2abcf4a

Please sign in to comment.