tests

package
v0.0.0-...-982e07a Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckConnection

func CheckConnection(t *testing.T, endpoint string)

CheckConnection connects to the endpoint until success 100 times with delay or fails

func GetFreePortForListener

func GetFreePortForListener(t *testing.T) int

GetFreePortForListener open new connection on free port

func GetSourceRootDirectory

func GetSourceRootDirectory(t testing.TB) string

GetSourceRootDirectory expects that tests started from root of source code and accessible tests/ssl folder, otherwise try to walk through parents folders and check that it's root of source until find or call t.Fatal It useful because `go test ./...` change working directory recursively to each packages when it compile tests

func TestWithTLS

func TestWithTLS() bool

TestWithTLS returns true if integration tests should run with TLS configuration

Types

type DatabaseConfig

type DatabaseConfig struct {
	DBHost, Database, User, Password string
	Port                             int
}

DatabaseConfig stores configuration for test database

func GetDatabaseConfig

func GetDatabaseConfig(t *testing.T) DatabaseConfig

GetDatabaseConfig returns DatabaseConfig for integration tests configured with env variables or default values used for tests/test.py

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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