mirror of
https://github.com/grafana/grafana.git
synced 2024-11-28 19:54:10 -06:00
4ee389676e
* add warning on Count * add usagestats service * fix typo * remove unused glog * remote cache stats collect * add encrypt usage stat * rename handler * Update pkg/infra/remotecache/remotecache.go Co-authored-by: Dan Cech <dcech@grafana.com> * Update pkg/infra/remotecache/remotecache_test.go --------- Co-authored-by: Dan Cech <dcech@grafana.com>
32 lines
714 B
Go
32 lines
714 B
Go
package remotecache
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/grafana/grafana/pkg/infra/db"
|
|
"github.com/grafana/grafana/pkg/infra/usagestats"
|
|
"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, &usagestats.UsageStatsMock{}, fakes.NewFakeSecretsService())
|
|
require.NoError(t, err, "Failed to init remote cache for test")
|
|
|
|
return dc
|
|
}
|