testing

package
v0.27.13 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateList

func CreateList(prefix string, helper storage.Interface, list runtime.Object) error

CreateList will properly create a list using the storage interface.

func CreateObjList

func CreateObjList(prefix string, helper storage.Interface, items []runtime.Object) error

CreateObjList will create a list from the array of objects.

func DeepEqualSafePodSpec added in v0.16.4

func DeepEqualSafePodSpec() example.PodSpec

DeepEqualSafePodSpec returns an example.PodSpec safe for deep-equal operations.

func ExpectContains added in v0.26.0

func ExpectContains(t *testing.T, msg string, expectedList []interface{}, got interface{})

func ExpectNoDiff added in v0.25.0

func ExpectNoDiff(t *testing.T, msg string, expected, got interface{})

func RunOptionalTestProgressNotify added in v0.26.0

func RunOptionalTestProgressNotify(ctx context.Context, t *testing.T, store storage.Interface)

RunOptionalTestProgressNotify tests ProgressNotify feature of ListOptions. Given this feature is currently not explicitly used by higher layers of Kubernetes (it rather is used by wrappers of storage.Interface to implement its functionalities) this test is currently considered optional.

func RunTestConditionalDelete added in v0.25.0

func RunTestConditionalDelete(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestConsistentList added in v0.26.0

func RunTestConsistentList(ctx context.Context, t *testing.T, store InterfaceWithPrefixTransformer)

func RunTestCount added in v0.25.0

func RunTestCount(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestCreate added in v0.25.0

func RunTestCreate(ctx context.Context, t *testing.T, store storage.Interface, validation KeyValidation)

func RunTestCreateWithKeyExist added in v0.25.0

func RunTestCreateWithKeyExist(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestCreateWithTTL added in v0.25.0

func RunTestCreateWithTTL(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestDeleteTriggerWatch added in v0.25.0

func RunTestDeleteTriggerWatch(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestDeleteWithSuggestion added in v0.25.0

func RunTestDeleteWithSuggestion(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestDeleteWithSuggestionAndConflict added in v0.25.0

func RunTestDeleteWithSuggestionAndConflict(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestDeleteWithSuggestionOfDeletedObject added in v0.25.0

func RunTestDeleteWithSuggestionOfDeletedObject(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestGet added in v0.25.0

func RunTestGet(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestGetListNonRecursive added in v0.25.0

func RunTestGetListNonRecursive(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestGuaranteedUpdate added in v0.26.0

func RunTestGuaranteedUpdate(ctx context.Context, t *testing.T, store InterfaceWithPrefixTransformer, validation KeyValidation)

func RunTestGuaranteedUpdateChecksStoredData added in v0.26.0

func RunTestGuaranteedUpdateChecksStoredData(ctx context.Context, t *testing.T, store InterfaceWithPrefixTransformer)

func RunTestGuaranteedUpdateWithConflict added in v0.25.0

func RunTestGuaranteedUpdateWithConflict(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestGuaranteedUpdateWithSuggestionAndConflict added in v0.25.0

func RunTestGuaranteedUpdateWithSuggestionAndConflict(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestGuaranteedUpdateWithTTL added in v0.25.0

func RunTestGuaranteedUpdateWithTTL(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestList added in v0.25.0

func RunTestList(ctx context.Context, t *testing.T, store storage.Interface, ignoreWatchCacheTests bool)

func RunTestListContinuation added in v0.26.0

func RunTestListContinuation(ctx context.Context, t *testing.T, store storage.Interface, validation CallsValidation)

func RunTestListContinuationWithFilter added in v0.26.0

func RunTestListContinuationWithFilter(ctx context.Context, t *testing.T, store storage.Interface, validation CallsValidation)

func RunTestListInconsistentContinuation added in v0.26.0

func RunTestListInconsistentContinuation(ctx context.Context, t *testing.T, store storage.Interface, compaction Compaction)

func RunTestListPaginationRareObject added in v0.26.0

func RunTestListPaginationRareObject(ctx context.Context, t *testing.T, store storage.Interface, validation CallsValidation)

func RunTestListWithoutPaging added in v0.25.0

func RunTestListWithoutPaging(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestPreconditionalDeleteWithSuggestion added in v0.25.0

func RunTestPreconditionalDeleteWithSuggestion(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestTransformationFailure added in v0.26.0

func RunTestTransformationFailure(ctx context.Context, t *testing.T, store InterfaceWithPrefixTransformer)

func RunTestUnconditionalDelete added in v0.25.0

func RunTestUnconditionalDelete(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestValidateDeletionWithSuggestion added in v0.25.0

func RunTestValidateDeletionWithSuggestion(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestWatch added in v0.25.0

func RunTestWatch(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestWatchContextCancel added in v0.25.0

func RunTestWatchContextCancel(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestWatchDeleteEventObjectHaveLatestRV added in v0.26.0

func RunTestWatchDeleteEventObjectHaveLatestRV(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestWatchError added in v0.26.0

func RunTestWatchError(ctx context.Context, t *testing.T, store InterfaceWithPrefixTransformer)

func RunTestWatchFromNoneZero added in v0.25.0

func RunTestWatchFromNoneZero(ctx context.Context, t *testing.T, store storage.Interface)

func RunTestWatchFromZero added in v0.26.0

func RunTestWatchFromZero(ctx context.Context, t *testing.T, store storage.Interface, compaction Compaction)

RunTestWatchFromZero tests that - watch from 0 should sync up and grab the object added before - watch from 0 is able to return events for objects whose previous version has been compacted

func RunTestWatchInitializationSignal added in v0.25.0

func RunTestWatchInitializationSignal(ctx context.Context, t *testing.T, store storage.Interface)

func TestClusterScopedWatch added in v0.27.0

func TestClusterScopedWatch(ctx context.Context, t *testing.T, store storage.Interface)

It tests watches of cluster-scoped resources.

func TestNamespaceScopedWatch added in v0.27.0

func TestNamespaceScopedWatch(ctx context.Context, t *testing.T, store storage.Interface)

It tests watch of namespace-scoped resources.

Types

type CallsValidation added in v0.26.0

type CallsValidation func(t *testing.T, pageSize, estimatedProcessedObjects uint64)

type Compaction added in v0.26.0

type Compaction func(ctx context.Context, t *testing.T, resourceVersion string)

type InterfaceWithPrefixTransformer added in v0.26.0

type InterfaceWithPrefixTransformer interface {
	storage.Interface

	UpdatePrefixTransformer(PrefixTransformerModifier) func()
}

type KeyValidation added in v0.25.0

type KeyValidation func(ctx context.Context, t *testing.T, key string)

type PrefixTransformer added in v0.26.0

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

PrefixTransformer adds and verifies that all data has the correct prefix on its way in and out.

func NewPrefixTransformer added in v0.26.0

func NewPrefixTransformer(prefix []byte, stale bool) *PrefixTransformer

func (*PrefixTransformer) GetReadsAndReset added in v0.26.0

func (p *PrefixTransformer) GetReadsAndReset() uint64

func (*PrefixTransformer) TransformFromStorage added in v0.26.0

func (p *PrefixTransformer) TransformFromStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, bool, error)

func (*PrefixTransformer) TransformToStorage added in v0.26.0

func (p *PrefixTransformer) TransformToStorage(ctx context.Context, data []byte, dataCtx value.Context) ([]byte, error)

type PrefixTransformerModifier added in v0.26.0

type PrefixTransformerModifier func(*PrefixTransformer) value.Transformer

type StorageInjectingListErrors added in v0.27.0

type StorageInjectingListErrors struct {
	storage.Interface

	Errors int
	// contains filtered or unexported fields
}

StorageInjectingListErrors injects a dummy error for first N GetList calls.

func (*StorageInjectingListErrors) ErrorsConsumed added in v0.27.0

func (s *StorageInjectingListErrors) ErrorsConsumed() (bool, error)

func (*StorageInjectingListErrors) GetList added in v0.27.0

Jump to

Keyboard shortcuts

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