Documentation ¶
Index ¶
- Constants
- func Addr(t *testing.T, assert *require.Assertions) netip.AddrPort
- func CockroachDB(ctx context.Context, t *testing.T, assert *require.Assertions, ...) *connectors.CockroachDB
- func Context(t *testing.T) context.Context
- func Minio(ctx context.Context, t *testing.T, assert *require.Assertions, ...) string
- func Mod[T any](v T, f func(*T)) T
- func NATS(ctx context.Context, t *testing.T, assert *require.Assertions, ...) string
- func Namespace(t *testing.T) string
- func UnusedTCPPort(t *testing.T, assert *require.Assertions, host string) uint16
- func WaitTCPPort(ctx context.Context, addr string) error
Constants ¶
View Source
const ( CockroachDBImage = `cockroachdb/cockroach` CockroachDBVersion = `v23.1.12` CockroachDBDefaultEndpoint = `` CockroachDBDefaultHost = `localhost` )
Default values for making cockroachDB test container.
View Source
const ( MinioImage = `docker.io/bitnami/minio` MinioVersion = `2023` MinioDefaultEndpoint = `` MinioDefaultHost = `localhost` )
Default values for making nats test container.
View Source
const ( NATSImage = `nats` NATSVersion = `2.10.5` NATSDefaultEndpoint = `` NATSDefaultHost = `localhost` )
Default values for making nats test container.
View Source
const Host = `127.0.0.1`
Host is std test host.
View Source
const MaxTimeout = time.Second * 120
MaxTimeout for tests.
Variables ¶
This section is empty.
Functions ¶
func CockroachDB ¶
func CockroachDB( ctx context.Context, t *testing.T, assert *require.Assertions, caCrtPath, caKeyPath string, nodeCrtPath, nodeKeyPath string, clientCrtPath, clientKeyPath string, ) *connectors.CockroachDB
CockroachDB build and run test container with database.
Notice:
- Starts CockroachDB container;
- Make connections by root certs;
- Make new database/user and grant access.
func Minio ¶
func Minio( ctx context.Context, t *testing.T, assert *require.Assertions, accessKey, secretKey, sessionToken string, secure bool, region string, ) string
Minio build and run test container with file storage.
Notice:
- Starts Minio container;
- Make connections by credentials;
func NATS ¶
func NATS( ctx context.Context, t *testing.T, assert *require.Assertions, cfgFilePath string, username, password string, ) string
NATS build and run test container with message broker.
Notice:
- Starts NATS container;
- Make connections by credentials;
func UnusedTCPPort ¶
UnusedTCPPort returns random unique unused TCP port at host.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.