gocover

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultReportFormat     = "html"
	DefaultCompareBranch    = "origin/master"
	DefaultCoverageBaseline = 80.0
)

Variables

View Source
var (
	ErrModuleNotFound = errors.New("cannot find module path")
)
View Source
var ErrUnknownCoverageMode = errors.New("unknown coverage mode")

Functions

func NewGoCoverTest

func NewGoCoverTest(o *GoCoverTestOption) (*goCoverTest, error)

Types

type CoverageMode

type CoverageMode string
const (
	FullCoverage CoverageMode = "full"
	DiffCoverage CoverageMode = "diff"
)

type DiffOption

type DiffOption struct {
	CoverProfiles  []string
	CompareBranch  string
	RepositoryPath string
	ModuleDir      string
	ModulePath     string

	CoverageBaseline float64
	ReportFormat     string
	ReportName       string
	OutputDir        string
	Excludes         []string
	Style            string

	DbOption *dbclient.DBOption

	Logger logrus.FieldLogger
}

DiffOption contains the input to the gocover diff command.

func NewDiffOption

func NewDiffOption() *DiffOption

NewDiffOptions returns a Options with default values.

func (*DiffOption) Validate

func (o *DiffOption) Validate() error

type FullOption

type FullOption struct {
	CoverProfiles  []string
	RepositoryPath string
	ModuleDir      string

	CoverageBaseline float64
	ReportFormat     string
	ReportName       string
	OutputDir        string
	Excludes         []string
	Style            string

	DbOption *dbclient.DBOption

	Logger logrus.FieldLogger
}

FullOption contains the input for gocover full command.

func NewFullOption

func NewFullOption() *FullOption

NewDiffOption returns a Full Option with default values.

func (*FullOption) Validate

func (o *FullOption) Validate() error

type GoCover

type GoCover interface {
	Run(ctx context.Context) error
}

func NewDiffCover

func NewDiffCover(o *DiffOption) (GoCover, error)

func NewFullCover

func NewFullCover(o *FullOption) (GoCover, error)

type GoCoverTestOption

type GoCoverTestOption struct {
	CoverProfiles  []string
	CompareBranch  string
	RepositoryPath string
	ModuleDir      string
	ModulePath     string
	CoverageMode   CoverageMode

	CoverageBaseline float64
	ReportFormat     string
	ReportName       string
	OutputDir        string
	Excludes         []string
	Style            string

	DbOption *dbclient.DBOption

	StdOut io.Writer
	StdErr io.Writer
	Logger logrus.FieldLogger
}

GoCoverTestOption contains the input to the gocover govtest command.

func NewGoCoverTestOption

func NewGoCoverTestOption() *GoCoverTestOption

NewGoCoverTestOption returns a Options with default values.

Jump to

Keyboard shortcuts

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