e2e

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

README

End to end tests

Adding end to end tests

Knative Eventing e2e tests test the end to end functionality of the Knative Eventing API to verify the behavior of this specific implementation.

Requirements

The e2e tests are used to test whether the flow of Knative Eventing is performing as designed from start to finish.

The e2e tests MUST:

  1. Provide frequent output describing what actions they are undertaking, especially before performing long running operations.
  2. Follow Golang best practices.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateChannel

func CreateChannel(clients *test.Clients, channel *v1alpha1.Channel, logger *logging.BaseLogger, cleaner *test.Cleaner) error

CreateChannel will create a Channel

func CreateClusterRoleBinding

func CreateClusterRoleBinding(clients *test.Clients, crb *rbacV1beta1.ClusterRoleBinding, logger *logging.BaseLogger, cleaner *test.Cleaner) error

CreateClusterRoleBinding will create a service account binding

func CreateKubernetesEventSource

func CreateKubernetesEventSource(clients *test.Clients, source *sourcesv1alpha1.KubernetesEventSource, logger *logging.BaseLogger, cleaner *test.Cleaner) error

CreateKubernetesEventSource creates a KubernetesEventSource

func CreatePod

func CreatePod(clients *test.Clients, pod *corev1.Pod, logger *logging.BaseLogger, cleaner *test.Cleaner) error

CreatePod will create a Pod

func CreateRouteAndConfig

func CreateRouteAndConfig(clients *test.Clients, logger *logging.BaseLogger, cleaner *test.Cleaner, name string, imagePath string) error

CreateRouteAndConfig will create Route and Config objects using clients. The Config object will serve requests to a container started from the image at imagePath.

func CreateServiceAccount

func CreateServiceAccount(clients *test.Clients, sa *corev1.ServiceAccount, logger *logging.BaseLogger, cleaner *test.Cleaner) error

CreateServiceAccount will create a service account

func CreateServiceAccountAndBinding

func CreateServiceAccountAndBinding(clients *test.Clients, name string, logger *logging.BaseLogger, cleaner *test.Cleaner) error

CreateServiceAccountAndBinding creates both ServiceAccount and ClusterRoleBinding with default cluster-admin role

func CreateSubscription

func CreateSubscription(clients *test.Clients, subs *v1alpha1.Subscription, logger *logging.BaseLogger, cleaner *test.Cleaner) error

CreateSubscription will create a Subscription

func ImagePath

func ImagePath(name string) string

ImagePath is a helper function to prefix image name with repo and suffix with tag

func PodLogs

func PodLogs(clients *test.Clients, podName string, containerName string, logger *logging.BaseLogger) ([]byte, error)

PodLogs returns Pod logs for given Pod and Container

func Setup

func Setup(t *testing.T, logger *logging.BaseLogger) (*test.Clients, *test.Cleaner)

Setup creates the client objects needed in the e2e tests.

func TearDown

func TearDown(clients *test.Clients, cleaner *test.Cleaner, logger *logging.BaseLogger)

TearDown will delete created names using clients.

func WaitForAllPodsRunning

func WaitForAllPodsRunning(clients *test.Clients, logger *logging.BaseLogger, namespace string) error

WaitForAllPodsRunning will wait until all pods in the given namespace are running

func WaitForLogContent

func WaitForLogContent(clients *test.Clients, logger *logging.BaseLogger, podName string, containerName string, content string) error

WaitForLogContent waits until logs for given Pod/Container include the given content. If the content is not present within timeout it returns error.

func WithRouteReady

func WithRouteReady(clients *test.Clients, logger *logging.BaseLogger, cleaner *test.Cleaner, name string, imagePath string) error

WithRouteReady will create Route and Config objects and wait until they're ready.

Types

This section is empty.

Jump to

Keyboard shortcuts

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