testenvironment

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartAndAwaitReady

func StartAndAwaitReady(t TestingT, cmd *exec.Cmd, stdout, stderr io.Writer, readyMessage string)

StartAndAwaitReady takes a prepared exec.Cmd, assigns stdout and stderr to out, and starts it. This blocks on the readyMessage.

Types

type TestEnvironment

type TestEnvironment struct {
	// contains filtered or unexported fields
}

TestEnvironment holds all the services needed for tests.

func StartTestEnvironment

func StartTestEnvironment(t TestingT,
	requireNewUpstream func(t TestingT, out io.Writer, port int), upstreamPortDefault int,
	extprocBin, extprocConfig string, extprocEnv []string, envoyConfig string, okToDumpLogOnFailure, extProcInProcess bool,
) *TestEnvironment

StartTestEnvironment starts all required services and returns ports and a closer.

If extProcInProcess is true, then this starts the extproc in-process by directly calling mainlib.Main instead of the built binary. This allows the benchmark test suite to directly do the profiling without the extroc.

func (*TestEnvironment) EnvoyListenerPort

func (e *TestEnvironment) EnvoyListenerPort() int

func (*TestEnvironment) EnvoyStdout

func (e *TestEnvironment) EnvoyStdout() string

EnvoyStdout returns the content of Envoy's stdout (e.g. the access log).

func (*TestEnvironment) EnvoyStdoutReset

func (e *TestEnvironment) EnvoyStdoutReset()

EnvoyStdoutReset sets Envoy's stdout log to zero length.

func (*TestEnvironment) ExtProcMetricsPort

func (e *TestEnvironment) ExtProcMetricsPort() int

func (*TestEnvironment) LogOutput

func (e *TestEnvironment) LogOutput(t TestingT)

type TestingT

type TestingT interface {
	require.TestingT
	Logf(format string, args ...interface{})
	TempDir() string
	Context() context.Context
	Cleanup(func())
	Failed() bool
}

TestingT is an abstraction over testing.T and testing.B.

Jump to

Keyboard shortcuts

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