Documentation ¶
Index ¶
- func BrokerChannelFlowWithTransformation(t *testing.T, brokerClass string, brokerVersion string, triggerVersion string, ...)
- func ChannelChainTestHelper(t *testing.T, subscriptionVersion SubscriptionVersion, ...)
- func ChannelClusterDefaulterTestHelper(t *testing.T, channelTestRunner testlib.ComponentsTestRunner, ...)
- func ChannelDeadLetterSinkTestHelper(t *testing.T, subscriptionVersion SubscriptionVersion, ...)
- func ChannelNamespaceDefaulterTestHelper(t *testing.T, channelTestRunner testlib.ComponentsTestRunner, ...)
- func EventTransformationForSubscriptionTestHelper(t *testing.T, subscriptionVersion SubscriptionVersion, ...)
- func EventTransformationForTriggerTestHelper(t *testing.T, brokerClass string, brokerVersion string, triggerVersion string, ...)
- func ParallelTestHelper(t *testing.T, channelTestRunner testlib.ComponentsTestRunner, ...)
- func ParallelV1TestHelper(t *testing.T, channelTestRunner testlib.ComponentsTestRunner, ...)
- func SequenceTestHelper(t *testing.T, channelTestRunner testlib.ComponentsTestRunner, ...)
- func SequenceV1TestHelper(t *testing.T, channelTestRunner testlib.ComponentsTestRunner, ...)
- func SingleEventForChannelTestHelper(t *testing.T, encoding cloudevents.Encoding, ...)
- func TestBrokerWithManyTriggers(t *testing.T, brokerCreator BrokerCreator, shouldLabelNamespace bool)
- func TestTriggerNoBroker(t *testing.T, channel string, brokerCreator BrokerCreator)
- type BrokerCreator
- type SubscriptionVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BrokerChannelFlowWithTransformation ¶ added in v0.16.0
func BrokerChannelFlowWithTransformation(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 tranforms it to a new event, Trigger2 logs all events, Trigger3 filters the transformed event and sends it to Channel.
func ChannelChainTestHelper ¶
func ChannelChainTestHelper(t *testing.T, subscriptionVersion SubscriptionVersion, channelTestRunner testlib.ComponentsTestRunner, options ...testlib.SetupClientOption)
ChannelChainTestHelper is the helper function for channel_chain_test
func ChannelClusterDefaulterTestHelper ¶
func ChannelClusterDefaulterTestHelper(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(t *testing.T, subscriptionVersion SubscriptionVersion, channelTestRunner testlib.ComponentsTestRunner, options ...testlib.SetupClientOption)
ChannelDeadLetterSinkTestHelper is the helper function for channel_deadlettersink_test
func ChannelNamespaceDefaulterTestHelper ¶
func ChannelNamespaceDefaulterTestHelper(t *testing.T, channelTestRunner testlib.ComponentsTestRunner, options ...testlib.SetupClientOption)
ChannelNamespaceDefaulterTestHelper is the helper function for channel_defaulter_test
func EventTransformationForSubscriptionTestHelper ¶
func EventTransformationForSubscriptionTestHelper(t *testing.T, subscriptionVersion SubscriptionVersion, channelTestRunner testlib.ComponentsTestRunner, options ...testlib.SetupClientOption)
EventTransformationForSubscriptionTestHelper is the helper function for channel_event_tranformation_test
func EventTransformationForTriggerTestHelper ¶
func EventTransformationForTriggerTestHelper(t *testing.T, brokerClass string, brokerVersion string, triggerVersion string, componentsTestRunner testlib.ComponentsTestRunner, 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(t *testing.T, channelTestRunner testlib.ComponentsTestRunner, options ...testlib.SetupClientOption)
func ParallelV1TestHelper ¶ added in v0.16.0
func ParallelV1TestHelper(t *testing.T, channelTestRunner testlib.ComponentsTestRunner, options ...testlib.SetupClientOption)
func SequenceTestHelper ¶ added in v0.15.0
func SequenceTestHelper(t *testing.T, channelTestRunner testlib.ComponentsTestRunner, options ...testlib.SetupClientOption)
func SequenceV1TestHelper ¶ added in v0.16.0
func SequenceV1TestHelper(t *testing.T, channelTestRunner testlib.ComponentsTestRunner, options ...testlib.SetupClientOption)
func SingleEventForChannelTestHelper ¶
func SingleEventForChannelTestHelper(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.
func TestBrokerWithManyTriggers ¶ added in v0.15.0
func TestBrokerWithManyTriggers(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(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 SubscriptionVersion ¶ added in v0.15.0
type SubscriptionVersion string
const ( SubscriptionV1beta1 SubscriptionVersion = "v1beta1" SubscriptionV1 SubscriptionVersion = "v1" )
Source Files ¶
- broker_channel_flow_helper.go
- broker_event_transformation_test_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