exec

package
v1.17.7 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exec added in v1.16.0

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

func New

func New(t *testing.T, binPath string, args []string, fopts ...Option) *Exec

func (*Exec) AwaitExit added in v1.17.7

func (e *Exec) AwaitExit(t *testing.T)

AwaitExit waits for the process to exit on its own and asserts the expected exit code. Unlike Cleanup it does not signal the process, which is important when callers know the process is already terminating (or has terminated) and signaling could fail with "process already finished" on systems that have reaped the PID.

func (*Exec) Cleanup added in v1.16.0

func (e *Exec) Cleanup(t *testing.T)

func (*Exec) Clone added in v1.17.0

func (e *Exec) Clone(t *testing.T) *Exec

func (*Exec) Kill added in v1.16.0

func (e *Exec) Kill(t *testing.T)

func (*Exec) ReplaceArg added in v1.17.7

func (e *Exec) ReplaceArg(t *testing.T, flag, value string)

ReplaceArg sets `--<flag>=<value>` on the next Run/Restart, replacing any existing occurrence of that flag. Useful for tests that need to change a daprd flag (e.g. --max-body-size) and then restart.

func (*Exec) Run added in v1.16.0

func (e *Exec) Run(t *testing.T, ctx context.Context)

type Option

type Option func(*options)

func WithEnvVars

func WithEnvVars(t *testing.T, envs ...string) Option

WithEnvVars sets the environment variables for the command. Expects a list of key value pairs.

func WithExitCode

func WithExitCode(code int) Option

func WithRunError

func WithRunError(ferr func(*testing.T, error)) Option

func WithStderr

func WithStderr(stderr io.WriteCloser) Option

func WithStdout

func WithStdout(stdout io.WriteCloser) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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