mirror of
https://github.com/grafana/grafana.git
synced 2025-02-16 18:34:52 -06:00
* add encryption codec to the remote cache * change config files too * fix test constructor * pass codec into the test cache
31 lines
633 B
Go
31 lines
633 B
Go
package remotecache
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/grafana/grafana/pkg/infra/db"
|
|
"github.com/grafana/grafana/pkg/services/secrets/fakes"
|
|
"github.com/grafana/grafana/pkg/setting"
|
|
)
|
|
|
|
// NewFakeStore creates store for testing
|
|
func NewFakeStore(t *testing.T) *RemoteCache {
|
|
t.Helper()
|
|
|
|
opts := &setting.RemoteCacheOptions{
|
|
Name: "database",
|
|
ConnStr: "",
|
|
}
|
|
|
|
sqlStore := db.InitTestDB(t)
|
|
|
|
dc, err := ProvideService(&setting.Cfg{
|
|
RemoteCacheOptions: opts,
|
|
}, sqlStore, fakes.NewFakeSecretsService())
|
|
require.NoError(t, err, "Failed to init remote cache for test")
|
|
|
|
return dc
|
|
}
|