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

report

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseJSONResult

func ParseJSONResult(baseResult *ReportElement) []byte

ParseJSONResult Print the result to the console

func ParseJSONStatsResult added in v1.2.8

func ParseJSONStatsResult(baseResult *ReportElement) []byte

ParseJSONResult Print the result to the console

func ParseJUnitResult

func ParseJUnitResult(baseResult *ReportElement) []byte

ParseJUnitResult Print the result to the console

Types

type JUnitReporter

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

type Report

type Report struct {
	StatsGroups int
	Version     string
	// contains filtered or unexported fields
}

func NewReport

func NewReport() *Report

func (Report) DidFail

func (r Report) DidFail() bool

DidFail, Check if the testsuite did produce failures

func (Report) GetLog

func (r Report) GetLog() []string

func (Report) GetTestResult

func (r Report) GetTestResult(parsingFunction func(baseResult *ReportElement) []byte) []byte

GetTestResult Parses the test report with the given function from the report root on

func (Report) Root

func (r Report) Root() *ReportElement

func (*Report) WriteToFile added in v0.90.0

func (r *Report) WriteToFile(reportFile, reportFormat string) error

WriteToFile write the report into the report file

type ReportElement

type ReportElement struct {
	Failures      int            `json:"failures"`
	TestCount     int            `json:"test_count,omitempty"`
	ExecutionTime time.Duration  `json:"execution_time_ns"`
	StartTime     time.Time      `json:"-"`
	Name          string         `json:"name,omitempty"`
	LogStorage    []string       `json:"log,omitempty"`
	SubTests      ReportElements `json:"sub_tests,omitempty"`
	Parent        *ReportElement `json:"-"`
	NoLogTime     bool           `json:"-"`
	Failure       string         `json:"failure,omitempty"`
	// contains filtered or unexported fields
}

func (ReportElement) GetLog

func (r ReportElement) GetLog() []string

func (*ReportElement) Leave

func (r *ReportElement) Leave(result bool)

func (*ReportElement) NewChild

func (r *ReportElement) NewChild(name string) (newElem *ReportElement)

NewChild create new report element and return its reference

func (*ReportElement) SaveToReportLog

func (r *ReportElement) SaveToReportLog(v string)

func (*ReportElement) SaveToReportLogF

func (r *ReportElement) SaveToReportLogF(v string, args ...any)

func (*ReportElement) SetName

func (r *ReportElement) SetName(name string)

type ReportElements

type ReportElements []*ReportElement

func (ReportElements) Flat

func (re ReportElements) Flat() ReportElements

type XMLRoot

type XMLRoot struct {
	XMLName    xml.Name    `xml:"testsuites"`
	Id         string      `xml:"id,attr"`
	Name       string      `xml:"name,attr"`
	Failures   int         `xml:"failures,attr"`
	Time       float64     `xml:"time,attr"`
	Tests      int         `xml:"tests,attr"`
	Testsuites []testsuite `xml:"testsuite"`
}

Jump to

Keyboard shortcuts

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