Documentation ¶
Overview ¶
Package systemtest holds system/integration tests that test the apm-queue/kafka and apm-queue/pubsublite producer and consumer behaviour against real brokers/clusters.
Index ¶
- func CreateKafkaTopics(ctx context.Context, t testing.TB, partitions int, topics ...apmqueue.Topic)
- func DestroyKafka(ctx context.Context) error
- func InitKafka() (ProvisionInfraFunc, DestroyInfraFunc, error)
- func KafkaCommonConfig(t testing.TB, cfg kafka.CommonConfig) kafka.CommonConfig
- func NewKafkaManager(t testing.TB) *kafka.Manager
- func ProvisionKafka(ctx context.Context) error
- func RandomSuffix() string
- func SuffixTopics(topics ...apmqueue.Topic) []apmqueue.Topic
- func TestLogger(t testing.TB) *zap.Logger
- type DestroyInfraFunc
- type ProvisionInfraFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateKafkaTopics ¶
CreateKafkaTopics interacts with the Kafka broker to create topics, deleting them when the test completes.
Topics are created with given partitions and 1 hour of retention.
func DestroyKafka ¶
DestroyKafka destroys the Redpanda Docker container.
func InitKafka ¶
func InitKafka() (ProvisionInfraFunc, DestroyInfraFunc, error)
InitKafka initialises Kafka configuration, and returns a pair of functions for provisioning and destroying a Kafka cluster.
If KAFKA_BROKERS is set, provisioning and destroying are skipped, and Kafka clients will be configured to communicate with those brokers.
func KafkaCommonConfig ¶
func KafkaCommonConfig(t testing.TB, cfg kafka.CommonConfig) kafka.CommonConfig
KafkaCommonConfig returns a kafka.CommonConfig suitable for connecting to the configured Kafka broker in tests.
When Redpanda is running locally in Docker, this will ignore the advertised address and use the forwarded port.
func NewKafkaManager ¶
NewKafkaManager returns a new kafka.Manager for the configured broker.
func ProvisionKafka ¶
ProvisionKafka starts a single node Redpanda broker running as a local Docker container, and configures Kafka clients to communicate with the broker by forwarding the necessary port(s).
func RandomSuffix ¶
func RandomSuffix() string
RandomSuffix generates a lowercase alphabetic 8 character random string
func SuffixTopics ¶
SuffixTopics suffixes the received topics with a random suffix.
Types ¶
type DestroyInfraFunc ¶
DestroyInfraFunc is a function returned by Init* functions for destroying infrastructure.
type ProvisionInfraFunc ¶
ProvisionInfraFunc is a function returned by Init* functions for provisioning infrastructure.