outputs

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatOptions

func FormatOptions() []string

FormatOptions returns a sorted list of all the valid options that outputers accept

func IsValidFormat

func IsValidFormat(f string) bool

IsValidFormat determines if f is a valid format name based on Outputers()

func MetricsRegistry

func MetricsRegistry(outConfig util.OutputConfig) *prometheus.Registry

MetricsRegistry returns the private registry that the prometheus outputter records into, initialising it if it does not exist yet.

It exists so `serve`'s /metrics endpoint can expose the same metrics the prometheus output format produces. Previously serve.go handed /metrics the default global registry, which these metrics are never registered into (they go into the private registry created below), so /metrics could only ever return zero occurrences of goss_tests_outcomes_total.

Note the label cardinality is fixed by whichever caller initialises the registry first — the same first-call-wins behaviour Output() already had. Callers should pass the process-level OutputConfig so this is deterministic.

func Outputers

func Outputers() []string

Outputers returns a sorted list of the names of the registered outputers.

func RegisterOutputer

func RegisterOutputer(name string, outputer Outputer)

Types

type Discovery

type Discovery struct{}

func (Discovery) Output

func (r Discovery) Output(w io.Writer, discovered map[string]bool, outConfig util.OutputConfig) int

func (Discovery) ValidOptions

func (r Discovery) ValidOptions() []*formatOption

type Documentation

type Documentation struct{}

func (Documentation) Output

func (r Documentation) Output(w io.Writer, results <-chan []resource.TestResult,
	outConfig util.OutputConfig) (exitCode int)

func (Documentation) ValidOptions

func (r Documentation) ValidOptions() []*formatOption

type JUnit

type JUnit struct{}

func (JUnit) Output

func (r JUnit) Output(w io.Writer, results <-chan []resource.TestResult,
	outConfig util.OutputConfig) (exitCode int)

func (JUnit) ValidOptions

func (r JUnit) ValidOptions() []*formatOption

type Json

type Json struct{}

func (Json) Output

func (r Json) Output(w io.Writer, results <-chan []resource.TestResult,
	outConfig util.OutputConfig) (exitCode int)

func (Json) ValidOptions

func (r Json) ValidOptions() []*formatOption

type Nagios

type Nagios struct{}

func (Nagios) Output

func (r Nagios) Output(w io.Writer, results <-chan []resource.TestResult,
	outConfig util.OutputConfig) (exitCode int)

func (Nagios) ValidOptions

func (r Nagios) ValidOptions() []*formatOption

type Outputer

type Outputer interface {
	Output(io.Writer, <-chan []resource.TestResult, util.OutputConfig) int
	ValidOptions() []*formatOption
}

func GetOutputer

func GetOutputer(name string) (Outputer, error)

type Prometheus

type Prometheus struct{}

Prometheus renders metrics in prometheus.io text-format https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format

func (Prometheus) Output

func (r Prometheus) Output(w io.Writer, results <-chan []resource.TestResult,
	outConfig util.OutputConfig) (exitCode int)

Output converts the results into the prometheus text-format.

func (Prometheus) ValidOptions

func (r Prometheus) ValidOptions() []*formatOption

ValidOptions is a list of valid format options for prometheus

type Rspecish

type Rspecish struct{}

func (Rspecish) Output

func (r Rspecish) Output(w io.Writer, results <-chan []resource.TestResult,
	outConfig util.OutputConfig) (exitCode int)

func (Rspecish) ValidOptions

func (r Rspecish) ValidOptions() []*formatOption

type Silent

type Silent struct{}

func (Silent) Output

func (r Silent) Output(w io.Writer, results <-chan []resource.TestResult,
	outConfig util.OutputConfig) (exitCode int)

func (Silent) ValidOptions

func (r Silent) ValidOptions() []*formatOption

type StructureTestSummary

type StructureTestSummary struct {
	TestCount     int           `json:"test-count"`
	Failed        int           `json:"failed-count"`
	TotalDuration time.Duration `json:"total-duration"`
}

StructureTestSummary holds summary information about a test run

func (*StructureTestSummary) String

func (s *StructureTestSummary) String() string

String represents human friendly representation of the test summary

type Structured

type Structured struct{}

Structured is a output formatter that logs into a StructuredOutput structure

func (Structured) Output

func (r Structured) Output(w io.Writer, results <-chan []resource.TestResult, outConfig util.OutputConfig) (exitCode int)

Output processes output from tests into StructuredOutput written to w as a string

func (Structured) ValidOptions

func (r Structured) ValidOptions() []*formatOption

type StructuredOutput

type StructuredOutput struct {
	Results     []StructuredTestResult `json:"results"`
	Summary     StructureTestSummary   `json:"summary"`
	SummaryLine string                 `json:"summary-line"`
}

StructuredOutput is the full output structure for the structured output format

type StructuredTestResult

type StructuredTestResult struct {
	resource.TestResult
	SummaryLine        string `json:"summary-line"`
	SummaryLineCompact string `json:"summary-line-compact"`
}

StructuredTestResult is an individual test result with additional human friendly summary

type Tap

type Tap struct{}

func (Tap) Output

func (r Tap) Output(w io.Writer, results <-chan []resource.TestResult,
	outConfig util.OutputConfig) (exitCode int)

func (Tap) ValidOptions

func (r Tap) ValidOptions() []*formatOption

Jump to

Keyboard shortcuts

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