tracer

package
v0.0.0-...-a488fd3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RealCommandExecutor

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

RealCommandExecutor executes actual go test commands

func (*RealCommandExecutor) Execute

func (e *RealCommandExecutor) Execute(args []string, extraEnv map[string]string) (io.Reader, error)

type Skipper

type Skipper interface {
	ShouldSkip(testName string) bool
	Addr() net.Addr // Returns the address where skip commands can be sent
}

Skipper determines whether a test should be skipped for tracing

type TestCommandExecutor

type TestCommandExecutor interface {
	Execute(args []string, extraEnv map[string]string) (io.Reader, error)
}

TestCommandExecutor abstracts the execution of go test commands

type TestSkipper

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

TestSkipper implements the Skipper interface and provides a way to dynamically add tests to skip

func NewTestSkipper

func NewTestSkipper() (*TestSkipper, error)

NewTestSkipper creates a new TestSkipper with a Unix domain socket listener

func (*TestSkipper) Addr

func (ts *TestSkipper) Addr() net.Addr

Addr returns the address of the Unix domain socket

func (*TestSkipper) Close

func (ts *TestSkipper) Close() error

Close stops the server and cleans up resources

func (*TestSkipper) ShouldSkip

func (ts *TestSkipper) ShouldSkip(testName string) bool

ShouldSkip implements the Skipper interface

func (*TestSkipper) SkipTest

func (ts *TestSkipper) SkipTest(testName string)

SkipTest adds a test to the skip list

type TestTracer

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

func NewTestTracer

func NewTestTracer(skipper Skipper, svc string) *TestTracer

func (*TestTracer) SetCommandExecutor

func (tt *TestTracer) SetCommandExecutor(executor TestCommandExecutor)

SetCommandExecutor allows overriding the command executor (useful for testing)

func (*TestTracer) SetProcessDelay

func (tt *TestTracer) SetProcessDelay(delay time.Duration)

SetProcessDelay allows configuring the delay between receiving and processing test events

func (*TestTracer) Trace

func (tt *TestTracer) Trace(ctx context.Context, args []string) error

Jump to

Keyboard shortcuts

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