Documentation ¶
Index ¶
- Constants
- Variables
- type TestEnvironment
- func (te *TestEnvironment) CompareCloudEvents(expectedEvent cloudevents.Event, gotEvent cloudevents.Event) error
- func (te *TestEnvironment) CreateAllSubscriptions() error
- func (te *TestEnvironment) CreateSinkDeployment(name, namespace, image string) error
- func (te *TestEnvironment) CreateSinkService(name, namespace string) error
- func (te *TestEnvironment) CreateTestNamespace() error
- func (te *TestEnvironment) CreateV1Alpha2Subscriptions(ctx context.Context, subList []eventing.TestSubscriptionInfo) error
- func (te *TestEnvironment) DeleteAllSubscriptions() error
- func (te *TestEnvironment) DeleteDeployment(name, namespace string) error
- func (te *TestEnvironment) DeleteEventingCR() error
- func (te *TestEnvironment) DeleteService(name, namespace string) error
- func (te *TestEnvironment) DeleteSinkResources() error
- func (te *TestEnvironment) DeleteSubscriptionFromK8s(name, namespace string) error
- func (te *TestEnvironment) DeleteTestNamespace() error
- func (te *TestEnvironment) GetDeployment(name, namespace string) (*kappsv1.Deployment, error)
- func (te *TestEnvironment) GetDeploymentFromK8s(name, namespace string) (*kappsv1.Deployment, error)
- func (te *TestEnvironment) GetEventingCRFromK8s(name, namespace string) (*operatorv1alpha1.Eventing, error)
- func (te *TestEnvironment) GetPeerAuthenticationFromK8s(name, namespace string) (*istiopkgsecurityv1beta1.PeerAuthentication, error)
- func (te *TestEnvironment) InitEventPublisherClient() error
- func (te *TestEnvironment) InitSinkClient() error
- func (te *TestEnvironment) IsSubscriptionReconcileByBackend(sub eventingv1alpha2.Subscription, activeBackend string) bool
- func (te *TestEnvironment) SetupEventingCR() error
- func (te *TestEnvironment) SetupSink() error
- func (te *TestEnvironment) TestDeliveryOfCloudEvent(eventSource, eventType string, encoding binding.Encoding, ...) error
- func (te *TestEnvironment) TestDeliveryOfLegacyEvent(eventSource, eventType string, typeMatching eventingv1alpha2.TypeMatching) error
- func (te *TestEnvironment) VerifyCloudEventReceivedBySink(expectedEvent cloudevents.Event) error
- func (te *TestEnvironment) VerifyLegacyEventReceivedBySink(evntID, eventType, eventSource, payload string) error
- func (te *TestEnvironment) WaitForAllSubscriptions() error
- func (te *TestEnvironment) WaitForDeploymentReady(name, namespace, image string) error
- func (te *TestEnvironment) WaitForEventingCRReady() error
- func (te *TestEnvironment) WaitForSubscription(ctx context.Context, subsToTest eventing.TestSubscriptionInfo) error
- func (te *TestEnvironment) WaitForSubscriptions(ctx context.Context, subsToTest []eventing.TestSubscriptionInfo) error
Constants ¶
View Source
const ( Interval = 2 * time.Second SmallInterval = 200 * time.Millisecond Attempts = 60 FewAttempts = 5 ThreeAttempts = 3 )
Variables ¶
View Source
var ( ErrSubscriptionNotReconciled = errors.New("subscription not reconciled") ErrSubscriptionNotReady = errors.New("subscription not READY") ErrDeploymentNotReady = errors.New("deployment not READY") ErrWrongActiveType = errors.New("specified backend not active") ErrEventingNotReady = errors.New("eventing not READY") ErrInvalidDeployment = errors.New("deployment.spec invalid") )
Functions ¶
This section is empty.
Types ¶
type TestEnvironment ¶
type TestEnvironment struct { Logger *zap.Logger K8sClientset *kubernetes.Clientset K8sClient client.Client K8sDynamicClient *dynamic.DynamicClient EventPublisher *eventing.Publisher SinkClient *eventing.SinkClient TestConfigs *env.E2EConfig }
TestEnvironment provides mocked resources for integration tests.
func NewTestEnvironment ¶
func NewTestEnvironment() *TestEnvironment
func (*TestEnvironment) CompareCloudEvents ¶
func (te *TestEnvironment) CompareCloudEvents(expectedEvent cloudevents.Event, gotEvent cloudevents.Event) error
func (*TestEnvironment) CreateAllSubscriptions ¶
func (te *TestEnvironment) CreateAllSubscriptions() error
func (*TestEnvironment) CreateSinkDeployment ¶
func (te *TestEnvironment) CreateSinkDeployment(name, namespace, image string) error
func (*TestEnvironment) CreateSinkService ¶
func (te *TestEnvironment) CreateSinkService(name, namespace string) error
func (*TestEnvironment) CreateTestNamespace ¶
func (te *TestEnvironment) CreateTestNamespace() error
func (*TestEnvironment) CreateV1Alpha2Subscriptions ¶
func (te *TestEnvironment) CreateV1Alpha2Subscriptions(ctx context.Context, subList []eventing.TestSubscriptionInfo) error
func (*TestEnvironment) DeleteAllSubscriptions ¶
func (te *TestEnvironment) DeleteAllSubscriptions() error
func (*TestEnvironment) DeleteDeployment ¶
func (te *TestEnvironment) DeleteDeployment(name, namespace string) error
func (*TestEnvironment) DeleteEventingCR ¶
func (te *TestEnvironment) DeleteEventingCR() error
func (*TestEnvironment) DeleteService ¶
func (te *TestEnvironment) DeleteService(name, namespace string) error
func (*TestEnvironment) DeleteSinkResources ¶
func (te *TestEnvironment) DeleteSinkResources() error
func (*TestEnvironment) DeleteSubscriptionFromK8s ¶
func (te *TestEnvironment) DeleteSubscriptionFromK8s(name, namespace string) error
func (*TestEnvironment) DeleteTestNamespace ¶
func (te *TestEnvironment) DeleteTestNamespace() error
func (*TestEnvironment) GetDeployment ¶
func (te *TestEnvironment) GetDeployment(name, namespace string) (*kappsv1.Deployment, error)
func (*TestEnvironment) GetDeploymentFromK8s ¶
func (te *TestEnvironment) GetDeploymentFromK8s(name, namespace string) (*kappsv1.Deployment, error)
func (*TestEnvironment) GetEventingCRFromK8s ¶
func (te *TestEnvironment) GetEventingCRFromK8s(name, namespace string) (*operatorv1alpha1.Eventing, error)
func (*TestEnvironment) GetPeerAuthenticationFromK8s ¶
func (te *TestEnvironment) GetPeerAuthenticationFromK8s(name, namespace string) (*istiopkgsecurityv1beta1.PeerAuthentication, error)
func (*TestEnvironment) InitEventPublisherClient ¶
func (te *TestEnvironment) InitEventPublisherClient() error
func (*TestEnvironment) InitSinkClient ¶
func (te *TestEnvironment) InitSinkClient() error
func (*TestEnvironment) IsSubscriptionReconcileByBackend ¶
func (te *TestEnvironment) IsSubscriptionReconcileByBackend(sub eventingv1alpha2.Subscription, activeBackend string) bool
func (*TestEnvironment) SetupEventingCR ¶
func (te *TestEnvironment) SetupEventingCR() error
func (*TestEnvironment) SetupSink ¶
func (te *TestEnvironment) SetupSink() error
func (*TestEnvironment) TestDeliveryOfCloudEvent ¶
func (te *TestEnvironment) TestDeliveryOfCloudEvent(eventSource, eventType string, encoding binding.Encoding, typeMatching eventingv1alpha2.TypeMatching) error
func (*TestEnvironment) TestDeliveryOfLegacyEvent ¶
func (te *TestEnvironment) TestDeliveryOfLegacyEvent(eventSource, eventType string, typeMatching eventingv1alpha2.TypeMatching) error
func (*TestEnvironment) VerifyCloudEventReceivedBySink ¶
func (te *TestEnvironment) VerifyCloudEventReceivedBySink(expectedEvent cloudevents.Event) error
func (*TestEnvironment) VerifyLegacyEventReceivedBySink ¶
func (te *TestEnvironment) VerifyLegacyEventReceivedBySink(evntID, eventType, eventSource, payload string) error
func (*TestEnvironment) WaitForAllSubscriptions ¶
func (te *TestEnvironment) WaitForAllSubscriptions() error
func (*TestEnvironment) WaitForDeploymentReady ¶
func (te *TestEnvironment) WaitForDeploymentReady(name, namespace, image string) error
func (*TestEnvironment) WaitForEventingCRReady ¶
func (te *TestEnvironment) WaitForEventingCRReady() error
func (*TestEnvironment) WaitForSubscription ¶
func (te *TestEnvironment) WaitForSubscription(ctx context.Context, subsToTest eventing.TestSubscriptionInfo) error
func (*TestEnvironment) WaitForSubscriptions ¶
func (te *TestEnvironment) WaitForSubscriptions(ctx context.Context, subsToTest []eventing.TestSubscriptionInfo) error
Click to show internal directories.
Click to hide internal directories.