mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
pkg/infra: Check errors (#19705)
* pkg/infra: Check errors Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * pkg/infra: Handle errors Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * Update pkg/infra/usagestats/usage_stats.go Co-Authored-By: Marcus Efraimsson <marcus.efraimsson@gmail.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
type CacheableStruct struct {
|
||||
@@ -29,19 +30,17 @@ func createTestClient(t *testing.T, opts *setting.RemoteCacheOptions, sqlstore *
|
||||
}
|
||||
|
||||
err := dc.Init()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to init client for test. error: %v", err)
|
||||
}
|
||||
require.Nil(t, err, "Failed to init client for test")
|
||||
|
||||
return dc
|
||||
}
|
||||
|
||||
func TestCachedBasedOnConfig(t *testing.T) {
|
||||
|
||||
cfg := setting.NewCfg()
|
||||
cfg.Load(&setting.CommandLineArgs{
|
||||
err := cfg.Load(&setting.CommandLineArgs{
|
||||
HomePath: "../../../",
|
||||
})
|
||||
require.Nil(t, err, "Failed to load config")
|
||||
|
||||
client := createTestClient(t, cfg.RemoteCacheOptions, sqlstore.InitTestDB(t))
|
||||
runTestsForClient(t, client)
|
||||
|
||||
Reference in New Issue
Block a user