From 91ae8d1e398907b7209b58f4f46dd66abe1b5fcc 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 --- 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 +++++----- 4 files changed, 16 insertions(+), 16 deletions(-) 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)