grafana/pkg/server/test_env.go
Dan Cech 1f1461734c
Storage: Add support for sortBy selector (#80680)
* add support for sortBy field selector

* use label selectors instead of field selectors

* set entity_labels on create & update

* make entity server integration tests work

* test fixes

* be more consistent with handling of empty body, meta or status

* workaround for database is locked errors during migration

* fix double import of sqlite3

* rename functions and tidy up

* refactor update

* disable integration tests until we can fix the database locking issue
2024-02-07 15:05:10 -05:00

47 lines
1.5 KiB
Go

package server
import (
"github.com/grafana/grafana/pkg/infra/httpclient"
"github.com/grafana/grafana/pkg/plugins/manager/registry"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/grpcserver"
"github.com/grafana/grafana/pkg/services/notifications"
"github.com/grafana/grafana/pkg/services/oauthtoken/oauthtokentest"
"github.com/grafana/grafana/pkg/services/sqlstore"
"github.com/grafana/grafana/pkg/web"
)
func ProvideTestEnv(
server *Server,
store *sqlstore.SQLStore,
ns *notifications.NotificationServiceMock,
grpcServer grpcserver.Provider,
pluginRegistry registry.Service,
httpClientProvider httpclient.Provider,
oAuthTokenService *oauthtokentest.Service,
featureMgmt featuremgmt.FeatureToggles,
) (*TestEnv, error) {
return &TestEnv{
Server: server,
SQLStore: store,
NotificationService: ns,
GRPCServer: grpcServer,
PluginRegistry: pluginRegistry,
HTTPClientProvider: httpClientProvider,
OAuthTokenService: oAuthTokenService,
FeatureToggles: featureMgmt,
}, nil
}
type TestEnv struct {
Server *Server
SQLStore *sqlstore.SQLStore
NotificationService *notifications.NotificationServiceMock
GRPCServer grpcserver.Provider
PluginRegistry registry.Service
HTTPClientProvider httpclient.Provider
OAuthTokenService *oauthtokentest.Service
RequestMiddleware web.Middleware
FeatureToggles featuremgmt.FeatureToggles
}