fixup! Fix: Redis connection for tests.

This commit is contained in:
2024-06-11 11:44:17 +01:00
parent fe7af0b8ca
commit 44cd694086
+9 -3
View File
@@ -1,6 +1,9 @@
package main package main
import libpack_redis "github.com/lukaszraczylo/graphql-monitoring-proxy/cache/redis" import (
"github.com/gookit/goutil/envutil"
libpack_redis "github.com/lukaszraczylo/graphql-monitoring-proxy/cache/redis"
)
func (suite *Tests) Test_cacheLookupInmemory() { func (suite *Tests) Test_cacheLookupInmemory() {
type args struct { type args struct {
@@ -46,10 +49,13 @@ func (suite *Tests) Test_cacheLookupInmemory() {
} }
func (suite *Tests) Test_cacheLookupRedis() { func (suite *Tests) Test_cacheLookupRedis() {
redis_host := envutil.Getenv("REDIS_HOST", "localhost")
redis_port := envutil.Getenv("REDIS_PORT", "6379")
cfg.Cache.Client = libpack_redis.NewClient(&libpack_redis.RedisClientConfig{ cfg.Cache.Client = libpack_redis.NewClient(&libpack_redis.RedisClientConfig{
RedisDB: 0, RedisServer: redis_host + ":" + redis_port,
RedisServer: "localhost:6379",
RedisPassword: "", RedisPassword: "",
RedisDB: 0,
}) })
type args struct { type args struct {