From 3c0dc8435eb4369f3c85b59303722d8f80e6defc Mon Sep 17 00:00:00 2001 From: Kevin Wan Date: Sun, 29 Jan 2023 21:39:54 +0800 Subject: [PATCH] chore: improve codecov (#2828) --- core/stores/redis/conf.go | 1 + core/stores/redis/redis.go | 1 + core/stores/redis/redis_test.go | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/stores/redis/conf.go b/core/stores/redis/conf.go index 711ce817..00a7ff3d 100644 --- a/core/stores/redis/conf.go +++ b/core/stores/redis/conf.go @@ -29,6 +29,7 @@ type ( } ) +// NewRedis returns a Redis. // Deprecated: use MustNewRedis or NewRedis instead. func (rc RedisConf) NewRedis() *Redis { var opts []Option diff --git a/core/stores/redis/redis.go b/core/stores/redis/redis.go index 9572aeed..7ee06ea9 100644 --- a/core/stores/redis/redis.go +++ b/core/stores/redis/redis.go @@ -86,6 +86,7 @@ type ( StringCmd = red.StringCmd ) +// New returns a Redis with given options. // Deprecated: use MustNewRedis or NewRedis instead. func New(addr string, opts ...Option) *Redis { return newRedis(addr, opts...) diff --git a/core/stores/redis/redis_test.go b/core/stores/redis/redis_test.go index ec36e02b..7a83b6f4 100644 --- a/core/stores/redis/redis_test.go +++ b/core/stores/redis/redis_test.go @@ -1776,7 +1776,10 @@ func runOnRedis(t *testing.T, fn func(client *Redis)) { } }() - fn(New(s.Addr())) + fn(MustNewRedis(RedisConf{ + Host: s.Addr(), + Type: NodeType, + })) } func runOnRedisWithError(t *testing.T, fn func(client *Redis)) {