mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-06 06:51:29 +02:00
Remove unused cacheKey helper and testcontainers imports, simplify Redis container setup
This commit is contained in:
@@ -8,9 +8,7 @@ import (
|
||||
"github.com/redis/go-redis/v9"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/testcontainers/testcontainers-go"
|
||||
testcontainersredis "github.com/testcontainers/testcontainers-go/modules/redis"
|
||||
"github.com/testcontainers/testcontainers-go/wait"
|
||||
)
|
||||
|
||||
func TestParseFastPathFlag(t *testing.T) {
|
||||
@@ -130,12 +128,7 @@ func setupFastPathRedisContainer(t *testing.T) (string, *redis.Client) {
|
||||
t.Helper()
|
||||
|
||||
ctx := context.Background()
|
||||
redisContainer, err := testcontainersredis.RunContainer(ctx,
|
||||
testcontainers.WithImage("redis:7"),
|
||||
testcontainers.WithWaitStrategy(
|
||||
wait.ForListeningPort("6379/tcp"),
|
||||
),
|
||||
)
|
||||
redisContainer, err := testcontainersredis.Run(ctx, "redis:7")
|
||||
require.NoError(t, err, "create redis test container")
|
||||
|
||||
t.Cleanup(func() {
|
||||
|
||||
@@ -3,7 +3,6 @@ package grpc
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/eko/gocache/lib/v4/cache"
|
||||
@@ -81,9 +80,3 @@ func (c *PeerSerialCache) Delete(pubKey string) {
|
||||
log.Debugf("peer serial cache: delete entry for %s: %v", pubKey, err)
|
||||
}
|
||||
}
|
||||
|
||||
// cacheKey exposes the namespaced key for tests that need to peek at the raw
|
||||
// storage, e.g. when asserting TTL behaviour against Redis.
|
||||
func (c *PeerSerialCache) cacheKey(pubKey string) string {
|
||||
return fmt.Sprintf("%s%s", peerSerialCacheKeyPrefix, pubKey)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user