Documentation
¶
Index ¶
- func BuildConfigMap(brokerType string, rabbitMQURL string, pubsubProjectID string) map[string]string
- func RunCloseWaitsForInFlightMessages(t *testing.T, configMap map[string]string, cfg BrokerTestConfig)
- func RunErrorChannelNotification(t *testing.T, configMap map[string]string, cfg BrokerTestConfig)
- func RunErrorSubscriber(t *testing.T, configMap map[string]string, cfg BrokerTestConfig)
- func RunFanoutSubscription(t *testing.T, configMap map[string]string, cfg BrokerTestConfig)
- func RunMultipleEvents(t *testing.T, configMap map[string]string, cfg BrokerTestConfig)
- func RunPanicHandler(t *testing.T, configMap map[string]string, cfg BrokerTestConfig)
- func RunPublisherSubscriber(t *testing.T, configMap map[string]string, cfg BrokerTestConfig)
- func RunSharedSubscription(t *testing.T, configMap map[string]string, cfg BrokerTestConfig)
- func RunSlowSubscriber(t *testing.T, configMap map[string]string, cfg BrokerTestConfig, ...)
- func SetupTestEnvironment()
- type BrokerTestConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildConfigMap ¶
func BuildConfigMap(brokerType string, rabbitMQURL string, pubsubProjectID string) map[string]string
BuildConfigMap creates a configuration map for testing
func RunCloseWaitsForInFlightMessages ¶
func RunCloseWaitsForInFlightMessages(t *testing.T, configMap map[string]string, cfg BrokerTestConfig)
RunCloseWaitsForInFlightMessages tests that Close() waits for in-flight message processing to complete
func RunErrorChannelNotification ¶
func RunErrorChannelNotification(t *testing.T, configMap map[string]string, cfg BrokerTestConfig)
RunErrorChannelNotification tests that infrastructure errors are sent to the error channel
func RunErrorSubscriber ¶
func RunErrorSubscriber(t *testing.T, configMap map[string]string, cfg BrokerTestConfig)
RunErrorSubscriber tests that messages are redistributed when one subscriber fails
func RunFanoutSubscription ¶
func RunFanoutSubscription(t *testing.T, configMap map[string]string, cfg BrokerTestConfig)
RunFanoutSubscription tests that two subscribers with different subscriptionIDs each get all messages
func RunMultipleEvents ¶
func RunMultipleEvents(t *testing.T, configMap map[string]string, cfg BrokerTestConfig)
RunMultipleEvents tests that multiple events are processed correctly
func RunPanicHandler ¶
func RunPanicHandler(t *testing.T, configMap map[string]string, cfg BrokerTestConfig)
RunPanicHandler tests that a handler that panics doesn't cause Close() to hang
func RunPublisherSubscriber ¶
func RunPublisherSubscriber(t *testing.T, configMap map[string]string, cfg BrokerTestConfig)
RunPublisherSubscriber tests the full publish/subscribe flow
func RunSharedSubscription ¶
func RunSharedSubscription(t *testing.T, configMap map[string]string, cfg BrokerTestConfig)
RunSharedSubscription tests that two subscribers with the same subscriptionID share messages
func RunSlowSubscriber ¶
func RunSlowSubscriber(t *testing.T, configMap map[string]string, cfg BrokerTestConfig, sub1, sub2 broker.Subscriber)
RunSlowSubscriber tests that a slow subscriber processes fewer messages than a fast one
func SetupTestEnvironment ¶
func SetupTestEnvironment()
SetupTestEnvironment sets up the test environment for Podman and disables Ryuk This should be called from TestMain in each test package
Types ¶
type BrokerTestConfig ¶
type BrokerTestConfig struct {
BrokerType string
SetupSleep time.Duration
ReceiveTimeout time.Duration
SetupConfigFunc func(*testing.T, map[string]string) // Optional function to modify config after initial setup
PublishDelay time.Duration // Delay between publishes (for gradual publishing, 0 = no delay)
}
BrokerTestConfig holds broker-specific test configuration