Skip to content

Commit

Permalink
fix: static check for redis strings e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: wangrushen <[email protected]>
  • Loading branch information
dovics committed Oct 27, 2024
1 parent b617e98 commit cc7153e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion tests/scalers/redis/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit cc7153e

Please sign in to comment.