Add store split for Get Dashboard version method (#49138)

* Add store split for Get Dashboard version method

* Implement dashboard version service

* Fix api tests

* Remove GetDashboarVersion from sqlstore

* Add fakes for Get dashboard version

* Fix sqlstore test

* Add Get Dashboard store test

* Add dashver service test

* Remove useless comments
This commit is contained in:
idafurjes
2022-05-25 10:41:51 +02:00
committed by GitHub
parent 73a729bbe8
commit b07904fe56
16 changed files with 447 additions and 163 deletions
+14 -12
View File
@@ -31,6 +31,7 @@ import (
"github.com/grafana/grafana/pkg/services/dashboards"
dashboardsstore "github.com/grafana/grafana/pkg/services/dashboards/database"
dashboardservice "github.com/grafana/grafana/pkg/services/dashboards/service"
dashver "github.com/grafana/grafana/pkg/services/dashboardversion"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/ldap"
"github.com/grafana/grafana/pkg/services/login/loginservice"
@@ -154,18 +155,19 @@ func (sc *scenarioContext) fakeReqNoAssertionsWithCookie(method, url string, coo
}
type scenarioContext struct {
t *testing.T
cfg *setting.Cfg
m *web.Mux
context *models.ReqContext
resp *httptest.ResponseRecorder
handlerFunc handlerFunc
defaultHandler web.Handler
req *http.Request
url string
userAuthTokenService *auth.FakeUserAuthTokenService
sqlStore sqlstore.Store
authInfoService *logintest.AuthInfoServiceFake
t *testing.T
cfg *setting.Cfg
m *web.Mux
context *models.ReqContext
resp *httptest.ResponseRecorder
handlerFunc handlerFunc
defaultHandler web.Handler
req *http.Request
url string
userAuthTokenService *auth.FakeUserAuthTokenService
sqlStore sqlstore.Store
authInfoService *logintest.AuthInfoServiceFake
dashboardVersionService dashver.Service
}
func (sc *scenarioContext) exec() {