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 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
- type InitContainerResult
Constants ¶
View Source
const ( GrafanaTestVersionEnv = "GRAFANA_TEST_VERSION" // #nosec G101 EnableTokenTestsEnv = "TEST_TOKEN_CONFIG" FeatureEnabled = "1" FeatureDisabled = "0" )
View Source
const ( OrgNameOverride = "GDG_CONTEXTS__TESTING__ORGANIZATION_NAME" EnableNestedBehavior = "GDG_CONTEXTS__TESTING__DASHBOARD_SETTINGS__NESTED_FOLDERS" )
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 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
type InitContainerResult ¶ added in v0.8.0
type InitContainerResult struct {
ApiClient service.GrafanaService
Container testcontainers.Container
CleanUp func() error
Err error
}
func NewInitContainerResult ¶ added in v0.8.0
func NewInitContainerResult(client service.GrafanaService, container testcontainers.Container, cleanUp func() error) *InitContainerResult
Click to show internal directories.
Click to hide internal directories.