runner

package
v0.1.49 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Runner)

Option configures the Runner.

func WithCookieJar

func WithCookieJar(jar http.CookieJar) Option

WithCookieJar sets a cookie jar for cookie persistence across requests.

func WithEnvironment

func WithEnvironment(env *core.Environment) Option

WithEnvironment sets the environment for variable interpolation.

func WithHTTPClient

func WithHTTPClient(client *httpclient.Client) Option

WithHTTPClient sets a custom HTTP client.

func WithProgressCallback

func WithProgressCallback(cb ProgressCallback) Option

WithProgressCallback sets a callback for progress updates.

type ProgressCallback

type ProgressCallback func(current int, total int, result *RunResult)

ProgressCallback is called after each request is executed.

type RunResult

type RunResult struct {
	RequestID   string
	RequestName string
	Method      string
	URL         string
	Status      int
	StatusText  string
	Duration    time.Duration
	TestResults []script.TestResult
	Error       error
}

RunResult represents the result of a single request execution.

func (*RunResult) AllTestsPassed

func (r *RunResult) AllTestsPassed() bool

AllTestsPassed returns true if all tests passed.

func (*RunResult) IsSuccess

func (r *RunResult) IsSuccess() bool

IsSuccess returns true if the result had no errors.

type RunSummary

type RunSummary struct {
	CollectionName string
	TotalRequests  int
	Executed       int
	Passed         int
	Failed         int
	TotalTests     int
	TestsPassed    int
	TestsFailed    int
	TotalDuration  time.Duration
	Results        []RunResult
	StartTime      time.Time
	EndTime        time.Time
}

RunSummary represents the summary of a collection run.

func (*RunSummary) AllTestsPassed

func (s *RunSummary) AllTestsPassed() bool

AllTestsPassed returns true if all tests in the run passed.

func (*RunSummary) IsSuccess

func (s *RunSummary) IsSuccess() bool

IsSuccess returns true if all requests passed.

type Runner

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

Runner executes all requests in a collection.

func NewRunner

func NewRunner(collection *core.Collection, opts ...Option) *Runner

NewRunner creates a new collection runner.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context) *RunSummary

Run executes all requests in the collection sequentially.

Jump to

Keyboard shortcuts

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