reporting

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatSummaryReport

func FormatSummaryReport(outcome *models.EvaluationOutcome) string

FormatSummaryReport produces a full plain-language report from an EvaluationOutcome.

func InterpretFlaky

func InterpretFlaky(flaky bool, passRate float64) string

InterpretFlaky explains whether results are flaky and what that means.

func InterpretPassRate

func InterpretPassRate(rate float64) string

InterpretPassRate returns a human-readable explanation of a pass rate (0–1).

func InterpretScore

func InterpretScore(score float64) string

InterpretScore returns a plain-language label for a numeric score (0–1).

func WriteJUnitXML

func WriteJUnitXML(outcome *models.EvaluationOutcome, path string) error

WriteJUnitXML writes JUnit XML to the specified file path.

Types

type JUnitError

type JUnitError struct {
	Message string `xml:"message,attr"`
	Type    string `xml:"type,attr"`
	Body    string `xml:",chardata"`
}

JUnitError represents an unexpected error during test execution.

type JUnitFailure

type JUnitFailure struct {
	Message string `xml:"message,attr"`
	Type    string `xml:"type,attr"`
	Body    string `xml:",chardata"`
}

JUnitFailure represents a test assertion failure.

type JUnitProperty

type JUnitProperty struct {
	Name  string `xml:"name,attr"`
	Value string `xml:"value,attr"`
}

JUnitProperty is a key-value metadata entry.

type JUnitSkipped

type JUnitSkipped struct {
	Message string `xml:"message,attr,omitempty"`
}

JUnitSkipped marks a test as skipped.

type JUnitTestCase

type JUnitTestCase struct {
	XMLName   xml.Name      `xml:"testcase"`
	Name      string        `xml:"name,attr"`
	Classname string        `xml:"classname,attr"`
	Time      float64       `xml:"time,attr"`
	Failure   *JUnitFailure `xml:"failure,omitempty"`
	Error     *JUnitError   `xml:"error,omitempty"`
	Skipped   *JUnitSkipped `xml:"skipped,omitempty"`
}

JUnitTestCase maps to one eval task.

type JUnitTestSuite

type JUnitTestSuite struct {
	XMLName    xml.Name        `xml:"testsuite"`
	Name       string          `xml:"name,attr"`
	Tests      int             `xml:"tests,attr"`
	Failures   int             `xml:"failures,attr"`
	Errors     int             `xml:"errors,attr"`
	Skipped    int             `xml:"skipped,attr"`
	Time       float64         `xml:"time,attr"`
	Timestamp  string          `xml:"timestamp,attr"`
	Properties []JUnitProperty `xml:"properties>property,omitempty"`
	TestCases  []JUnitTestCase `xml:"testcase"`
}

JUnitTestSuite maps to one evaluation run.

type JUnitTestSuites

type JUnitTestSuites struct {
	XMLName    xml.Name         `xml:"testsuites"`
	Tests      int              `xml:"tests,attr"`
	Failures   int              `xml:"failures,attr"`
	Errors     int              `xml:"errors,attr"`
	Time       float64          `xml:"time,attr"`
	TestSuites []JUnitTestSuite `xml:"testsuite"`
}

JUnitTestSuites is the top-level container.

func ConvertToJUnit

func ConvertToJUnit(outcome *models.EvaluationOutcome) *JUnitTestSuites

ConvertToJUnit converts an EvaluationOutcome to JUnit XML format.

Jump to

Keyboard shortcuts

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