From df34edd21a830ba1c7e30a1104c61c5df65c8e63 Mon Sep 17 00:00:00 2001 From: Jorge Turrado Date: Mon, 25 Sep 2023 17:15:48 +0200 Subject: [PATCH] add activation test Signed-off-by: Jorge Turrado --- .../internals/scaling_modifiers/scaling_modifiers_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/internals/scaling_modifiers/scaling_modifiers_test.go b/tests/internals/scaling_modifiers/scaling_modifiers_test.go index ab02f01ea73..036e6e63894 100644 --- a/tests/internals/scaling_modifiers/scaling_modifiers_test.go +++ b/tests/internals/scaling_modifiers/scaling_modifiers_test.go @@ -143,6 +143,7 @@ spec: scalingModifiers: formula: metrics_api + kw_trig target: '2' + activationTarget: '2' pollingInterval: 5 cooldownPeriod: 5 minReplicaCount: 0 @@ -238,6 +239,12 @@ func TestScalingModifiers(t *testing.T) { func testFormula(t *testing.T, kc *kubernetes.Clientset, data templateData) { t.Log("--- testFormula ---") + + // formula simply adds 2 metrics together (0+2=2; activationTarget = 2 -> replicas should be 0) + data.MetricValue = 0 + KubectlApplyWithTemplate(t, data, "updateMetricsTemplate", updateMetricsTemplate) + AssertReplicaCountNotChangeDuringTimePeriod(t, kc, deploymentName, namespace, 0, 60) + // formula simply adds 2 metrics together (3+2=5; target = 2 -> 5/2 replicas should be 3) data.MetricValue = 3 KubectlApplyWithTemplate(t, data, "updateMetricsTemplate", updateMetricsTemplate)