vacuum_report

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildJUnitReport added in v0.0.54

func BuildJUnitReport(resultSet *model.RuleResultSet, t time.Time) []byte

Types

type Failure added in v0.0.54

type Failure struct {
	Message  string `xml:"message,attr,omitempty"`
	Type     string `xml:"type,attr,omitempty"`
	Contents string `xml:",innerxml"`
}

type TestCase added in v0.0.54

type TestCase struct {
	Name      string   `xml:"name,attr"`
	ClassName string   `xml:"classname,attr"`
	Time      float64  `xml:"time,attr"`
	Failure   *Failure `xml:"failure,omitempty"`
}

type TestSuite added in v0.0.54

type TestSuite struct {
	XMLName   xml.Name    `xml:"testsuite"`
	Name      string      `xml:"name,attr"`
	Tests     int         `xml:"tests,attr"`
	Failures  int         `xml:"failures,attr"`
	Time      float64     `xml:"time,attr"`
	TestCases []*TestCase `xml:"testcase"`
}

type TestSuites added in v0.0.54

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

type VacuumReport

type VacuumReport struct {
	Generated  time.Time                 `json:"generated" yaml:"generated"`
	SpecInfo   *datamodel.SpecInfo       `json:"specInfo" yaml:"specInfo"`
	Statistics *reports.ReportStatistics `json:"statistics" yaml:"statistics"`
	ResultSet  *model.RuleResultSet      `json:"resultSet" yaml:"resultSet"`
}

VacuumReport is a serialized, ready to re-replay linting report. It can be used on its own, or it can be used as a replay model to re-render the report again. Time is now available to vacuum.

func BuildVacuumReportFromFile

func BuildVacuumReportFromFile(filePath string) (*VacuumReport, []byte, error)

BuildVacuumReportFromFile will attempt (at great speed) to read in a file as a Vacuum Report. If successful a pointer to a ready to run report is returned. If the file isn't a report, or can't be read and cannot be parsed then nil is returned. regardless of the outcome, if the file can be read, the bytes will be returned.

func CheckFileForVacuumReport

func CheckFileForVacuumReport(data []byte) (*VacuumReport, error)

CheckFileForVacuumReport will try to extract a vacuum report from a byte array. It checks if the file is compressed or not, then if it can be marshalled into a report.

Jump to

Keyboard shortcuts

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