Documentation ¶
Index ¶
- func AppendRandomString(prefix string) string
- func CollectBuildLogs(c *clients, buildName, namespace string, logger *logging.BaseLogger)
- func GetLogMessages(logs *observer.ObservedLogs) []string
- func WaitForPipelineRunState(c *clients, name string, inState func(r *v1alpha1.PipelineRun) (bool, error), ...) error
- func WaitForPodState(c *clients, name string, namespace string, ...) error
- func WaitForServiceExternalIPState(c *clients, namespace, name string, ...) error
- func WaitForTaskRunState(c *clients, name string, inState func(r *v1alpha1.TaskRun) (bool, error), ...) error
- type Clients
- type Data
- type Informers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendRandomString ¶
AppendRandomString will generate a random string that begins with prefix. This is useful if you want to make sure that your tests can run at the same time against the same environment without conflicting. This method will seed rand with the current time when called for the first time.
func CollectBuildLogs ¶
func CollectBuildLogs(c *clients, buildName, namespace string, logger *logging.BaseLogger)
CollectBuildLogs will get the build logs for a task run
func GetLogMessages ¶
func GetLogMessages(logs *observer.ObservedLogs) []string
GetLogMessages returns a list of all string logs in logs.
func WaitForPipelineRunState ¶
func WaitForPipelineRunState(c *clients, name string, inState func(r *v1alpha1.PipelineRun) (bool, error), 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 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 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 func(r *v1alpha1.TaskRun) (bool, error), desc string) error
WaitForTaskRunState polls the status of the TaskRun 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.
Types ¶
type Clients ¶
type Clients struct { Pipeline *fakepipelineclientset.Clientset Build *fakebuildclientset.Clientset Kube *fakekubeclientset.Clientset }
Clients holds references to clients which are useful for reconciler tests.
func GetPipelineRunController ¶
func GetPipelineRunController(d Data) (*controller.Impl, *observer.ObservedLogs, Clients)
GetPipelineRunController returns an instance of the PipelineRun controller/reconciler that has been seeded with d, where d represents the state of the system (existing resources) needed for the test.
func GetTaskRunController ¶
func GetTaskRunController(d Data) (*controller.Impl, *observer.ObservedLogs, Clients)
GetTaskRunController returns an instance of the TaskRun controller/reconciler that has been seeded with d, where d represents the state of the system (existing resources) needed for the test.
type Data ¶
type Data struct { PipelineRuns []*v1alpha1.PipelineRun Pipelines []*v1alpha1.Pipeline TaskRuns []*v1alpha1.TaskRun Tasks []*v1alpha1.Task PipelineParams []*v1alpha1.PipelineParams PipelineResources []*v1alpha1.PipelineResource Builds []*buildv1alpha1.Build }
Data represents the desired state of the system (i.e. existing resources) to seed controllers with.
type Informers ¶
type Informers struct { PipelineRun informersv1alpha1.PipelineRunInformer Pipeline informersv1alpha1.PipelineInformer TaskRun informersv1alpha1.TaskRunInformer Task informersv1alpha1.TaskInformer PipelineParams informersv1alpha1.PipelineParamsInformer PipelineResource informersv1alpha1.PipelineResourceInformer Build buildinformersv1alpha1.BuildInformer }
Informers holds references to informers which are useful for reconciler tests.