testprocess

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: AGPL-3.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package testprocess launches correctness-test children through a bounded, platform-native process-tree owner.

Index

Constants

View Source
const MaximumCapturedEvents = 1024
View Source
const MaximumCapturedOutputBytes = 1 << 20

Variables

This section is empty.

Functions

func InheritEnvironment

func InheritEnvironment(overrides map[string]string) ([]string, error)

InheritEnvironment returns one deterministic entry per variable while removing transport handles that belong to a different child process.

func RequireClean

func RequireClean(result Result, lifecycleErr error) error

RequireClean separates process-tree ownership from the target's business exit status. Cleanup paths use it because an intentional stop may validly produce a non-zero target exit while still retiring every descendant.

func RequireSuccess

func RequireSuccess(result Result, lifecycleErr error) error

Types

type Command

type Command struct {
	Executable       string
	Arguments        []string
	WorkingDirectory string
	Environment      []string
}

type Event

type Event = testrun.Event

type EventReader

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

func (*EventReader) Done

func (reader *EventReader) Done() <-chan struct{}

func (*EventReader) Err

func (reader *EventReader) Err() error

func (*EventReader) Next

func (reader *EventReader) Next(ctx context.Context) (Event, error)

type OutputSnapshot

type OutputSnapshot struct {
	Bytes     []byte
	Truncated bool
}

func (OutputSnapshot) String

func (snapshot OutputSnapshot) String() string

type OutputStream

type OutputStream string
const (
	Stdout OutputStream = "stdout"
	Stderr OutputStream = "stderr"
)

type Owner

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

func BuildOwner

func BuildOwner(ctx context.Context, repositoryRoot string) (_ *Owner, resultErr error)

func NewOwner

func NewOwner(helperPath string) (*Owner, error)

func (*Owner) Close

func (owner *Owner) Close() error

func (*Owner) SelfCheck

func (owner *Owner) SelfCheck(ctx context.Context) error

func (*Owner) Start

func (owner *Owner) Start(ctx context.Context, spec Spec) (*Process, error)

type Process

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

func (*Process) Diagnostic

func (process *Process) Diagnostic() string

func (*Process) Events

func (process *Process) Events() *EventReader

func (*Process) Interrupt

func (process *Process) Interrupt(ctx context.Context) (Result, error)

func (*Process) Stderr

func (process *Process) Stderr() OutputSnapshot

func (*Process) Stdout

func (process *Process) Stdout() OutputSnapshot

func (*Process) Stop

func (process *Process) Stop(ctx context.Context) (Result, error)

func (*Process) Wait

func (process *Process) Wait(ctx context.Context) (Result, error)

func (*Process) WaitForOutput

func (process *Process) WaitForOutput(
	ctx context.Context,
	stream OutputStream,
	pattern *regexp.Regexp,
) ([]string, error)

type Result

type Result = processowner.Result

type Spec

type Spec struct {
	Identity         testrun.Identity
	Command          Command
	Deadline         time.Duration
	TerminationGrace time.Duration
}

Jump to

Keyboard shortcuts

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