integrationtests

package
v0.0.0-...-8340aad Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ITest = struct {
	TestEnvironment       *envtest.Environment
	Context               context.Context //nolint: containedctx // we DO want the context shared across all integration tests...
	Cancel                context.CancelFunc
	Client                client.Client
	ClientFactory         TestClientFactory
	Storage               *ITestStorage
	OperatorConfiguration *config.OperatorConfiguration
	Registry              *prometheus.Registry
}{}

Functions

func ExpectStatusConditionMetric

func ExpectStatusConditionMetric(g prometheus.Gatherer, expectedMetrics []*StatusConditionValue)

ExpectStatusConditionMetric ensure provided Gatherer has a necessary metrics in redhat_appstudio_remotesecret_status_condition

Types

type ITestStorage

type ITestStorage struct {
	// contains filtered or unexported fields
}

ITestStorage implements RemoteSecretStorage and uses MemoryStorage as a backend. Provides additional methods to reset backed storage after each test.

func (*ITestStorage) Delete

func (i *ITestStorage) Delete(ctx context.Context, id *api.RemoteSecret) error

func (*ITestStorage) Examine

func (i *ITestStorage) Examine(ctx context.Context) error

func (*ITestStorage) Get

func (*ITestStorage) Initialize

func (i *ITestStorage) Initialize(ctx context.Context) error

func (*ITestStorage) Len

func (i *ITestStorage) Len() int

Len return the number of records in the backend storage

func (*ITestStorage) PartialUpdate

func (i *ITestStorage) PartialUpdate(ctx context.Context, id *api.RemoteSecret, dataUpdates *remotesecretstorage.SecretData, deleteKeys []string) error

func (*ITestStorage) Reset

func (i *ITestStorage) Reset()

Reset backend storage to the initial state

func (*ITestStorage) SecretStorage

func (i *ITestStorage) SecretStorage() secretstorage.SecretStorage

SecretStorage returns backend storage

func (*ITestStorage) Store

type StatusConditionValue

type StatusConditionValue struct {
	Condition string
	Name      string
	Namespace string
	Status    string
	Value     int
}

type TestClientFactory

type TestClientFactory struct {
	GetClientImpl             func(ctx context.Context, currentNamespace string, targetSpec *v1beta1.RemoteSecretTarget, targetStatus *v1beta1.TargetStatus) (client.Client, error)
	ServiceAccountChangedImpl func(client.ObjectKey)
}

func (*TestClientFactory) GetClient

func (tcf *TestClientFactory) GetClient(ctx context.Context, currentNamespace string, targetSpec *v1beta1.RemoteSecretTarget, targetStatus *v1beta1.TargetStatus) (client.Client, error)

GetClient implements bindings.ClientFactory

func (*TestClientFactory) ServiceAccountChanged

func (tcf *TestClientFactory) ServiceAccountChanged(sa types.NamespacedName)

ServiceAccountChanged implements bindings.ClientFactory

Jump to

Keyboard shortcuts

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