testutils

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const MainOrgName = "Main Org."

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeEvent added in v1.2.0

type FakeEvent struct {
	Annotations map[string]string
	Eventtype   string
	Reason      string
	Message     string
}

type FakeEventRecorder added in v1.2.0

type FakeEventRecorder struct {
	Events []FakeEvent
}

func (*FakeEventRecorder) AnnotatedEventf added in v1.2.0

func (r *FakeEventRecorder) AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{})

func (*FakeEventRecorder) Event added in v1.2.0

func (r *FakeEventRecorder) Event(object runtime.Object, eventtype, reason, message string)

func (*FakeEventRecorder) Eventf added in v1.2.0

func (r *FakeEventRecorder) Eventf(object runtime.Object, eventtype, reason, messageFmt string, args ...interface{})

type TestUtils

type TestUtils struct {
	URL           string
	User          string
	Password      string
	GrafanaClient *grafanaclient.GrafanaHTTPAPI

	Namespace                string
	GrafanaInstanceName      v1beta1.ObjectNamespacedName
	ClientID                 string
	SecretName               string
	EnvSecretName            string
	GrafanaOrgName           v1beta1.ObjectName
	OrgName                  string
	GrafanaOrgDatasourceName v1beta1.ObjectName
	GrafanaOrgDashboardName  v1beta1.ObjectName
	// contains filtered or unexported fields
}

func NewTestUtilsFromEnvironment

func NewTestUtilsFromEnvironment(k8sClient client.Client) TestUtils

func (*TestUtils) Cleanup

func (t *TestUtils) Cleanup(ctx context.Context)

func (*TestUtils) CreateGrafanaInstanceAndSecret

func (t *TestUtils) CreateGrafanaInstanceAndSecret(ctx context.Context)

func (*TestUtils) CreateGrafanaOrg

func (t *TestUtils) CreateGrafanaOrg(ctx context.Context) *v1beta1.GrafanaOrg

func (*TestUtils) CreateGrafanaOrgDashboard added in v1.2.0

func (t *TestUtils) CreateGrafanaOrgDashboard(ctx context.Context) *v1beta1.GrafanaOrgDashboard

func (*TestUtils) CreateGrafanaOrgDatasource

func (t *TestUtils) CreateGrafanaOrgDatasource(ctx context.Context) *v1beta1.GrafanaOrgDatasource

func (*TestUtils) CreateOrg

func (t *TestUtils) CreateOrg() int64

CreateOrg Create Org

func (*TestUtils) DeleteGrafanaInstanceAndSecret

func (t *TestUtils) DeleteGrafanaInstanceAndSecret(ctx context.Context)

func (*TestUtils) DeleteGrafanaOrg

func (t *TestUtils) DeleteGrafanaOrg(ctx context.Context)

func (*TestUtils) DeleteGrafanaOrgDashboard added in v1.2.0

func (t *TestUtils) DeleteGrafanaOrgDashboard(ctx context.Context)

func (*TestUtils) DeleteGrafanaOrgDatasource

func (t *TestUtils) DeleteGrafanaOrgDatasource(ctx context.Context)

func (*TestUtils) DeleteOrg

func (t *TestUtils) DeleteOrg()

func (*TestUtils) ExpectOrgs

func (t *TestUtils) ExpectOrgs(expectedOrgs []string)

func (*TestUtils) GetOrg

func (t *TestUtils) GetOrg() *models.OrgDetailsDTO

func (*TestUtils) SetGrafanaOrgReconciled

func (t *TestUtils) SetGrafanaOrgReconciled(ctx context.Context, grafanaOrg *v1beta1.GrafanaOrg, orgID int64)

Jump to

Keyboard shortcuts

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