Documentation ¶
Overview ¶
Package test holds the project's end-to-end tests (e2e).
Index ¶
- Variables
- func AddToInformer(t *testing.T, store cache.Store) func(ktesting.Action) (bool, runtime.Object, error)
- func CollectPodLogs(ctx context.Context, c *clients, podName, namespace string, ...)
- func CreateImage(ref string, objs ...runtime.Object) (string, error)
- func CreateImageWithAnnotations(ref string, mapper ObjectAnnotationMapper, objs ...runtime.Object) (string, error)
- func PrependResourceVersionReactor(f *ktesting.Fake)
- func SeedTestData(t *testing.T, ctx context.Context, d Data) (Clients, Informers)
- func WaitForDeploymentState(ctx context.Context, c *clients, name string, namespace string, ...) error
- func WaitForPipelineRunState(ctx context.Context, c *clients, name string, polltimeout time.Duration, ...) error
- func WaitForPodState(ctx context.Context, c *clients, name string, namespace string, ...) error
- func WaitForRunState(ctx context.Context, c *clients, name string, polltimeout time.Duration, ...) error
- func WaitForServiceExternalIPState(ctx context.Context, c *clients, namespace, name string, ...) error
- func WaitForTaskRunState(ctx context.Context, c *clients, name string, inState ConditionAccessorFn, ...) error
- type Assets
- type Clients
- type ConditionAccessorFn
- func Chain(fns ...ConditionAccessorFn) ConditionAccessorFn
- func Failed(name string) ConditionAccessorFn
- func FailedWithMessage(message, name string) ConditionAccessorFn
- func FailedWithReason(reason, name string) ConditionAccessorFn
- func PipelineRunFailed(name string) ConditionAccessorFn
- func PipelineRunPending(name string) ConditionAccessorFn
- func PipelineRunSucceed(name string) ConditionAccessorFn
- func Running(name string) ConditionAccessorFn
- func Succeed(name string) ConditionAccessorFn
- func TaskRunFailed(name string) ConditionAccessorFn
- func TaskRunSucceed(name string) ConditionAccessorFn
- type Data
- type Informers
- type ObjectAnnotationMapper
- type ResourceVersionReactor
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultObjectAnnotationMapper does the "right" thing by conforming to the Tekton Bundle spec. DefaultObjectAnnotationMapper = func(obj runtime.Object) map[string]string { return map[string]string{ tkremote.TitleAnnotation: getObjectName(obj), tkremote.KindAnnotation: strings.TrimSuffix(strings.ToLower(obj.GetObjectKind().GroupVersionKind().Kind), "s"), tkremote.APIVersionAnnotation: obj.GetObjectKind().GroupVersionKind().Version, } } )
Functions ¶
func AddToInformer ¶
func CollectPodLogs ¶
func CollectPodLogs(ctx context.Context, c *clients, podName, namespace string, logf logging.FormatLogger)
CollectPodLogs will get the logs for all containers in a Pod
func CreateImage ¶
CreateImage will push a new OCI image artifact with the provided raw data object as a layer and return the full image reference with a digest to fetch the image. Key must be specified as [lowercase kind]/[object name]. The image ref with a digest is returned.
func CreateImageWithAnnotations ¶
func CreateImageWithAnnotations(ref string, mapper ObjectAnnotationMapper, objs ...runtime.Object) (string, error)
CreateImageWithAnnotations is the base form of #CreateImage which accepts an ObjectAnnotationMapper to map an object to the annotations for it.
func PrependResourceVersionReactor ¶
PrependResourceVersionReactor will instrument a client-go testing Fake with a reactor that simulates resourceVersion changes on mutations. This does not work with patches.
func SeedTestData ¶
SeedTestData returns Clients and Informers populated with the given Data. nolint: revive
func WaitForDeploymentState ¶
func WaitForDeploymentState(ctx context.Context, c *clients, name string, namespace string, inState func(d *appsv1.Deployment) (bool, error), desc string) error
WaitForDeploymentState polls the status of the Deployment 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 WaitForPipelineRunState ¶
func WaitForPipelineRunState(ctx context.Context, c *clients, name string, polltimeout time.Duration, inState ConditionAccessorFn, 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(ctx context.Context, 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 WaitForRunState ¶
func WaitForRunState(ctx context.Context, c *clients, name string, polltimeout time.Duration, inState ConditionAccessorFn, desc string) error
WaitForRunState polls the status of the Run 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(ctx context.Context, 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(ctx context.Context, c *clients, name string, inState ConditionAccessorFn, 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 Assets ¶
type Assets struct { Logger *zap.SugaredLogger Controller *controller.Impl Clients Clients Informers Informers Recorder *record.FakeRecorder Ctx context.Context }
Assets holds references to the controller, logs, clients, and informers.
type Clients ¶
type Clients struct { Pipeline *fakepipelineclientset.Clientset Resource *fakeresourceclientset.Clientset Kube *fakekubeclientset.Clientset CloudEvents cloudeventclient.CEClient }
Clients holds references to clients which are useful for reconciler tests.
type ConditionAccessorFn ¶
type ConditionAccessorFn func(ca apis.ConditionAccessor) (bool, error)
ConditionAccessorFn is a condition function used polling functions
func Chain ¶
func Chain(fns ...ConditionAccessorFn) ConditionAccessorFn
Chain allows multiple ConditionAccessorFns to be chained together, checking the condition of each in order.
func Failed ¶
func Failed(name string) ConditionAccessorFn
Failed provides a poll condition function that checks if the ConditionAccessor resource has failed or not.
func FailedWithMessage ¶
func FailedWithMessage(message, name string) ConditionAccessorFn
FailedWithMessage provides a poll function that checks if the ConditionAccessor resource has failed with the TimeoudOut reason
func FailedWithReason ¶
func FailedWithReason(reason, name string) ConditionAccessorFn
FailedWithReason provides a poll function that checks if the ConditionAccessor resource has failed with the TimeoudOut reason
func PipelineRunFailed ¶
func PipelineRunFailed(name string) ConditionAccessorFn
PipelineRunFailed provides a poll condition function that checks if the PipelineRun has failed.
func PipelineRunPending ¶
func PipelineRunPending(name string) ConditionAccessorFn
PipelineRunPending provides a poll condition function that checks if the PipelineRun has been marked pending by the Tekton controller.
func PipelineRunSucceed ¶
func PipelineRunSucceed(name string) ConditionAccessorFn
PipelineRunSucceed provides a poll condition function that checks if the PipelineRun has successfully completed.
func Running ¶
func Running(name string) ConditionAccessorFn
Running provides a poll condition function that checks if the ConditionAccessor resource is currently running.
func Succeed ¶
func Succeed(name string) ConditionAccessorFn
Succeed provides a poll condition function that checks if the ConditionAccessor resource has successfully completed or not.
func TaskRunFailed ¶
func TaskRunFailed(name string) ConditionAccessorFn
TaskRunFailed provides a poll condition function that checks if the TaskRun has failed.
func TaskRunSucceed ¶
func TaskRunSucceed(name string) ConditionAccessorFn
TaskRunSucceed provides a poll condition function that checks if the TaskRun has successfully completed.
type Data ¶
type Data struct { PipelineRuns []*v1beta1.PipelineRun Pipelines []*v1beta1.Pipeline TaskRuns []*v1beta1.TaskRun Tasks []*v1beta1.Task ClusterTasks []*v1beta1.ClusterTask PipelineResources []*v1alpha1.PipelineResource Conditions []*v1alpha1.Condition Runs []*v1alpha1.Run Pods []*corev1.Pod Namespaces []*corev1.Namespace ConfigMaps []*corev1.ConfigMap ServiceAccounts []*corev1.ServiceAccount LimitRange []*corev1.LimitRange }
Data represents the desired state of the system (i.e. existing resources) to seed controllers with.
type Informers ¶
type Informers struct { PipelineRun informersv1beta1.PipelineRunInformer Pipeline informersv1beta1.PipelineInformer TaskRun informersv1beta1.TaskRunInformer Run informersv1alpha1.RunInformer Task informersv1beta1.TaskInformer ClusterTask informersv1beta1.ClusterTaskInformer PipelineResource resourceinformersv1alpha1.PipelineResourceInformer Condition informersv1alpha1.ConditionInformer Pod coreinformers.PodInformer ConfigMap coreinformers.ConfigMapInformer ServiceAccount coreinformers.ServiceAccountInformer LimitRange coreinformers.LimitRangeInformer }
Informers holds references to informers which are useful for reconciler tests.
type ObjectAnnotationMapper ¶
ObjectAnnotationMapper is a func alias that maps a runtime Object to the Tekton Bundle annotations map.
type ResourceVersionReactor ¶
type ResourceVersionReactor struct {
// contains filtered or unexported fields
}
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package test holds the project's end-to-end tests (e2e).
|
Package test holds the project's end-to-end tests (e2e). |