reporter

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorNothingToReport error = errors.New("no error in test to report")

Functions

func FilterCommit

func FilterCommit(commit string) filterOption

func FilterFrom

func FilterFrom(from time.Time) filterOption

func FilterFromDaysAgo

func FilterFromDaysAgo(days int) filterOption

func FilterPR

func FilterPR(pr string) filterOption

func FilterTestSuite

func FilterTestSuite(testsuite string) filterOption

func FilterTo

func FilterTo(to time.Time) filterOption

func FilterToDaysAgo

func FilterToDaysAgo(days int) filterOption

func ImportFromLocalDirectory

func ImportFromLocalDirectory(dir string) filterOption

func LoadZippedArtifactsFromDirectory

func LoadZippedArtifactsFromDirectory(dir string) ([]artifact, error)

LoadZippedArtifactsFromDirectory takes the directory of the artifacts and unwraps the zip files in it. Artifact zip files are expected to be in a flat directory. Failed to unwrap an artifact does not stop the entire operation. The results will just not be included in the artifact.

func RepositoryInfo

func RepositoryInfo(owner, name string) filterOption

func Unzip

func Unzip(src string) ([]byte, error)

func WaitWaitForQuotaReset

func WaitWaitForQuotaReset(waitForReset bool) filterOption

func WithTempDownloadDir

func WithTempDownloadDir(tmpDir string) filterOption

WithTempDownloadDir specify the directory where artifacts will be temprarily downloaded for use.

func WithToken

func WithToken(token string) filterOption

Types

type FlakeReport

type FlakeReport struct {
	TotalTestCount   int         `json:"total_test_count"`      // All imported test reports
	FailedTestCount  int         `json:"failed_test_count"`     // All imported test reports have failures
	FlakeTestCount   int         `json:"flake_test_count"`      // Number of test suit report
	SkippedTestCount int         `json:"skipped_test_count"`    // Number of test suit report
	FlakeTests       []TestEntry `json:"flake_tests",omitempty` // Sorted by counts and number of commits
	SkippedTests     []TestEntry `json:"skipped_tests",omitempty`
	// contains filtered or unexported fields
}

func NewFlakeReport

func NewFlakeReport() *FlakeReport

func (*FlakeReport) GenerateReport

func (f *FlakeReport) GenerateReport(outputFile string) ([]byte, error)

GenerateReport sorts the report and converts the tests from map to arrays for print out. It generates a yaml report.

func (*FlakeReport) LoadReport

func (f *FlakeReport) LoadReport(option ...filterOption) error

func (*FlakeReport) PostReportAsPullRequestComment

func (f *FlakeReport) PostReportAsPullRequestComment(option ...filterOption) (*string, error)

type HtmlFlakeReport

type HtmlFlakeReport struct {
	TotalTestCount   int             `json:"total_test_count",omitempty` // All imported test reports have failures
	FailedTestCount  int             `json:"failed_test_count",omitempty`
	FlakeTestCount   int             `json:"flake_test_count",omitempty`   // Number of test suit report
	SkippedTestCount int             `json:"skipped_test_count",omitempty` // Number of test suit report
	FlakeTests       []HtmlTestEntry `json:"flake_tests",omitempty`        // Sorted by counts and number of commits
	SkippedTests     []HtmlTestEntry `json:"skipped_tests",omitempty`
}

type HtmlTestDetail

type HtmlTestDetail struct {
	Count int    `json:"count"`
	Error string `json:"error",omitempty`
}

type HtmlTestEntry

type HtmlTestEntry struct {
	ClassName       string           `json:"class_name"`
	Name            string           `json:"name"`
	Counts          int              `json:"counts"`
	Details         []HtmlTestDetail `json:"details",omitempty`
	MeanDurationSec float64          `json:"mean_duration_sec"`
}

type TestDetail

type TestDetail struct {
	Count     int    `json:"count"`
	Error     error  `json:"error",omitempty`
	SystemOut string `json:"system_out",omitempty`
	SystemErr string `json:"system_err",omitempty`
}

type TestEntry

type TestEntry struct {
	ClassName       string       `json:"class_name"`
	Name            string       `json:"name"`
	Counts          int          `json:"counts"`
	Details         []TestDetail `json:"details",omitempty`
	Commits         []string     `json:"commits"`
	MeanDurationSec float64      `json:"mean_duration_sec"`
}

Jump to

Keyboard shortcuts

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