From 38c76c5976ebb9c1372108fb1b8d55a9fe96642e Mon Sep 17 00:00:00 2001 From: Deepak Sah Date: Sun, 10 Jan 2021 00:05:35 +0530 Subject: [PATCH] Add graceful cleanup for redis cluster e2e test (#1493) Signed-off-by: Deepak --- tests/scalers/redis-cluster-lists.test.ts | 5 +++-- tests/scalers/redis-cluster-streams.test.ts | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/scalers/redis-cluster-lists.test.ts b/tests/scalers/redis-cluster-lists.test.ts index 0abb20b9ef3..4d8566513ea 100644 --- a/tests/scalers/redis-cluster-lists.test.ts +++ b/tests/scalers/redis-cluster-lists.test.ts @@ -251,8 +251,8 @@ test.after.always.cb('clean up deployment', t => { `scaledobject.keda.sh/${redisWorkerHostPortRefDeploymentName}`, `scaledobject.keda.sh/${redisWorkerAddressRefDeploymentName}`, `scaledobject.keda.sh/${redisWorkerHostPortRefTriggerAuthDeploymentName}`, - 'triggerauthentication.keda.sh/keda-redis-list-triggerauth', - 'triggerauthentication.keda.sh/keda-redis-list-triggerauth-host-port', + 'triggerauthentication.keda.sh/keda-redis-cluster-list-triggerauth', + 'triggerauthentication.keda.sh/keda-redis-cluster-list-triggerauth-host-port', `deployment/${redisWorkerAddressRefDeploymentName}`, `deployment/${redisWorkerHostPortRefTriggerAuthDeploymentName}`, `deployment/${redisWorkerHostPortRefDeploymentName}`, @@ -264,6 +264,7 @@ test.after.always.cb('clean up deployment', t => { } sh.exec(`kubectl delete namespace ${testNamespace}`) + sh.exec(`helm delete ${redisClusterName} --namespace ${redisNamespace}`) sh.exec(`kubectl delete namespace ${redisNamespace}`) t.end() }) diff --git a/tests/scalers/redis-cluster-streams.test.ts b/tests/scalers/redis-cluster-streams.test.ts index 48c7b014def..a3106051949 100644 --- a/tests/scalers/redis-cluster-streams.test.ts +++ b/tests/scalers/redis-cluster-streams.test.ts @@ -10,8 +10,6 @@ const redisService = 'redis-cluster-streams' const testNamespace = 'redis-cluster-streams-test' const redisPassword = 'foobared' let redisHost = '' -let redisAddress = '' -const redisPort = 6379 const numMessages = 100 test.before(t => { @@ -35,7 +33,6 @@ test.before(t => { // Get Redis cluster address. redisHost = sh.exec(`kubectl get svc ${redisService} -n ${redisNamespace} -o jsonpath='{.spec.clusterIP}'`) - redisAddress = `${redisHost}:${redisPort}` // Create test namespace. sh.exec(`kubectl create namespace ${testNamespace}`) @@ -114,6 +111,7 @@ test.after.always.cb('clean up deployment', t => { 'triggerauthentications.keda.sh/keda-redis-stream-triggerauth', 'secret/redis-password', 'deployment/redis-streams-consumer', + 'job/redis-streams-producer', ] for (const resource of resources) { @@ -121,6 +119,7 @@ test.after.always.cb('clean up deployment', t => { } sh.exec(`kubectl delete namespace ${testNamespace}`) + sh.exec(`helm delete ${redisClusterName} --namespace ${redisNamespace}`) sh.exec(`kubectl delete namespace ${redisNamespace}`) t.end() })