Skip to content

Commit

Permalink
Make lint happy
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaochao Dong (@damnever) <[email protected]>
  • Loading branch information
damnever committed Feb 1, 2024
1 parent f76994e commit 07d9134
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pkg/cacheutil/redis_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ func TestRedisClient(t *testing.T) {
}

func TestValidateRedisConfig(t *testing.T) {
addr := "127.0.0.1:6789"
tests := []struct {
name string
config func() RedisClientConfig
Expand All @@ -147,7 +148,7 @@ func TestValidateRedisConfig(t *testing.T) {
name: "simpleConfig",
config: func() RedisClientConfig {
cfg := DefaultRedisClientConfig
cfg.Addr = "127.0.0.1:6789"
cfg.Addr = addr
cfg.Username = "user"
cfg.Password = "1234"
return cfg
Expand All @@ -158,7 +159,7 @@ func TestValidateRedisConfig(t *testing.T) {
name: "tlsConfigDefaults",
config: func() RedisClientConfig {
cfg := DefaultRedisClientConfig
cfg.Addr = "127.0.0.1:6789"
cfg.Addr = addr
cfg.Username = "user"
cfg.Password = "1234"
cfg.TLSEnabled = true
Expand All @@ -170,7 +171,7 @@ func TestValidateRedisConfig(t *testing.T) {
name: "tlsClientCertConfig",
config: func() RedisClientConfig {
cfg := DefaultRedisClientConfig
cfg.Addr = "127.0.0.1:6789"
cfg.Addr = addr
cfg.Username = "user"
cfg.Password = "1234"
cfg.TLSEnabled = true
Expand All @@ -186,7 +187,7 @@ func TestValidateRedisConfig(t *testing.T) {
name: "tlsInvalidClientCertConfig",
config: func() RedisClientConfig {
cfg := DefaultRedisClientConfig
cfg.Addr = "127.0.0.1:6789"
cfg.Addr = addr
cfg.Username = "user"
cfg.Password = "1234"
cfg.TLSEnabled = true
Expand All @@ -201,7 +202,7 @@ func TestValidateRedisConfig(t *testing.T) {
name: "SetAsyncCircuitBreakerDisabled",
config: func() RedisClientConfig {
cfg := DefaultRedisClientConfig
cfg.Addr = "127.0.0.1:6789"
cfg.Addr = addr
cfg.SetAsyncCircuitBreakerEnabled = false
cfg.SetAsyncCircuitBreakerConsecutiveFailures = 0
return cfg
Expand All @@ -212,7 +213,7 @@ func TestValidateRedisConfig(t *testing.T) {
name: "invalidCircuitBreakerFailurePercent",
config: func() RedisClientConfig {
cfg := DefaultRedisClientConfig
cfg.Addr = "127.0.0.1:6789"
cfg.Addr = addr
cfg.SetAsyncCircuitBreakerEnabled = true
cfg.SetAsyncCircuitBreakerConsecutiveFailures = 0
return cfg
Expand All @@ -223,7 +224,7 @@ func TestValidateRedisConfig(t *testing.T) {
name: "invalidCircuitBreakerFailurePercent",
config: func() RedisClientConfig {
cfg := DefaultRedisClientConfig
cfg.Addr = "127.0.0.1:6789"
cfg.Addr = addr
cfg.SetAsyncCircuitBreakerEnabled = true
cfg.SetAsyncCircuitBreakerFailurePercent = 0
return cfg
Expand Down

0 comments on commit 07d9134

Please sign in to comment.