mirror of
https://github.com/lukaszraczylo/graphql-monitoring-proxy.git
synced 2026-06-05 23:03:48 +00:00
fixup! fixup! Fix: Redis connection for tests.
This commit is contained in:
Vendored
+4
@@ -33,6 +33,10 @@ func NewClient(redisClientConfig *RedisClientConfig) *RedisConfig {
|
||||
}),
|
||||
ctx: context.Background(),
|
||||
}
|
||||
_, err := c.client.Ping(c.ctx).Result()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
||||
|
||||
Vendored
+2
-3
@@ -15,10 +15,9 @@ type RedisConfigSuite struct {
|
||||
}
|
||||
|
||||
func (suite *RedisConfigSuite) SetupTest() {
|
||||
redis_host := envutil.Getenv("REDIS_HOST", "localhost")
|
||||
redis_port := envutil.Getenv("REDIS_PORT", "6379")
|
||||
redis_server := envutil.Getenv("REDIS_SERVER", "localhost:6379")
|
||||
suite.redisConfig = NewClient(&RedisClientConfig{
|
||||
RedisServer: redis_host + ":" + redis_port,
|
||||
RedisServer: redis_server,
|
||||
RedisPassword: "",
|
||||
RedisDB: 0,
|
||||
})
|
||||
|
||||
+2
-4
@@ -49,11 +49,9 @@ func (suite *Tests) Test_cacheLookupInmemory() {
|
||||
}
|
||||
|
||||
func (suite *Tests) Test_cacheLookupRedis() {
|
||||
redis_host := envutil.Getenv("REDIS_HOST", "localhost")
|
||||
redis_port := envutil.Getenv("REDIS_PORT", "6379")
|
||||
|
||||
redis_server := envutil.Getenv("REDIS_SERVER", "localhost:6379")
|
||||
cfg.Cache.Client = libpack_redis.NewClient(&libpack_redis.RedisClientConfig{
|
||||
RedisServer: redis_host + ":" + redis_port,
|
||||
RedisServer: redis_server,
|
||||
RedisPassword: "",
|
||||
RedisDB: 0,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user