From cc7153e4ceff54b53da95c687c2c9a58ac394af8 Mon Sep 17 00:00:00 2001 From: wangrushen Date: Sun, 27 Oct 2024 22:26:27 +0800 Subject: [PATCH] fix: static check for redis strings e2e test Signed-off-by: wangrushen --- CHANGELOG.md | 2 +- tests/scalers/redis/helper/helper.go | 2 +- .../redis_cluster_strings_test.go | 10 +++++----- .../redis_sentinel_strings_test.go | 10 +++++----- .../redis_standlone_strings_test.go | 10 +++++----- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37f715bc064..93bf5fa00b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,7 +72,6 @@ Here is an overview of all new **experimental** features: ### Improvements -- **Redis Scaler**: Provide support for scaling based on Redis Key-Values ([#5003](https://github.com/kedacore/keda/issues/5003)) - **General**: Prevent multiple ScaledObjects managing one HPA ([#6130](https://github.com/kedacore/keda/issues/6130)) - **AWS CloudWatch Scaler**: Add support for ignoreNullValues ([#5352](https://github.com/kedacore/keda/issues/5352)) - **Elasticsearch Scaler**: Support Query at the Elasticsearch scaler ([#6216](https://github.com/kedacore/keda/issues/6216)) @@ -83,6 +82,7 @@ Here is an overview of all new **experimental** features: - **Kafka**: Allow disabling FAST negotation when using Kerberos ([#6188](https://github.com/kedacore/keda/issues/6188)) - **Kafka**: Fix logic to scale to zero on invalid offset even with earliest offsetResetPolicy ([#5689](https://github.com/kedacore/keda/issues/5689)) - **RabbitMQ Scaler**: Add connection name for AMQP ([#5958](https://github.com/kedacore/keda/issues/5958)) +- **Redis Scaler**: Provide support for scaling based on Redis Key-Values ([#5003](https://github.com/kedacore/keda/issues/5003)) - **Selenium Scaler**: Add Support for Username and Password Authentication ([#6144](https://github.com/kedacore/keda/issues/6144)) - **Selenium Scaler**: Introduce new parameters setSessionsFromHub, sessionsPerNode and sessionBrowserVersion. ([#6080](https://github.com/kedacore/keda/issues/6080)) - TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX)) diff --git a/tests/scalers/redis/helper/helper.go b/tests/scalers/redis/helper/helper.go index eb4a0532ef5..6f76537cef8 100644 --- a/tests/scalers/redis/helper/helper.go +++ b/tests/scalers/redis/helper/helper.go @@ -142,7 +142,7 @@ func RemoveCluster(t *testing.T, name, namespace string) { helper.DeleteNamespace(t, namespace) } -func InstallClient(t *testing.T, kc *kubernetes.Clientset, name, namespace string) { +func InstallClient(t *testing.T, name, namespace string) { var data = templateData{ Namespace: namespace, RedisName: name, diff --git a/tests/scalers/redis/redis_cluster_strings/redis_cluster_strings_test.go b/tests/scalers/redis/redis_cluster_strings/redis_cluster_strings_test.go index f3c6fcf5169..af103b48ac5 100644 --- a/tests/scalers/redis/redis_cluster_strings/redis_cluster_strings_test.go +++ b/tests/scalers/redis/redis_cluster_strings/redis_cluster_strings_test.go @@ -142,26 +142,26 @@ func TestScaler(t *testing.T) { // Create Redis Cluster redis.InstallCluster(t, kc, testName, redisNamespace, redisPassword) - redis.InstallClient(t, kc, clientName, redisNamespace) + redis.InstallClient(t, clientName, redisNamespace) // wait until client is ready time.Sleep(10 * time.Second) // Create kubernetes resources for testing CreateKubernetesResources(t, kc, testNamespace, data, templates) - testActivation(t, kc, data) - testScaleOut(t, kc, data) + testActivation(t, kc) + testScaleOut(t, kc) testScaleIn(t, kc) } -func testActivation(t *testing.T, kc *kubernetes.Clientset, data templateData) { +func testActivation(t *testing.T, kc *kubernetes.Clientset) { t.Log("--- testing activation ---") setKeyValue(t, 4) AssertReplicaCountNotChangeDuringTimePeriod(t, kc, deploymentName, testNamespace, minReplicaCount, 60) } -func testScaleOut(t *testing.T, kc *kubernetes.Clientset, data templateData) { +func testScaleOut(t *testing.T, kc *kubernetes.Clientset) { t.Log("--- testing scale out ---") setKeyValue(t, 10) diff --git a/tests/scalers/redis/redis_sentinel_strings/redis_sentinel_strings_test.go b/tests/scalers/redis/redis_sentinel_strings/redis_sentinel_strings_test.go index 3f06310ae75..f5c775361e0 100644 --- a/tests/scalers/redis/redis_sentinel_strings/redis_sentinel_strings_test.go +++ b/tests/scalers/redis/redis_sentinel_strings/redis_sentinel_strings_test.go @@ -145,26 +145,26 @@ func TestScaler(t *testing.T) { // Create Redis Standalone redis.InstallSentinel(t, kc, testName, redisNamespace, redisPassword) - redis.InstallClient(t, kc, clientName, redisNamespace) + redis.InstallClient(t, clientName, redisNamespace) // wait until client is ready time.Sleep(10 * time.Second) // Create kubernetes resources for testing CreateKubernetesResources(t, kc, testNamespace, data, templates) - testActivation(t, kc, data) - testScaleOut(t, kc, data) + testActivation(t, kc) + testScaleOut(t, kc) testScaleIn(t, kc) } -func testActivation(t *testing.T, kc *kubernetes.Clientset, data templateData) { +func testActivation(t *testing.T, kc *kubernetes.Clientset) { t.Log("--- testing activation ---") setKeyValue(t, 4) AssertReplicaCountNotChangeDuringTimePeriod(t, kc, deploymentName, testNamespace, minReplicaCount, 60) } -func testScaleOut(t *testing.T, kc *kubernetes.Clientset, data templateData) { +func testScaleOut(t *testing.T, kc *kubernetes.Clientset) { t.Log("--- testing scale out ---") setKeyValue(t, 10) diff --git a/tests/scalers/redis/redis_standalone_strings/redis_standlone_strings_test.go b/tests/scalers/redis/redis_standalone_strings/redis_standlone_strings_test.go index 5115398abf1..f3a79b3154d 100644 --- a/tests/scalers/redis/redis_standalone_strings/redis_standlone_strings_test.go +++ b/tests/scalers/redis/redis_standalone_strings/redis_standlone_strings_test.go @@ -141,26 +141,26 @@ func TestScaler(t *testing.T) { // Create Redis Standalone redis.InstallStandalone(t, kc, testName, redisNamespace, redisPassword) - redis.InstallClient(t, kc, clientName, redisNamespace) + redis.InstallClient(t, clientName, redisNamespace) // wait until client is ready time.Sleep(10 * time.Second) // Create kubernetes resources for testing CreateKubernetesResources(t, kc, testNamespace, data, templates) - testActivation(t, kc, data) - testScaleOut(t, kc, data) + testActivation(t, kc) + testScaleOut(t, kc) testScaleIn(t, kc) } -func testActivation(t *testing.T, kc *kubernetes.Clientset, data templateData) { +func testActivation(t *testing.T, kc *kubernetes.Clientset) { t.Log("--- testing activation ---") setKeyValue(t, 4) AssertReplicaCountNotChangeDuringTimePeriod(t, kc, deploymentName, testNamespace, minReplicaCount, 60) } -func testScaleOut(t *testing.T, kc *kubernetes.Clientset, data templateData) { +func testScaleOut(t *testing.T, kc *kubernetes.Clientset) { t.Log("--- testing scale out ---") setKeyValue(t, 10)