diff --git a/tests/scalers/aws/aws_managed_prometheus/aws_managed_prometheus_test.go b/tests/scalers/aws/aws_managed_prometheus/aws_managed_prometheus_test.go index 2c0d6d69694..60bfc396929 100644 --- a/tests/scalers/aws/aws_managed_prometheus/aws_managed_prometheus_test.go +++ b/tests/scalers/aws/aws_managed_prometheus/aws_managed_prometheus_test.go @@ -138,7 +138,8 @@ func TestScaler(t *testing.T) { t.Log("--- setting up ---") ampClient := createAMPClient() - workspaceOutput, _ := ampClient.CreateWorkspace(context.Background(), nil) + workspaceOutput, err := ampClient.CreateWorkspace(context.Background(), nil) + assert.NoError(t, err, "aws prometheus workspace creation has failed") workspaceID = *workspaceOutput.WorkspaceId kc := GetKubernetesClient(t) @@ -156,10 +157,8 @@ func TestScaler(t *testing.T) { WorkspaceId: &workspaceID, } input := &deleteWSInput - _, err := ampClient.DeleteWorkspace(context.Background(), input) - if err != nil { - t.Log("Unable to delete AMP workspace", err) - } + _, err = ampClient.DeleteWorkspace(context.Background(), input) + assert.NoError(t, err, "aws prometheus workspace deletion has failed") DeleteKubernetesResources(t, testNamespace, data, templates) } diff --git a/tests/scalers/aws/aws_managed_prometheus_pod_identity/aws_managed_prometheus_pod_identity_test.go b/tests/scalers/aws/aws_managed_prometheus_pod_identity/aws_managed_prometheus_pod_identity_test.go index bf819617602..b2b0cc30bd3 100644 --- a/tests/scalers/aws/aws_managed_prometheus_pod_identity/aws_managed_prometheus_pod_identity_test.go +++ b/tests/scalers/aws/aws_managed_prometheus_pod_identity/aws_managed_prometheus_pod_identity_test.go @@ -123,7 +123,8 @@ func TestScaler(t *testing.T) { t.Log("--- setting up ---") ampClient := createAMPClient() - workspaceOutput, _ := ampClient.CreateWorkspace(context.Background(), nil) + workspaceOutput, err := ampClient.CreateWorkspace(context.Background(), nil) + assert.NoError(t, err, "aws prometheus workspace creation has failed") workspaceID = *workspaceOutput.WorkspaceId kc := GetKubernetesClient(t) @@ -141,10 +142,8 @@ func TestScaler(t *testing.T) { WorkspaceId: &workspaceID, } input := &deleteWSInput - _, err := ampClient.DeleteWorkspace(context.Background(), input) - if err != nil { - t.Log("Unable to delete AMP workspace", err) - } + _, err = ampClient.DeleteWorkspace(context.Background(), input) + assert.NoError(t, err, "aws prometheus workspace deletion has failed") DeleteKubernetesResources(t, testNamespace, data, templates) }