Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

feat(579): mock redis to reduce info logs #588

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions client_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ package bux

import (
"context"
"net/http"
"os"
"testing"
"time"

"github.com/BuxOrg/bux/chainstate"
"github.com/BuxOrg/bux/logging"
"github.com/BuxOrg/bux/taskmanager"
Expand All @@ -20,6 +15,10 @@ import (
"github.com/rs/zerolog"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"net/http"
"os"
"testing"
"time"
)

// TestNewRelicOptions will test the method enable()
Expand Down Expand Up @@ -264,13 +263,17 @@ func TestWithRedis(t *testing.T) {
if testing.Short() {
t.Skip("skipping live local redis tests")
}
client, conn := tester.LoadMockRedis(10*time.Second, 10*time.Second, 10, 10)
require.NotNil(t, client)
require.NotNil(t, conn)

tc, err := NewClient(
tester.GetNewRelicCtx(t, defaultNewRelicApp, defaultNewRelicTx),
WithTaskqConfig(taskmanager.DefaultTaskQConfig(tester.RandomTablePrefix())),
WithRedis(&cachestore.RedisConfig{
URL: cachestore.RedisPrefix + "localhost:6379",
}),
WithRedisConnection(client),
WithSQLite(tester.SQLiteTestConfig(false, true)),
WithMinercraft(&chainstate.MinerCraftBase{}),
WithLogger(&testLogger),
Expand All @@ -288,13 +291,17 @@ func TestWithRedis(t *testing.T) {
if testing.Short() {
t.Skip("skipping live local redis tests")
}
client, conn := tester.LoadMockRedis(10*time.Second, 10*time.Second, 10, 10)
require.NotNil(t, client)
require.NotNil(t, conn)

tc, err := NewClient(
tester.GetNewRelicCtx(t, defaultNewRelicApp, defaultNewRelicTx),
WithTaskqConfig(taskmanager.DefaultTaskQConfig(tester.RandomTablePrefix())),
WithRedis(&cachestore.RedisConfig{
URL: "localhost:6379",
}),
WithRedisConnection(client),
WithSQLite(tester.SQLiteTestConfig(false, true)),
WithMinercraft(&chainstate.MinerCraftBase{}),
WithLogger(&testLogger),
Expand Down Expand Up @@ -503,14 +510,16 @@ func TestWithTaskQ(t *testing.T) {
t.Skip("skipping live local redis tests")
}

client, conn := tester.LoadMockRedis(10*time.Second, 10*time.Second, 10, 10)
require.NotNil(t, client)
require.NotNil(t, conn)

tc, err := NewClient(
tester.GetNewRelicCtx(t, defaultNewRelicApp, defaultNewRelicTx),
WithTaskqConfig(
taskmanager.DefaultTaskQConfig(tester.RandomTablePrefix(), taskmanager.WithRedis("localhost:6379")),
),
WithRedis(&cachestore.RedisConfig{
URL: cachestore.RedisPrefix + "localhost:6379",
}),
WithRedisConnection(client),
WithSQLite(tester.SQLiteTestConfig(false, true)),
WithMinercraft(&chainstate.MinerCraftBase{}),
WithLogger(&testLogger),
Expand Down
Loading