testing

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithBundlesResolverEnabled

func ContextWithBundlesResolverEnabled(ctx context.Context) context.Context

ContextWithBundlesResolverEnabled returns a context containing a Config with the enable-bundles-resolver feature flag enabled.

func ContextWithClusterResolverEnabled

func ContextWithClusterResolverEnabled(ctx context.Context) context.Context

ContextWithClusterResolverEnabled returns a context containing a Config with the enable-cluster-resolver feature flag enabled.

func ContextWithGitResolverEnabled

func ContextWithGitResolverEnabled(ctx context.Context) context.Context

ContextWithGitResolverEnabled returns a context containing a Config with the enable-git-resolver feature flag enabled.

func ContextWithHubResolverEnabled

func ContextWithHubResolverEnabled(ctx context.Context) context.Context

ContextWithHubResolverEnabled returns a context containing a Config with the enable-hub-resolver feature flag enabled.

func GetResolverFrameworkController

func GetResolverFrameworkController(ctx context.Context, t *testing.T, d test.Data, resolver framework.Resolver, modifiers ...framework.ReconcilerModifier) (test.Assets, func())

GetResolverFrameworkController returns an instance of the resolver framework controller/reconciler using the given resolver, seeded with d, where d represents the state of the system (existing resources) needed for the test.

func RunResolverReconcileTest

func RunResolverReconcileTest(ctx context.Context, t *testing.T, d test.Data, resolver framework.Resolver, request *v1beta1.ResolutionRequest,
	expectedStatus *v1beta1.ResolutionRequestStatus, expectedErr error, resolverModifiers ...ResolverReconcileTestModifier)

RunResolverReconcileTest takes data to seed clients and informers, a Resolver, a ResolutionRequest, and the expected ResolutionRequestStatus and error, both of which can be nil. It instantiates a controller for that resolver and reconciles the given request. It then checks for the expected error, if any, and compares the resulting status with the expected status.

Types

type ResolverReconcileTestModifier

type ResolverReconcileTestModifier = func(resolver framework.Resolver, testAssets test.Assets)

ResolverReconcileTestModifier is a function thaat will be invoked after the test assets and controller have been created

Jump to

Keyboard shortcuts

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