integration_support

package
v1.1.693 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NATS_SERVER_IMAGE_URL_ENV_VAR_NAME is the name of the env var containing the nats image URL
	NATS_SERVER_IMAGE_URL_ENV_VAR_NAME = "NATS_SERVER_IMAGE_URL"
	// SHAR_SERVER_IMAGE_URL_ENV_VAR_NAME is the name of the env var containing the shar server image URL
	SHAR_SERVER_IMAGE_URL_ENV_VAR_NAME = "SHAR_SERVER_IMAGE_URL"
	// NATS_PERSIST_ENV_VAR_NAME is the name of the env var containing the flag determining whether nats data is persisted between tests
	NATS_PERSIST_ENV_VAR_NAME = "NATS_PERSIST"
)

Variables

This section is empty.

Functions

func IsNatsContainerised added in v1.0.623

func IsNatsContainerised() bool

IsNatsContainerised determines whether tests are running against containerised nats server

func IsNatsPersist added in v1.0.623

func IsNatsPersist() bool

IsNatsPersist determines whether tests are persist nats data between executions

func IsSharContainerised added in v1.0.623

func IsSharContainerised() bool

IsSharContainerised determines whether tests are running against containerised shar server

func WaitForChan added in v1.0.477

func WaitForChan(t *testing.T, c chan struct{}, d time.Duration)

WaitForChan waits for a chan struct{} with a duration timeout.

func WaitForExpectedCompletions added in v1.0.645

func WaitForExpectedCompletions(t *testing.T, expectedCompletions int, completion chan struct{}, timeout time.Duration)

WaitForExpectedCompletions will wait up to timeout for expectedCompletions on the completion channel

Types

type Integration

type Integration struct {
	FinalVars     map[string]interface{}
	Test          *testing.T
	Mx            sync.Mutex
	Cooldown      time.Duration
	WithTelemetry server2.Exporter

	WithTrace bool

	NatsURL      string // NatsURL is the default testing URL for the NATS host.
	TestRunnable func() (bool, string)
	// contains filtered or unexported fields
}

Integration - the integration test support framework.

func (*Integration) AssertCleanKV

func (s *Integration) AssertCleanKV()

AssertCleanKV - ensures SHAR has cleans up after itself, and there are no records left in the KV.

func (*Integration) GetJetstream

func (s *Integration) GetJetstream() (nats.JetStreamContext, error)

GetJetstream - fetches the test framework jetstream server for making test calls.

func (*Integration) GetNats

func (s *Integration) GetNats() (*nats.Conn, error)

GetNats - fetches the test framework NATS server for making test calls.

func (*Integration) Setup

func (s *Integration) Setup(t *testing.T, authZFn authz.APIFunc, authNFn authn.Check)

Setup - sets up the test NATS and SHAR servers.

func (*Integration) Teardown

func (s *Integration) Teardown()

Teardown - resposible for shutting down the integration test framework.

Jump to

Keyboard shortcuts

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