common

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

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