Help us shape the future of Go! Take the 2026 Go Developer Survey

report

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JUnitReportFile          = "junit-reports.xml"
	XMLProcessingInstruction = `<?xml version="1.0" encoding="UTF-8"?>`
)
View Source
const (
	JSONReportFile = "test-reports.json"
)

Variables

This section is empty.

Functions

func AppendSummary added in v0.3.0

func AppendSummary(overall *v1alpha1.TestSummary, summary *v1alpha1.TestSummary)

func AppendTestResults

func AppendTestResults(suites *v1alpha1.TestSuite, suite v1alpha1.TestSuite)

func CleanReports

func CleanReports() error

func GenerateReport

func GenerateReport(out io.Writer, errorOut io.Writer, results *v1alpha1.TestResults, output OutputFormat)

func GetErrorResult added in v0.3.0

func GetErrorResult(namespace string, source string, err error) *v1alpha1.Test

func GetErrorType added in v0.3.0

func GetErrorType(err error) string

func GetSummaryReport

func GetSummaryReport(results *v1alpha1.TestResults) string

func LoadTestResults

func LoadTestResults() (*v1alpha1.TestResults, error)

func PrintSummaryReport

func PrintSummaryReport(results *v1alpha1.TestResults)

func SaveTestResults

func SaveTestResults(test *v1alpha1.Test) error

Types

type Error added in v0.2.0

type Error struct {
	XMLName    xml.Name `xml:"error,omitempty"`
	Message    string   `xml:"message,attr,omitempty"`
	Type       string   `xml:"type,attr,omitempty"`
	Stacktrace string   `xml:",chardata"`
}

type Failure

type Failure struct {
	XMLName    xml.Name `xml:"failure,omitempty"`
	Message    string   `xml:"message,attr,omitempty"`
	Type       string   `xml:"type,attr,omitempty"`
	Stacktrace string   `xml:",chardata"`
}

type JUnitReport

type JUnitReport struct {
	Suite []TestSuite `xml:"testsuite"`
}

type OutputFormat

type OutputFormat string
const (
	OutputDir = "_output"

	DefaultOutput OutputFormat = ""
	JSONOutput    OutputFormat = "json"
	JUnitOutput   OutputFormat = "junit"
	SummaryOutput OutputFormat = "summary"
)

func (*OutputFormat) Set

func (d *OutputFormat) Set(s string) error

Set implements pflag/flag.Value.

func (*OutputFormat) String

func (d *OutputFormat) String() string

Type implements pflag/flag.Value.

func (*OutputFormat) Type

func (d *OutputFormat) Type() string

Type implements pflag.Value.

type TestCase

type TestCase struct {
	Name      string  `xml:"name,attr"`
	ClassName string  `xml:"classname,attr"`
	Time      float32 `xml:"time,attr"`
	SystemOut string  `xml:"system-out,omitempty"`
	Failure   *Failure
	Error     *Error
}

type TestSuite

type TestSuite struct {
	Name     string     `xml:"name,attr"`
	Errors   int        `xml:"errors,attr"`
	Failures int        `xml:"failures,attr"`
	Skipped  int        `xml:"skipped,attr"`
	Tests    int        `xml:"tests,attr"`
	Time     float32    `xml:"time,attr"`
	TestCase []TestCase `xml:"testcase"`
}

Jump to

Keyboard shortcuts

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