fix(test): use REDIS_ADDR environment variable in test mocks to match CI service hostname
Some checks failed
CI / lint (push) Failing after 12s
CI / build (push) Has been skipped
CI / test (push) Has been skipped
CI / docker (push) Has been skipped

This commit is contained in:
2026-08-20 17:49:04 +03:00
parent dbafaf57ce
commit e73ed82b7e

View File

@@ -44,8 +44,15 @@ func flushRedisForTest(t *testing.T, client *redis.Client) {
}
func newMockHandlerContext() *HandlerContext {
// Read Redis address from environment, default to localhost:6379
redisAddr := os.Getenv("REDIS_ADDR")
if redisAddr == "" {
redisAddr = "localhost:6379"
}
redisClient := redis.NewClient(&redis.Options{
Addr: "localhost:6379",
Addr: redisAddr,
Password: "",
DB: 0,
})
// Create an empty routing graph