helpers

package
v0.39.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 27 Imported by: 1

README

helpers

This package contains helper functions that are used in the actual tests. These functions can be referenced in other repositories (like inside the eventing-*** inside the knative-extensions organization) for adding similar tests.

Documentation

Index

Constants

View Source
const (
	InjectionLabelKey          = "e2e.eventing.knative.dev/injection"
	InjectionEnabledLabelValue = "enabled"
)

Variables

This section is empty.

Functions

func BrokerChannelFlowWithTransformation added in v0.16.0

func BrokerChannelFlowWithTransformation(
	ctx context.Context,
	t *testing.T,
	brokerClass string,
	brokerVersion string,
	triggerVersion string,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption)

BrokerChannelFlowWithTransformation tests the following topology:

------------- ----------------------
|           | |                    |
v	       | v                    |

EventSource ---> Broker ---> Trigger1 -------> Service(Transformation)

|
|
|-------> Trigger2 -------> Service(Logger1)
|
|
|-------> Trigger3 -------> Channel --------> Subscription --------> Service(Logger2)

Explanation: Trigger1 filters the orignal event and transforms it to a new event, Trigger2 logs all events, Trigger3 filters the transformed event and sends it to Channel.

Deprecated, use reconciler-test based tests.

func BrokerRedelivery added in v0.17.0

func BrokerRedelivery(ctx context.Context, t *testing.T, creator BrokerCreatorWithRetries)

Deprecated, use reconciler-test based tests.

func ChannelClusterDefaulterTestHelper

func ChannelClusterDefaulterTestHelper(
	ctx context.Context,
	t *testing.T,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption)

ChannelClusterDefaulterTestHelper is the helper function for channel_defaulter_test

func ChannelDeadLetterSinkTestHelper added in v0.11.0

func ChannelDeadLetterSinkTestHelper(
	ctx context.Context,
	t *testing.T,
	subscriptionVersion SubscriptionVersion,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption)

ChannelDeadLetterSinkTestHelper is the helper function for channel_deadlettersink_test Deprecated, use reconciler-test based tests.

func ChannelNamespaceDefaulterTestHelper

func ChannelNamespaceDefaulterTestHelper(
	ctx context.Context,
	t *testing.T,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption)

ChannelNamespaceDefaulterTestHelper is the helper function for channel_defaulter_test

func EventTransformationForSubscriptionTestHelper

func EventTransformationForSubscriptionTestHelper(
	ctx context.Context,
	t *testing.T,
	subscriptionVersion SubscriptionVersion,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption)

EventTransformationForSubscriptionTestHelper is the helper function for channel_event_transformation_test Deprecated, use reconciler-test based tests.

func EventTransformationForTriggerTestHelper

func EventTransformationForTriggerTestHelper(
	ctx context.Context,
	t *testing.T,
	brokerVersion string,
	triggerVersion string,
	creator BrokerCreator,
	options ...testlib.SetupClientOption)

EventTransformationForTriggerTestHelper tests the following scenario:

            5                 4
      ------------- ----------------------
      |           | |                    |
1     v	 2     | v        3           |

EventSource ---> Broker ---> Trigger1 -------> Service(Transformation)

|
| 6                   7
|-------> Trigger2 -------> Service(Logger)

Note: the number denotes the sequence of the event that flows in this test case.

Deprecated, use reconciler-test based tests.

func ParallelTestHelper added in v0.15.0

func ParallelTestHelper(
	ctx context.Context,
	t *testing.T,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption)

func ParallelV1TestHelper added in v0.16.0

func ParallelV1TestHelper(
	ctx context.Context,
	t *testing.T,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption)

func SequenceTestHelper added in v0.15.0

func SequenceTestHelper(
	ctx context.Context,
	t *testing.T,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption)

func SequenceV1TestHelper added in v0.16.0

func SequenceV1TestHelper(
	ctx context.Context,
	t *testing.T,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption)

func SingleEventForChannelTestHelper

func SingleEventForChannelTestHelper(
	ctx context.Context,
	t *testing.T, encoding cloudevents.Encoding,
	subscriptionVersion SubscriptionVersion,
	channelVersion string,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption)

SingleEventForChannelTestHelper is the helper function for channel_single_event_test channelVersion can be used to override which version you want to create the subscription against. For example, you could create a v1beta1 channel, but create a subscription to its v1alpha1 version by using channelVersion to override it. channelVersion == "" means that the version of the channel subscribed to is not modified. Deprecated, use reconciler-test based tests.

Types

type BrokerCreator added in v0.15.0

type BrokerCreator func(client *testlib.Client, version string) string

BrokerCreator creates a broker and returns its broker name.

func ChannelBasedBrokerCreator added in v0.15.0

func ChannelBasedBrokerCreator(channel metav1.TypeMeta, brokerClass string) BrokerCreator

ChannelBasedBrokerCreator creates a BrokerCreator that creates a broker based on the channel parameter.

type BrokerCreatorWithRetries added in v0.17.0

type BrokerCreatorWithRetries func(client *testlib.Client, numRetries int32) string

BrokerCreator creates a broker and returns its broker name.

type SubscriptionVersion added in v0.15.0

type SubscriptionVersion string
const (
	SubscriptionV1 SubscriptionVersion = "v1"
)

Jump to

Keyboard shortcuts

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