report

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const NonBreakingSpace = " "

Variables

This section is empty.

Functions

func CreateReport

func CreateReport(result Result, out io.Writer, temp *template.Template) (err error)

func EscapeHtml

func EscapeHtml(input string) (escapedHtml string)

func EscapeMarkdown

func EscapeMarkdown(input string) (escapedMarkdown string)

func GetTemplate

func GetTemplate(pathToTemplate string) (tmp *template.Template, err error)

func IsLess

func IsLess(a_PackageResult, b_PackageResult FinalTestStatus, a_Duration, b_Duration time.Duration) bool

Types

type FinalTestStatus

type FinalTestStatus uint8
const (
	FTPSSkip FinalTestStatus = iota
	FTSPass
	FTSFail
)

func FinalTestStatusFromAction

func FinalTestStatusFromAction(e TestAction) *FinalTestStatus

func (FinalTestStatus) Icon

func (fs FinalTestStatus) Icon() string

func (FinalTestStatus) String

func (fs FinalTestStatus) String() string

type OutputLine

type OutputLine struct {
	Time time.Time
	Text string
}

type PackageName

type PackageName string

func (PackageName) Package

func (p PackageName) Package() string

func (PackageName) Path

func (p PackageName) Path() string

type PackageResult

type PackageResult struct {
	Name          PackageName
	Duration      time.Duration
	PackageResult FinalTestStatus
	Succeeded     int
	Tests         []TestResult
}

func (PackageResult) String

func (p PackageResult) String() string

type Result

type Result struct {
	Failed        uint
	Passed        uint
	Skipped       uint
	Tests         uint
	Duration      time.Duration
	PackageResult []PackageResult
	Vars          map[string]string
}

func ParseTestJson

func ParseTestJson(in io.Reader) (result Result, err error)

type TestAction

type TestAction uint8
const (
	TAUnknown TestAction = iota
	TARun                // the test has started running
	TAPause              // the test has been paused
	TACont               // the test has continued running
	TAPass               // the test passed
	TABench              // the benchmark printed log output but did not fail
	TAFail               // the test or benchmark failed
	TAOutput             // the test printed output
	TASkip               // the test was skipped or the package contained no tests
)

func TestActionFromString

func TestActionFromString(s string) TestAction

func (TestAction) String

func (ta TestAction) String() string

func (*TestAction) UnmarshalJSON

func (b *TestAction) UnmarshalJSON(data []byte) error

type TestEvent

type TestEvent struct {
	Time       time.Time  `json:"time,omitempty"` // encodes as an RFC3339-format string
	Action     TestAction `json:"action,omitempty"`
	Package    string     `json:"package,omitempty"`
	Test       string     `json:"test,omitempty"`
	ElapsedSec float64    `json:"elapsed,omitempty"` // seconds
	Output     string     `json:"output,omitempty"`
}

Test event represents a single json test output line. Implements the marshaller interface From https://pkg.go.dev/cmd/test2json

type TestResult

type TestResult struct {
	Name       string
	Duration   time.Duration
	Output     []OutputLine
	TestResult FinalTestStatus
}

Jump to

Keyboard shortcuts

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