resourcetest

package
v1.16.109 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseResourcesFromFilesystem

func ParseResourcesFromFilesystem(t T, files fs.FS, path string) []*pbresource.Resource

ParseResourcesFromFilesystem will walk the filesystem at the given path and parse all files as protobuf/JSON resources.

func RequireOwner

func RequireOwner(t T, res *pbresource.Resource, owner *pbresource.ID, ignoreUid bool)

func RequireReconciledCurrentGen

func RequireReconciledCurrentGen(t T, res *pbresource.Resource, statusKey string)

func RequireResourceMeta

func RequireResourceMeta(t T, res *pbresource.Resource, key string, value string)

func RequireStatusCondition

func RequireStatusCondition(t T, res *pbresource.Resource, statusKey string, condition *pbresource.Condition)

func RequireStatusConditionForCurrentGen

func RequireStatusConditionForCurrentGen(t T, res *pbresource.Resource, statusKey string, condition *pbresource.Condition)

func RequireVersionChanged

func RequireVersionChanged(t T, res *pbresource.Resource, version string)

func RequireVersionUnchanged

func RequireVersionUnchanged(t T, res *pbresource.Resource, version string)

func Resource

func Resource(rtype *pbresource.Type, name string) *resourceBuilder

Types

type CleanupT

type CleanupT interface {
	T
	Cleanup(func())
}

type Client

type Client struct {
	pbresource.ResourceServiceClient
	// contains filtered or unexported fields
}

func NewClient

func NewClient(client pbresource.ResourceServiceClient) *Client

func (*Client) PublishResources

func (client *Client) PublishResources(t T, resources []*pbresource.Resource)

func (*Client) RequireReconciledCurrentGen

func (client *Client) RequireReconciledCurrentGen(t T, id *pbresource.ID, statusKey string) *pbresource.Resource

func (*Client) RequireResourceExists

func (client *Client) RequireResourceExists(t T, id *pbresource.ID) *pbresource.Resource

func (*Client) RequireResourceMeta

func (client *Client) RequireResourceMeta(t T, id *pbresource.ID, key string, value string) *pbresource.Resource

func (*Client) RequireResourceNotFound

func (client *Client) RequireResourceNotFound(t T, id *pbresource.ID)

func (*Client) RequireStatusCondition

func (client *Client) RequireStatusCondition(t T, id *pbresource.ID, statusKey string, condition *pbresource.Condition) *pbresource.Resource

func (*Client) RequireStatusConditionForCurrentGen

func (client *Client) RequireStatusConditionForCurrentGen(t T, id *pbresource.ID, statusKey string, condition *pbresource.Condition) *pbresource.Resource

func (*Client) RequireVersionChanged

func (client *Client) RequireVersionChanged(t T, id *pbresource.ID, version string) *pbresource.Resource

func (*Client) RequireVersionUnchanged

func (client *Client) RequireVersionUnchanged(t T, id *pbresource.ID, version string) *pbresource.Resource

func (*Client) ResolveResourceID

func (client *Client) ResolveResourceID(t T, id *pbresource.ID) *pbresource.ID

ResolveResourceID will read the specified resource and returns its full ID. This is mainly useful to get the ID with the Uid filled out.

func (*Client) SetRetryerConfig

func (client *Client) SetRetryerConfig(timeout time.Duration, wait time.Duration)

func (*Client) WaitForNewVersion

func (client *Client) WaitForNewVersion(t T, id *pbresource.ID, version string) *pbresource.Resource

func (*Client) WaitForReconciliation

func (client *Client) WaitForReconciliation(t T, id *pbresource.ID, statusKey string) *pbresource.Resource

func (*Client) WaitForResourceState

func (client *Client) WaitForResourceState(t T, id *pbresource.ID, verify func(T, *pbresource.Resource)) *pbresource.Resource

func (*Client) WaitForStatusCondition

func (client *Client) WaitForStatusCondition(t T, id *pbresource.ID, statusKey string, condition *pbresource.Condition) *pbresource.Resource

type T

type T interface {
	Helper()
	Log(args ...interface{})
	Logf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Fatalf(format string, args ...interface{})
	FailNow()
}

T represents the subset of testing.T methods that will be used by the various functionality in this package

Jump to

Keyboard shortcuts

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