testutil

package
v1.34.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFreePort added in v1.29.0

func GetFreePort(t *testing.T) int

GetFreePort asks the kernel for a free open port that is ready to use for tests.

func StderrOutputForFunc

func StderrOutputForFunc(f func()) string

func StdoutOutputForFunc

func StdoutOutputForFunc(f func()) string

Types

type CustomError added in v1.1.1

type CustomError struct {
	ErrorMessage string
}

func (CustomError) Error added in v1.1.1

func (c CustomError) Error() string

type ServiceConfigs added in v1.32.0

type ServiceConfigs struct {
	HTTPPort    int
	HTTPHost    string
	MetricsPort int
	MetricsHost string
	GRPCPort    int
	GRPCHost    string
}

ServiceConfigs holds the configuration details for different server components.

func NewServerConfigs added in v1.32.0

func NewServerConfigs(t *testing.T) *ServiceConfigs

NewServerConfigs sets up server configurations for testing and returns a ServiceConfigs struct. It dynamically assigns free ports for HTTP, Metrics, and gRPC services, sets up environment variables for them, and returns a struct with the configured values.

Jump to

Keyboard shortcuts

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