From e679b92e68d139cc6734f3eab5e99a28fa65c0a0 Mon Sep 17 00:00:00 2001 From: jorturfer Date: Thu, 5 Aug 2021 00:27:35 +0200 Subject: [PATCH] Style fixes Signed-off-by: jorturfer --- .golangci.yml | 3 +++ tests/scalers/kubernetes-workload.test.ts | 18 +++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index d11a00f13b2..345a9e3bd0b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -64,6 +64,9 @@ issues: - path: scale_resolvers_test.go linters: - staticcheck + - path: kubernetes_workload_scaler_test.go + linters: + - staticcheck # https://github.com/go-critic/go-critic/issues/926 - linters: - gocritic diff --git a/tests/scalers/kubernetes-workload.test.ts b/tests/scalers/kubernetes-workload.test.ts index 3976e3bbe8c..da8a910f2a4 100644 --- a/tests/scalers/kubernetes-workload.test.ts +++ b/tests/scalers/kubernetes-workload.test.ts @@ -40,17 +40,17 @@ test.serial(`Deployment should scale to fit the amount of pods which match the s `kubectl scale deployment.apps/monitored-deployment --namespace ${testNamespace} --replicas=5` ) t.true(await waitForDeploymentReplicaCount(5, 'sut-deployment', testNamespace, 6, 10000), 'Replica count should be 5 after 60 seconds') - + sh.exec( `kubectl scale deployment.apps/monitored-deployment --namespace ${testNamespace} --replicas=10` ) t.true(await waitForDeploymentReplicaCount(10, 'sut-deployment', testNamespace, 6, 10000), 'Replica count should be 10 after 60 seconds') - + sh.exec( `kubectl scale deployment.apps/monitored-deployment --namespace ${testNamespace} --replicas=5` ) t.true(await waitForDeploymentReplicaCount(5, 'sut-deployment', testNamespace, 6, 10000), 'Replica count should be 5 after 60 seconds') - + sh.exec( `kubectl scale deployment.apps/monitored-deployment --namespace ${testNamespace} --replicas=1` ) @@ -59,7 +59,7 @@ test.serial(`Deployment should scale to fit the amount of pods which match the s test.after.always.cb('clean up workload test related deployments', t => { const resources = [ - 'scaledobject.keda.sh/sut-scaledobject', + 'scaledobject.keda.sh/sut-scaledobject', 'deployment.apps/sut-deployment', 'deployment.apps/monitored-deployment', ] @@ -67,7 +67,7 @@ test.after.always.cb('clean up workload test related deployments', t => { for (const resource of resources) { sh.exec(`kubectl delete ${resource} --namespace ${testNamespace}`) } - sh.exec(`kubectl delete namespace ${testNamespace}`) + sh.exec(`kubectl delete namespace ${testNamespace}`) t.end() }) @@ -122,14 +122,14 @@ spec: cooldownPeriod: 5 minReplicaCount: 1 maxReplicaCount: 10 - advanced: - horizontalPodAutoscalerConfig: - behavior: + advanced: + horizontalPodAutoscalerConfig: + behavior: scaleDown: stabilizationWindowSeconds: 15 triggers: - type: kubernetes-workload - metadata: + metadata: podSelector: 'pod=workload-test' namespace: ${testNamespace} value: '1'`