testutil

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AwaitCondition

func AwaitCondition(cond util.Condition, period time.Duration, maxWait time.Duration) error

AwaitCondition runs the passed 'cond' function every period until it returns true, returning an error if maxWait is exceeded.

func CreateElasticsearchIndex

func CreateElasticsearchIndex(indexName string) error

func EnsureTestTopicExists added in v0.1.5

func EnsureTestTopicExists(topicName string, partitions int32) error

func QueryAllElasticsearchDocuments

func QueryAllElasticsearchDocuments(indexName string) (*elastic.SearchHits, error)

QueryAllElasticsearchDocuments is a test utility for fetching all documents in the specified elasticsearch index.

func WaitForPort

func WaitForPort(t *testing.T, port int) error

WaitForPort waits for the passed port number to start accepting connections. This can be used in integration tests to ensure that infrastructure services are available before tests that depend on them start to run. It's necessary because docker-compose returns when the configured containers are created, which doesn't ensure that the services they run are ready.d

Types

This section is empty.

Jump to

Keyboard shortcuts

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