e2e

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectPodLogs

func CollectPodLogs(c *Clients, podName, namespace string, logf logging.FormatLogger)

CollectPodLogs will get the logs for all containers in a Pod

func CreateNamespace

func CreateNamespace(namespace string, kubeClient *knativetest.KubeClient)

func CreateServiceAccountSecret

func CreateServiceAccountSecret(c *knativetest.KubeClient, namespace string, secretName string) (bool, error)

Create Service Account

func DeleteNamespace

func DeleteNamespace(namespace string, cs *Clients)

func Details

func Details(pre v1alpha1.PipelineResource) string

func GetPipeline

func GetPipeline(c *Clients, name string) *v1alpha1.Pipeline

func GetPipelineDescribeOutput

func GetPipelineDescribeOutput(t *testing.T, cs *Clients, pname string, td map[int]interface{}) string

func GetPipelineList

func GetPipelineList(c *Clients) *v1alpha1.PipelineList

func GetPipelineListWithTestData

func GetPipelineListWithTestData(t *testing.T, c *Clients, td map[int]interface{}) *v1alpha1.PipelineList

func GetPipelineResource

func GetPipelineResource(c *Clients, name string) *v1alpha1.PipelineResource

func GetPipelineResourceList

func GetPipelineResourceList(c *Clients) *v1alpha1.PipelineResourceList

func GetPipelineRun

func GetPipelineRun(c *Clients, name string) *v1alpha1.PipelineRun

func GetPipelineRunList

func GetPipelineRunList(c *Clients) *v1alpha1.PipelineRunList

func GetPipelineRunListWithName

func GetPipelineRunListWithName(c *Clients, pname string) *v1alpha1.PipelineRunList

func GetPipelineRunListWithNameAndTestData

func GetPipelineRunListWithNameAndTestData(t *testing.T, c *Clients, pname string, td map[int]interface{}) *v1alpha1.PipelineRunList

func GetPipelineWithTestData

func GetPipelineWithTestData(t *testing.T, c *Clients, name string, td map[int]interface{}) *v1alpha1.Pipeline

func GetTask

func GetTask(c *Clients, name string) *v1alpha1.Task

func GetTaskList

func GetTaskList(c *Clients) *v1alpha1.TaskList

func GetTaskListWithTestData

func GetTaskListWithTestData(t *testing.T, c *Clients, td map[int]interface{}) *v1alpha1.TaskList

func GetTaskRun

func GetTaskRun(c *Clients, name string) *v1alpha1.TaskRun

func GetTaskRunList

func GetTaskRunList(c *Clients) *v1alpha1.TaskRunList

func GetTaskRunListWithTestData

func GetTaskRunListWithTestData(t *testing.T, c *Clients, td map[int]interface{}) *v1alpha1.TaskRunList
func Header(logf logging.FormatLogger, text string)

func ListAllPipelinesOutput

func ListAllPipelinesOutput(t *testing.T, cs *Clients, td map[int]interface{}) string

func ListAllTaskRunsOutput

func ListAllTaskRunsOutput(t *testing.T, cs *Clients, allnamespaces bool, td map[int]interface{}) string

func ListAllTasksOutput

func ListAllTasksOutput(t *testing.T, cs *Clients, td map[int]interface{}) string

func ListResourceNamesForJSONPath

func ListResourceNamesForJSONPath(obj interface{}) string

func PipelineRunHasFailed

func PipelineRunHasFailed(pr *v1alpha1.PipelineRun) string

func PodStatus

func PodStatus(respond chan<- string, watch watch.Interface)

func Process

func Process(t *template.Template, vars interface{}) string

func ProcessString

func ProcessString(str string, vars interface{}) string

func RunInteractiveTests

func RunInteractiveTests(t *testing.T, namespace, path string, ops *Prompt) *expect.Console

RunInteractiveTests Helps to Run Interactive Tests

func SortByStartTime

func SortByStartTime(trs []v1alpha1.TaskRun)

func SortResourcesByTypeAndName

func SortResourcesByTypeAndName(pres []v1alpha1.PipelineDeclaredResource) []v1alpha1.PipelineDeclaredResource

this will sort the Resource by Type and then by Name

func TaskRunHasFailed

func TaskRunHasFailed(tr *v1alpha1.TaskRun) string

func TearDown

func TearDown(t *testing.T, cs *Clients, namespace string)

func VerifyServiceAccountExistence

func VerifyServiceAccountExistence(namespace string, kubeClient *knativetest.KubeClient)

func VerifyServiceAccountExistenceForSecrets

func VerifyServiceAccountExistenceForSecrets(namespace string, kubeClient *knativetest.KubeClient, sa string)

func WaitForPipelineRunState

func WaitForPipelineRunState(c *Clients, name string, polltimeout time.Duration, inState PipelineRunStateFn, desc string) error

WaitForPipelineRunState polls the status of the PipelineRun called name from client every interval until inState returns `true` indicating it is done, returns an error or timeout. desc will be used to name the metric that is emitted to track how long it took for name to get into the state checked by inState.

func WaitForPipelineRunToComplete

func WaitForPipelineRunToComplete(c *Clients, prname string, namespace string)

WaitForPipelineRunToComplete Wait for Pipeline Run to complete

func WaitForPipelineRunToStart

func WaitForPipelineRunToStart(c *Clients, prname string, namespace string)

WaitForPipelineRunToStart Waits for PipelineRun to be started

func WaitForPodState

func WaitForPodState(c *Clients, name string, namespace string, inState func(r *corev1.Pod) (bool, error), desc string) error

WaitForPodState polls the status of the Pod called name from client every interval until inState returns `true` indicating it is done, returns an error or timeout. desc will be used to name the metric that is emitted to track how long it took for name to get into the state checked by inState.

func WaitForPodStateKube

func WaitForPodStateKube(c *knativetest.KubeClient, namespace string, inState PodRunStateFn, desc string) error

func WaitForPodStatus

func WaitForPodStatus(kubeClient *knativetest.KubeClient, namespace string)

func WaitForServiceExternalIPState

func WaitForServiceExternalIPState(c *Clients, namespace, name string, inState func(s *corev1.Service) (bool, error), desc string) error

WaitForServiceExternalIPState polls the status of the a k8s Service called name from client every interval until an external ip is assigned indicating it is done, returns an error or timeout. desc will be used to name the metric that is emitted to track how long it took for name to get into the state checked by inState.

func WaitForTaskRunState

func WaitForTaskRunState(c *Clients, name string, inState TaskRunStateFn, desc string) error

func WaitForTaskRunToBeStarted

func WaitForTaskRunToBeStarted(c *Clients, trname string, namespace string)

WaitForTaskRunToBeStarted Wait For Task Run Resource to be completed

func WaitForTaskRunToComplete

func WaitForTaskRunToComplete(c *Clients, trname string, namespace string)

WaitForTaskRunToComplete Wait For Task Run Resource to be completed

Types

type CapturingPassThroughWriter

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

func NewCapturingPassThroughWriter

func NewCapturingPassThroughWriter(w io.Writer) *CapturingPassThroughWriter

NewCapturingPassThroughWriter creates new CapturingPassThroughWriter

func (*CapturingPassThroughWriter) Bytes

func (w *CapturingPassThroughWriter) Bytes() []byte

Bytes returns bytes written to the writer

func (*CapturingPassThroughWriter) Write

func (w *CapturingPassThroughWriter) Write(d []byte) (int, error)

type Clients

type Clients struct {
	KubeClient *knativetest.KubeClient

	PipelineClient         v1alpha1.PipelineInterface
	TaskClient             v1alpha1.TaskInterface
	TaskRunClient          v1alpha1.TaskRunInterface
	PipelineRunClient      v1alpha1.PipelineRunInterface
	PipelineResourceClient resourcev1alpha1.PipelineResourceInterface
	ConditionClient        v1alpha1.ConditionInterface
}

clients holds instances of interfaces for making requests to the Pipeline controllers.

func NewClients

func NewClients(configPath, clusterName, namespace string) *Clients

newClients instantiates and returns several clientsets required for making requests to the Pipeline cluster specified by the combination of clusterName and configPath. Clients can make requests within namespace.

func Setup

func Setup(t *testing.T) (*Clients, string)

type PipelineDescribeData

type PipelineDescribeData struct {
	Name      string
	Resources map[string]string
	Task      map[int]interface{}
	Runs      map[string]string
}

type PipelineRunStateFn

type PipelineRunStateFn func(pr *v1alpha1.PipelineRun) (bool, error)

PipelineRunStateFn is a condition function on TaskRun used polling functions

func PipelineRunFailed

func PipelineRunFailed(name string) PipelineRunStateFn

PipelineRunFailed provides a poll condition function that checks if the PipelineRun has failed.

func PipelineRunSucceed

func PipelineRunSucceed(name string) PipelineRunStateFn

PipelineRunSucceed provides a poll condition function that checks if the PipelineRun has successfully completed.

type PipelinesListData

type PipelinesListData struct {
	Name   string
	Status string
}

type PodRunStateFn

type PodRunStateFn func(r *corev1.Pod) (bool, error)

func PodRunSucceed

func PodRunSucceed(name string) PodRunStateFn

type Prompt

type Prompt struct {
	CmdArgs   []string
	Procedure func(*goexpect.Console) error
}

Prompt provides test utility for prompt test.

type TaskData

type TaskData struct {
	Name string
}

type TaskRefData

type TaskRefData struct {
	TaskName string
	TaskRef  string
	RunAfter []string
}

type TaskRunData

type TaskRunData struct {
	Name   string
	Status string
}

type TaskRunStateFn

type TaskRunStateFn func(r *v1alpha1.TaskRun) (bool, error)

TaskRunStateFn is a condition function on TaskRun used polling functions

func TaskRunFailed

func TaskRunFailed(name string) TaskRunStateFn

TaskRunFailed provides a poll condition function that checks if the TaskRun has failed.

func TaskRunSucceed

func TaskRunSucceed(name string) TaskRunStateFn

TaskRunSucceed provides a poll condition function that checks if the TaskRun has successfully completed.

type TaskStateFn

type TaskStateFn func(r *v1alpha1.Task) (bool, error)

type TaskrunList

type TaskrunList []tkr

func (TaskrunList) Len

func (s TaskrunList) Len() int

func (TaskrunList) Less

func (s TaskrunList) Less(i, j int) bool

func (TaskrunList) Swap

func (s TaskrunList) Swap(i, j int)

type Test

type Test struct {
	Cmd      string
	Expected map[int]interface{}
}

func NewTestData

func NewTestData(cmd string, expected map[int]interface{}) *Test

Jump to

Keyboard shortcuts

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