test_tooling

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2025 License: BSD-3-Clause-LBNL Imports: 20 Imported by: 0

Documentation

Index

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

func InterceptStdout() (*os.File, *os.File, context.CancelFunc)

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

type CloudTestOpt func(m *map[string]string)

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 InitTest

func InitTest(t *testing.T, cfgProvider config.Provider, envProp map[string]string) *InitContainerResult

func NewInitContainerResult added in v0.8.0

func NewInitContainerResult(client service.GrafanaService, container testcontainers.Container, cleanUp func() error) *InitContainerResult

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL