Chore: remove session storage references (#16445)
* Chore: remove session storage references * Small refactoring of the settings module * Update docs - remove references for the session storage * Update config files (sample and default configs) * Add tests for warning during the config load on defined storage cache * Remove all references to session storage * Remove macaron session dependency * Remove leftovers * Fix: address review comments * Fix: remove old deps * Fix: add skipStaticRootValidation = true to tests * Fix: improve the docs and warning message As per discussion in here - https://github.com/grafana/grafana/pull/16445/files#r273026255 * Chore: make linter happy Fixes #16148 Ref #16114
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package setting
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/grafana/grafana/pkg/log"
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
)
|
||||
|
||||
type testLogger struct {
|
||||
log.Logger
|
||||
warnCalled bool
|
||||
warnMessage string
|
||||
}
|
||||
|
||||
func (stub *testLogger) Warn(testMessage string, ctx ...interface{}) {
|
||||
stub.warnCalled = true
|
||||
stub.warnMessage = testMessage
|
||||
}
|
||||
func TestSessionSettings(t *testing.T) {
|
||||
Convey("session config", t, func() {
|
||||
skipStaticRootValidation = true
|
||||
|
||||
Convey("Reading session should log error ", func() {
|
||||
var (
|
||||
cfg = NewCfg()
|
||||
homePath = "../../"
|
||||
)
|
||||
|
||||
stub := &testLogger{}
|
||||
cfg.Logger = stub
|
||||
|
||||
cfg.Load(&CommandLineArgs{
|
||||
HomePath: homePath,
|
||||
Config: filepath.Join(homePath, "pkg/setting/testdata/session.ini"),
|
||||
})
|
||||
|
||||
So(stub.warnCalled, ShouldEqual, true)
|
||||
So(len(stub.warnMessage), ShouldBeGreaterThan, 0)
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user