report

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONReporter

type JSONReporter struct{}

JSONReporter renders plan results as JSON.

func (*JSONReporter) Render

func (jr *JSONReporter) Render(result *PlanResult, w io.Writer) error

Render implements Reporter.

type PlanResult

type PlanResult struct {
	Name     string        `json:"name"`
	Steps    []StepResult  `json:"steps"`
	Duration time.Duration `json:"duration"`
	Total    int           `json:"total"`
	Passed   int           `json:"passed"`
	Failed   int           `json:"failed"`
}

PlanResult aggregates all step results for a complete plan execution.

func (*PlanResult) Summary

func (p *PlanResult) Summary()

Summary computes the aggregate counts from all steps.

type Reporter

type Reporter interface {
	Render(result *PlanResult, w io.Writer) error
}

Reporter renders plan execution results to a writer.

type RequestResult

type RequestResult struct {
	StepName       string        `json:"stepName"`
	TaskName       string        `json:"taskName"`
	RequestName    string        `json:"requestName"`
	User           int           `json:"user"`
	Petition       int           `json:"petition"`
	Duration       time.Duration `json:"duration"`
	StatusCode     int           `json:"statusCode"`
	ExpectedStatus int           `json:"expectedStatus"`
	Err            error         `json:"-"`
	ErrMessage     string        `json:"error,omitempty"`
}

RequestResult captures the outcome of a single HTTP request within a step execution.

func (*RequestResult) Passed

func (r *RequestResult) Passed() bool

Passed returns true if the request status matched the expected status and no error occurred.

type StepResult

type StepResult struct {
	Name     string          `json:"name"`
	Results  []RequestResult `json:"results"`
	Duration time.Duration   `json:"duration"`
}

StepResult aggregates all request results for a single step execution.

func (*StepResult) Counts

func (s *StepResult) Counts() (total, passed, failed int)

Counts returns the total, passed, and failed counts for this step.

type TableReporter

type TableReporter struct {
	Verbose bool
	Quiet   bool
}

TableReporter renders plan results as an aligned text table.

func (*TableReporter) Render

func (tr *TableReporter) Render(result *PlanResult, w io.Writer) error

Render implements Reporter.

Jump to

Keyboard shortcuts

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