runner

package
v0.49.4 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilContext = errors.New("runner: nil context")

ErrNilContext reports an attempt to run with a nil context.

View Source
var ErrNilWriter = errors.New("runner: nil writer")

ErrNilWriter reports an attempt to write a report to a nil io.Writer.

Functions

func ExitCode added in v0.31.1

func ExitCode(rep *Report, mode runfail.ExitMode) int

func IsUsageError

func IsUsageError(err error) bool

func ReportModel added in v0.31.1

func ReportModel(rep *Report) runfmt.Report

ReportModel converts a runner report into the canonical runfmt model.

Types

type CompareInfo

type CompareInfo struct {
	Baseline string
	Group    string
}

type Options

type Options struct {
	Version         string
	FilePath        string
	FileContent     []byte
	WorkspaceRoot   string
	Recursive       bool
	ArtifactDir     string
	StateDir        string
	PersistGlobals  bool
	PersistAuth     bool
	History         bool
	FailFast        bool
	Catalog         vars.Catalog
	Selection       vars.Selection
	EnvironmentFile string
	Compare         engine.CompareConfig
	Profile         bool
	HTTPOptions     httpclient.Options
	GRPCOptions     grpcclient.Options
	Client          *httpclient.Client
	Select          Select
}

type Plan added in v0.29.1

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

Plan stores prepared runner inputs that can be executed multiple times. It is safe for concurrent reuse; runs that share persisted state may be internally serialized.

func Build added in v0.29.1

func Build(opts Options) (*Plan, error)

type ProfileFailure

type ProfileFailure struct {
	Iteration  int
	Warmup     bool
	Reason     string
	Status     string
	StatusCode int
	Duration   time.Duration
	Err        error
	// Failure carries the structured classification from the profile collector.
	Failure runfail.Failure
}

type ProfileInfo

type ProfileInfo struct {
	Count    int
	Warmup   int
	Delay    time.Duration
	Results  *history.ProfileResults
	Failures []ProfileFailure
}

type Report

type Report struct {
	SchemaVersion        string
	Version              string
	FilePath             string
	EnvName              string
	EnvironmentSelection map[string]string
	StartedAt            time.Time
	EndedAt              time.Time
	Duration             time.Duration
	Results              []Result
	Total                int
	Passed               int
	Failed               int
	Skipped              int
	StopReason           string
	// Warnings holds parse warnings. They never affect the exit code.
	Warnings []string
}

func RunContext

func RunContext(ctx context.Context, opts Options) (*Report, error)

func RunPlan added in v0.29.1

func RunPlan(ctx context.Context, pl *Plan) (*Report, error)

func (*Report) Success

func (r *Report) Success() bool

func (*Report) WriteJSON

func (r *Report) WriteJSON(w io.Writer) error

func (*Report) WriteJUnit

func (r *Report) WriteJUnit(w io.Writer) error

func (*Report) WriteText

func (r *Report) WriteText(w io.Writer) error

type Result

type Result struct {
	Kind                 ResultKind
	Name                 string
	Method               string
	Target               string
	EffectiveTarget      string
	Environment          string
	EnvironmentSelection map[string]string
	Summary              string
	Duration             time.Duration
	Passed               bool
	Canceled             bool
	Response             *httpclient.Response
	GRPC                 *grpcclient.Response
	Err                  error
	Tests                []scripts.TestResult
	ScriptErr            error
	Skipped              bool
	SkipReason           string
	Stream               *StreamInfo
	Trace                *TraceInfo
	Compare              *CompareInfo
	Profile              *ProfileInfo
	Steps                []StepResult
	Failure              runfail.Failure
	// contains filtered or unexported fields
}

func (*Result) SetUnresolvedTemplateVars added in v0.28.1

func (r *Result) SetUnresolvedTemplateVars(items []string)

func (Result) Transcript added in v0.28.1

func (r Result) Transcript() []byte

func (Result) UnresolvedTemplateVars added in v0.28.1

func (r Result) UnresolvedTemplateVars() ([]string, bool)

type ResultKind

type ResultKind string
const (
	ResultKindRequest  ResultKind = "request"
	ResultKindWorkflow ResultKind = "workflow"
	ResultKindForEach  ResultKind = "for-each"
	ResultKindCompare  ResultKind = "compare"
	ResultKindProfile  ResultKind = "profile"
)

type Select

type Select struct {
	Request  string
	Workflow string
	Tag      string
	All      bool
	Line     int
}

type StepResult

type StepResult struct {
	Name                 string
	Method               string
	Target               string
	EffectiveTarget      string
	Environment          string
	EnvironmentSelection map[string]string
	Branch               string
	Iteration            int
	Total                int
	Summary              string
	Duration             time.Duration
	Response             *httpclient.Response
	GRPC                 *grpcclient.Response
	Err                  error
	Tests                []scripts.TestResult
	ScriptErr            error
	Passed               bool
	Skipped              bool
	SkipReason           string
	Canceled             bool
	Stream               *StreamInfo
	Trace                *TraceInfo
	Failure              runfail.Failure
	// contains filtered or unexported fields
}

type StreamInfo

type StreamInfo struct {
	Kind           string
	EventCount     int
	Summary        map[string]any
	TranscriptPath string
}

type TraceInfo

type TraceInfo struct {
	Summary      *history.TraceSummary
	ArtifactPath string
}

type UsageError

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

func (UsageError) Error

func (e UsageError) Error() string

func (UsageError) Unwrap

func (e UsageError) Unwrap() error

Jump to

Keyboard shortcuts

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