Documentation ¶
Index ¶
- func BrokerChannelFlowWithTransformation(ctx context.Context, t *testing.T, brokerClass string, brokerVersion string, ...)
- func BrokerRedelivery(ctx context.Context, t *testing.T, creator BrokerCreatorWithRetries)
- func ChannelChainTestHelper(ctx context.Context, t *testing.T, subscriptionVersion SubscriptionVersion, ...)
- func ChannelClusterDefaulterTestHelper(ctx context.Context, t *testing.T, ...)
- func ChannelDeadLetterSinkDefaultTestHelper(ctx context.Context, t *testing.T, ...)
- func ChannelDeadLetterSinkTestHelper(ctx context.Context, t *testing.T, subscriptionVersion SubscriptionVersion, ...)
- func ChannelNamespaceDefaulterTestHelper(ctx context.Context, t *testing.T, ...)
- func EventTransformationForSubscriptionTestHelper(ctx context.Context, t *testing.T, subscriptionVersion SubscriptionVersion, ...)
- func EventTransformationForTriggerTestHelper(ctx context.Context, t *testing.T, brokerVersion string, triggerVersion string, ...)
- func ParallelTestHelper(ctx context.Context, t *testing.T, ...)
- func ParallelV1TestHelper(ctx context.Context, t *testing.T, ...)
- func SequenceTestHelper(ctx context.Context, t *testing.T, ...)
- func SequenceV1TestHelper(ctx context.Context, t *testing.T, ...)
- func SingleEventForChannelTestHelper(ctx context.Context, t *testing.T, encoding cloudevents.Encoding, ...)
- func TestBrokerWithManyTriggers(ctx context.Context, t *testing.T, brokerCreator BrokerCreator, ...)
- func TestTriggerNoBroker(ctx context.Context, t *testing.T, channel string, brokerCreator BrokerCreator)
- type BrokerCreator
- type BrokerCreatorWithRetries
- type SubscriptionVersion
Constants ¶
This section is empty.
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.
func BrokerRedelivery ¶ added in v0.17.0
func BrokerRedelivery(ctx context.Context, t *testing.T, creator BrokerCreatorWithRetries)
func ChannelChainTestHelper ¶
func ChannelChainTestHelper( ctx context.Context, t *testing.T, subscriptionVersion SubscriptionVersion, channelTestRunner testlib.ComponentsTestRunner, options ...testlib.SetupClientOption)
ChannelChainTestHelper is the helper function for channel_chain_test 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 ChannelDeadLetterSinkDefaultTestHelper ¶ added in v0.20.0
func ChannelDeadLetterSinkDefaultTestHelper( ctx context.Context, t *testing.T, channelTestRunner testlib.ComponentsTestRunner, options ...testlib.SetupClientOption)
ChannelDeadLetterDefaultSinkTestHelper is the helper function for channel_deadlettersink_test, but setting the delivery from the channel spec Deprecated, use reconciler-test based tests.
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.
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.
func TestBrokerWithManyTriggers ¶ added in v0.15.0
func TestBrokerWithManyTriggers(ctx context.Context, t *testing.T, brokerCreator BrokerCreator, shouldLabelNamespace bool)
If shouldLabelNamespace is set to true this test annotates the testing namespace so that a default broker is created. It then binds many triggers with different filtering patterns to the broker created by brokerCreator, and sends different events to the broker's address. Finally, it verifies that only the appropriate events are routed to the subscribers.
func TestTriggerNoBroker ¶ added in v0.15.0
func TestTriggerNoBroker(ctx context.Context, t *testing.T, channel string, brokerCreator BrokerCreator)
TestTriggerNoBroker will create a Trigger with a non-existent broker, then it will ensure the Status is correctly reflected as failed with BrokerDoesNotExist. Then it will create the broker and ensure that Trigger / Broker will get to Ready state.
Types ¶
type BrokerCreator ¶ added in v0.15.0
BrokerCreator creates a broker and returns its broker name. TestBrokerWithManyTriggers will wait for the broker to become ready.
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
BrokerCreator creates a broker and returns its broker name.
type SubscriptionVersion ¶ added in v0.15.0
type SubscriptionVersion string
const (
SubscriptionV1 SubscriptionVersion = "v1"
)
Source Files ¶
- broker_channel_flow_helper.go
- broker_event_transformation_test_helper.go
- broker_redelivery_helper.go
- broker_test_helper.go
- channel_chain_test_helper.go
- channel_defaulter_test_helper.go
- channel_dls_test_helper.go
- channel_event_tranformation_test_helper.go
- channel_single_event_helper.go
- parallel_test_helper.go
- sequence_test_helper.go
- trigger_no_broker_test_helper.go