framework

package
v1.24.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Failf

func Failf(format string, args ...interface{})

Failf fails the test with the given message.

func FailfWithOffset

func FailfWithOffset(offset int, format string, args ...interface{})

FailfWithOffset fails the test with the given message.

The offset argument is used to modify the call-stack offset when computing line numbers. This is useful in helper functions that make assertions so that error messages refer to the calling line in the test, as opposed to the line in the helper function.

e.g. "It(...) -> f -> FailfWithOffset(1, ...)" will be logged for "It"

func Logf

func Logf(format string, args ...interface{})

Logf logs the given message.

func RandomSuffix

func RandomSuffix() string

RandomSuffix provides a random sequence that can be appended to API objects' names.

func WaitForDefaultServiceAccountInNamespace

func WaitForDefaultServiceAccountInNamespace(c clientset.Interface, namespace string) error

WaitForDefaultServiceAccountInNamespace waits for the default ServiceAccount to be provisioned in the given namespace.

Types

type Framework

type Framework struct {
	UniqueName string // e.g. "e2e-mytest-1234"

	KubeClient    clientset.Interface
	DynamicClient dynamic.Interface
	// contains filtered or unexported fields
}

Framework wraps the context and common operations for tests.

func New

func New(baseName string) *Framework

New creates a test Framework.

func (*Framework) AddNamespacesToDelete

func (f *Framework) AddNamespacesToDelete(namespaces ...*corev1.Namespace)

AddNamespacesToDelete marks one or more namespaces for deletion when the test completes.

func (*Framework) AfterEach

func (f *Framework) AfterEach()

AfterEach performs common cleanup tasks.

func (*Framework) BeforeEach

func (f *Framework) BeforeEach()

BeforeEach performs common initialization tasks.

func (*Framework) ClientConfig

func (f *Framework) ClientConfig() *rest.Config

ClientConfig returns a copy of the Framework's rest.Config. Can be used to generate new API clients.

func (*Framework) CreateNamespace

func (f *Framework) CreateNamespace(baseName string, l ...labels.Set) (*corev1.Namespace, error)

CreateNamespace creates a namespace and marks it for automatic cleanup at the end of the test.

type TestConfig

type TestConfig struct {
	// Path to a Kubeconfig file containing credentials to interact with Kubernetes.
	Kubeconfig string
}

TestConfig contains the configuration of a test context.

var Config TestConfig

Config holds the global configuration of the current test context.

Directories

Path Synopsis
Package apps contains helpers to interact with various Kubernetes workloads.
Package apps contains helpers to interact with various Kubernetes workloads.
aws
Package aws contains helpers to interact with AWS services.
Package aws contains helpers to interact with AWS services.
codecommit
Package codecommit contains helpers for AWS CodeCommit.
Package codecommit contains helpers for AWS CodeCommit.
cognitouserpool
Package cognitouser contains helpers for AWS Cognito User Pools.
Package cognitouser contains helpers for AWS Cognito User Pools.
dynamodb
Package dynamodb contains helpers for AWS DynamoDB.
Package dynamodb contains helpers for AWS DynamoDB.
eventbridge
Package eventbridge contains helpers for AWS EventBridge.
Package eventbridge contains helpers for AWS EventBridge.
kinesis
Package kinesis contains helpers for AWS Kinesis.
Package kinesis contains helpers for AWS Kinesis.
s3
Package s3 contains helpers for AWS S3.
Package s3 contains helpers for AWS S3.
sns
Package sns contains helpers for AWS SNS.
Package sns contains helpers for AWS SNS.
sqs
Package sqs contains helpers for AWS SQS.
Package sqs contains helpers for AWS SQS.
Package bridges contains helpers to interact with Bridge objects.
Package bridges contains helpers to interact with Bridge objects.
Package cloudevents contains helpers to interact with CloudEvents.
Package cloudevents contains helpers to interact with CloudEvents.
Package ducktypes contains helpers to interact with Knative duck-typed objects.
Package ducktypes contains helpers to interact with Knative duck-typed objects.
Package gcloud contains helpers to interact with Google Cloud services.
Package gcloud contains helpers to interact with Google Cloud services.
pubsub
Package pubsub contains helpers for Google Cloud Pub/Sub.
Package pubsub contains helpers for Google Cloud Pub/Sub.
repositories
Package repositories contains helpers for Google Cloud Repositories.
Package repositories contains helpers for Google Cloud Repositories.
storage
Package storage contains helpers for Google Cloud Storage.
Package storage contains helpers for Google Cloud Storage.
Package http contains helpers related to HTTP protocol
Package http contains helpers related to HTTP protocol

Jump to

Keyboard shortcuts

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