report

package
v0.59.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 26 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomMetric added in v0.51.0

type CustomMetric struct {
	Key   string  `json:"key"`
	Name  string  `json:"name,omitempty"`
	Value float64 `json:"value"`
	Unit  string  `json:"unit,omitempty"`
}

func (*CustomMetric) Compare added in v0.51.0

func (m *CustomMetric) Compare(m2 *CustomMetric) *DiffCustomMetric

type CustomMetricSet added in v0.51.0

type CustomMetricSet struct {
	Key      string          `json:"key"`
	Name     string          `json:"name,omitempty"`
	Metadata []*MetadataKV   `json:"metadata,omitempty"`
	Metrics  []*CustomMetric `json:"metrics"`
	// contains filtered or unexported fields
}

func (*CustomMetricSet) Compare added in v0.51.0

func (*CustomMetricSet) MetadataTable added in v0.52.0

func (s *CustomMetricSet) MetadataTable() string

func (*CustomMetricSet) Out added in v0.51.0

func (s *CustomMetricSet) Out(w io.Writer) error

func (*CustomMetricSet) Table added in v0.51.0

func (s *CustomMetricSet) Table() string

func (*CustomMetricSet) Validate added in v0.51.0

func (s *CustomMetricSet) Validate() error

type DiffCustomMetric added in v0.51.0

type DiffCustomMetric struct {
	Key  string   `json:"key"`
	Name string   `json:"name,omitempty"`
	A    *float64 `json:"a"`
	B    *float64 `json:"b"`
	Diff float64  `json:"diff"`
	// contains filtered or unexported fields
}

type DiffCustomMetricSet added in v0.51.0

type DiffCustomMetricSet struct {
	Key     string              `json:"key"`
	Name    string              `json:"name,omitempty"`
	A       *CustomMetricSet    `json:"a"`
	B       *CustomMetricSet    `json:"b"`
	Metrics []*DiffCustomMetric `json:"metrics"`
}

func (*DiffCustomMetricSet) MetadataTable added in v0.52.0

func (d *DiffCustomMetricSet) MetadataTable() string

func (*DiffCustomMetricSet) Table added in v0.51.0

func (d *DiffCustomMetricSet) Table() string

type DiffReport added in v0.20.0

type DiffReport struct {
	RepositoryA       string                 `json:"repository_a"`
	RepositoryB       string                 `json:"repository_b"`
	RefA              string                 `json:"ref_a"`
	RefB              string                 `json:"ref_b"`
	CommitA           string                 `json:"commit_a"`
	CommitB           string                 `json:"commit_b"`
	Coverage          *coverage.DiffCoverage `json:"coverage,omitempty"`
	CodeToTestRatio   *ratio.DiffRatio       `json:"code_to_test_ratio,omitempty"`
	TestExecutionTime *DiffTestExecutionTime `json:"test_execution_time,omitempty"`
	CustomMetrics     []*DiffCustomMetricSet `json:"custom_metrics,omitempty"`
	TimestampA        time.Time              `json:"timestamp_a"`
	TimestampB        time.Time              `json:"timestamp_b"`
	ReportA           *Report                `json:"-"`
	ReportB           *Report                `json:"-"`
}

func (*DiffReport) FileCoveragesTable added in v0.58.1

func (d *DiffReport) FileCoveragesTable(files []*gh.PullRequestFile) string

func (*DiffReport) Out added in v0.20.0

func (d *DiffReport) Out(w io.Writer)

func (*DiffReport) Table added in v0.20.0

func (d *DiffReport) Table() string

type DiffTestExecutionTime added in v0.20.0

type DiffTestExecutionTime struct {
	A                  *float64 `json:"a"`
	B                  *float64 `json:"b"`
	Diff               float64  `json:"diff"`
	TestExecutionTimeA *float64 `json:"-"`
	TestExecutionTimeB *float64 `json:"-"`
}

type MetadataKV added in v0.52.0

type MetadataKV struct {
	Key   string `json:"key"`
	Name  string `json:"name,omitempty"`
	Value string `json:"value"`
}

type Option added in v0.56.0

type Option func(*Options)

func Locale added in v0.56.0

func Locale(locale *language.Tag) Option

type Options added in v0.56.0

type Options struct {
	Locale *language.Tag
}

type Report

type Report struct {
	Repository        string             `json:"repository"`
	Ref               string             `json:"ref"`
	Commit            string             `json:"commit"`
	Coverage          *coverage.Coverage `json:"coverage,omitempty"`
	CodeToTestRatio   *ratio.Ratio       `json:"code_to_test_ratio,omitempty"`
	TestExecutionTime *float64           `json:"test_execution_time,omitempty"`
	Timestamp         time.Time          `json:"timestamp"`
	CustomMetrics     []*CustomMetricSet `json:"custom_metrics,omitempty"`
	// contains filtered or unexported fields
}

func New

func New(ownerrepo string, opts ...Option) (*Report, error)

func (*Report) Bytes added in v0.13.0

func (r *Report) Bytes() []byte

func (*Report) CodeToTestRatioRatio added in v0.6.0

func (r *Report) CodeToTestRatioRatio() float64

func (*Report) CollectCustomMetrics added in v0.51.0

func (r *Report) CollectCustomMetrics() error

CollectCustomMetrics collects custom metrics from env.

func (*Report) Compare added in v0.20.0

func (r *Report) Compare(r2 *Report) *DiffReport

func (*Report) CountMeasured added in v0.12.0

func (r *Report) CountMeasured() int

func (*Report) CoveragePercent

func (r *Report) CoveragePercent() float64

func (*Report) FileCoveragesTable added in v0.58.1

func (r *Report) FileCoveragesTable(files []*gh.PullRequestFile) string

func (*Report) IsCollectedCustomMetrics added in v0.51.0

func (r *Report) IsCollectedCustomMetrics() bool

func (*Report) IsMeasuredCodeToTestRatio added in v0.12.0

func (r *Report) IsMeasuredCodeToTestRatio() bool

func (*Report) IsMeasuredCoverage added in v0.12.0

func (r *Report) IsMeasuredCoverage() bool

func (*Report) IsMeasuredTestExecutionTime added in v0.12.0

func (r *Report) IsMeasuredTestExecutionTime() bool

func (*Report) Key added in v0.40.0

func (r *Report) Key() string

func (*Report) Load added in v0.31.0

func (r *Report) Load(path string) error

func (*Report) MeasureCodeToTestRatio added in v0.6.0

func (r *Report) MeasureCodeToTestRatio(root string, code, test []string) error

func (*Report) MeasureCoverage

func (r *Report) MeasureCoverage(paths, exclude []string) error

func (*Report) MeasureTestExecutionTime added in v0.7.0

func (r *Report) MeasureTestExecutionTime(ctx context.Context, stepNames []string) error

func (*Report) Out added in v0.20.0

func (r *Report) Out(w io.Writer) error

func (*Report) String

func (r *Report) String() string

func (*Report) Table added in v0.11.0

func (r *Report) Table() string

func (*Report) TestExecutionTimeNano added in v0.29.0

func (r *Report) TestExecutionTimeNano() float64

func (*Report) Title added in v0.40.0

func (r *Report) Title() string

func (*Report) UnmarshalJSON added in v0.51.0

func (r *Report) UnmarshalJSON(b []byte) error

func (*Report) Validate added in v0.2.0

func (r *Report) Validate() error

Jump to

Keyboard shortcuts

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