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 CreatePubsubTopicSubscriptions(ctx context.Context, t testing.TB, consumer string, topics ...apmqueue.Topic)
- func CreatePubsubTopics(ctx context.Context, t testing.TB, partitions int, topics ...apmqueue.Topic)
- func DestroyKafka(ctx context.Context) error
- func DestroyPubSubLite(ctx context.Context) error
- func InitKafka() (ProvisionInfraFunc, DestroyInfraFunc, error)
- func InitPubSubLite() (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 ProvisionPubSubLite(ctx context.Context) error
- func PubSubLiteCommonConfig(cfg pubsublite.CommonConfig) pubsublite.CommonConfig
- 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 CreatePubsubTopicSubscriptions ¶
func CreatePubsubTopicSubscriptions(ctx context.Context, t testing.TB, consumer string, topics ...apmqueue.Topic)
CreatePubsubTopicSubscriptions interacts with the Google Cloud API to create Pub/Sub Lite subscriptions.
func CreatePubsubTopics ¶
func CreatePubsubTopics(ctx context.Context, t testing.TB, partitions int, topics ...apmqueue.Topic)
CreatePubsubTopics interacts with the Google Cloud API to create Pub/Sub Lite topics.
func DestroyKafka ¶
DestroyKafka destroys the Redpanda Docker container.
func DestroyPubSubLite ¶
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 InitPubSubLite ¶
func InitPubSubLite() (ProvisionInfraFunc, DestroyInfraFunc, error)
InitPubSubLite initialises Pub/Sub Lite configuration, and returns a pair of functions for provisioning and destroying a Pub/Sub Lite throughput reservation and associated resources.
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 ProvisionPubSubLite ¶
ProvisionPubSubLite provisions a Pub/Sub Lite throughput reservation using configuration taken from `gcloud` and $GOOGLE_REGION.
func PubSubLiteCommonConfig ¶
func PubSubLiteCommonConfig(cfg pubsublite.CommonConfig) pubsublite.CommonConfig
PubSubLiteCommonConfig returns a pubsublite.CommonConfig suitable for using to construct pubsublite resources.
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.