Documentation
¶
Index ¶
- Constants
- func CreateSimpleClient(t *testing.T, cfgName *string, container testcontainers.Container) (service.GrafanaService, *viper.Viper)
- func CreateSimpleClientWithConfig(t *testing.T, cfgProvider config.Provider, container testcontainers.Container) service.GrafanaService
- func InitOrganizations(t *testing.T) (testcontainers.Container, func() error)
- func InitTest(t *testing.T, cfgProvider config.Provider, envProp map[string]string) (service.GrafanaService, testcontainers.Container, func() error)
- func InitTestLegacy(t *testing.T, cfgName *string, envProp map[string]string) (service.GrafanaService, *viper.Viper, testcontainers.Container, func() error)
- func InterceptStdout() (*os.File, *os.File, context.CancelFunc)
- func SetupAndExecuteMockingServices(t *testing.T, ...) (string, func())
- func SetupCloudFunctionOpt(opts ...CloudTestOpt) (context.Context, context.CancelFunc, service.GrafanaService, error)
- type CloudTestOpt
- type ConfigProviderFunc
Constants ¶
View Source
const ( GrafanaTestVersionEnv = "GRAFANA_TEST_VERSION" // #nosec G101 EnableTokenTestsEnv = "TEST_TOKEN_CONFIG" TokenEnabledValue = "1" )
View Source
const ( OrgNameOverride = "GDG_CONTEXTS__TESTING__ORGANIZATION_NAME" EnableNestedBehavior = "GDG_CONTEXTS__TESTING__DASHBOARD_SETTINGS__NESTED_FOLDERS" IgnoreDashFilters = "GDG_CONTEXTS__TESTING__DASHBOARD_SETTINGS__IGNORE_FILTERS" )
Variables ¶
This section is empty.
Functions ¶
func CreateSimpleClient ¶
func CreateSimpleClient(t *testing.T, cfgName *string, container testcontainers.Container) (service.GrafanaService, *viper.Viper)
func CreateSimpleClientWithConfig ¶ added in v0.7.2
func CreateSimpleClientWithConfig(t *testing.T, cfgProvider config.Provider, container testcontainers.Container) service.GrafanaService
func InitOrganizations ¶
func InitOrganizations(t *testing.T) (testcontainers.Container, func() error)
InitOrganizations will upload all known organizations and return the grafana container object
func InitTestLegacy ¶ added in v0.7.2
func InterceptStdout ¶ added in v0.7.2
InterceptStdout is a test helper function that will redirect all stdout in and out to a different file stream. It returns the stdout, stderr, and a function to be invoked to close the streams.
func SetupAndExecuteMockingServices ¶ added in v0.7.2
func SetupAndExecuteMockingServices(t *testing.T, process func(mock *mocks.GrafanaService, optionMockSvc func() support.RootOption) error) (string, func())
SetupAndExecuteMockingServices will create a mock for varous required entities allowing to test the CLI flag parsing process: function that setups mocks and invokes the Execute command
func SetupCloudFunctionOpt ¶ added in v0.7.2
func SetupCloudFunctionOpt(opts ...CloudTestOpt) (context.Context, context.CancelFunc, service.GrafanaService, error)
Types ¶
type CloudTestOpt ¶ added in v0.7.2
func SetBucketName ¶ added in v0.7.2
func SetBucketName(bucketName string) CloudTestOpt
func SetCloudType ¶ added in v0.7.2
func SetCloudType(cloudType string) CloudTestOpt
func SetPrefix ¶ added in v0.7.2
func SetPrefix(prefix string) CloudTestOpt
type ConfigProviderFunc ¶ added in v0.7.2
type ConfigProviderFunc func() *config.Configuration
Click to show internal directories.
Click to hide internal directories.