mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 10:20:29 -06:00
377079d8b3
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
35 lines
883 B
Go
35 lines
883 B
Go
package setting
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestCfg_setUnifiedStorageConfig(t *testing.T) {
|
|
t.Run("read unified_storage configs", func(t *testing.T) {
|
|
cfg := NewCfg()
|
|
err := cfg.Load(CommandLineArgs{HomePath: "../../", Config: "../../conf/defaults.ini"})
|
|
assert.NoError(t, err)
|
|
|
|
s, err := cfg.Raw.NewSection("unified_storage.playlists.playlist.grafana.app")
|
|
assert.NoError(t, err)
|
|
|
|
_, err = s.NewKey("dualWriterMode", "2")
|
|
assert.NoError(t, err)
|
|
|
|
_, err = s.NewKey("dualWriterPeriodicDataSyncJobEnabled", "true")
|
|
assert.NoError(t, err)
|
|
|
|
cfg.setUnifiedStorageConfig()
|
|
|
|
value, exists := cfg.UnifiedStorage["playlists.playlist.grafana.app"]
|
|
|
|
assert.Equal(t, exists, true)
|
|
assert.Equal(t, value, UnifiedStorageConfig{
|
|
DualWriterMode: 2,
|
|
DualWriterPeriodicDataSyncJobEnabled: true,
|
|
})
|
|
})
|
|
}
|