internal

package
v2.17.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

this file was originally taken from the gocovmerge project see also: https://go.shabbyrobe.org/gocovmerge

Index

Constants

View Source
const EMPTY_SKIP_FAILURE_REASON = "Suite did not run go test reported that no test files were found"
View Source
const PRIOR_FAILURES_FAILURE_REASON = "Suite did not run because prior suites failed and --keep-going is not set"
View Source
const TIMEOUT_ELAPSED_FAILURE_REASON = "Suite did not run because the timeout elapsed"

Variables

Functions

func AbsPathForGeneratedAsset

func AbsPathForGeneratedAsset(assetName string, suite TestSuite, cliConfig types.CLIConfig, process int) string

func AddCoverProfile added in v2.16.0

func AddCoverProfile(profiles []*cover.Profile, p *cover.Profile) []*cover.Profile

func Cleanup

func Cleanup(goFlagsConfig types.GoFlagsConfig, suites ...TestSuite)

func CopyFile

func CopyFile(src string, dest string) error

func DumpCoverProfiles added in v2.16.0

func DumpCoverProfiles(profiles []*cover.Profile, out io.Writer) error

func FailedSuitesReport

func FailedSuitesReport(suites TestSuites, f formatter.Formatter) string

func FileExists

func FileExists(path string) bool

func FinalizeProfilesAndReportsForSuites

func FinalizeProfilesAndReportsForSuites(suites TestSuites, cliConfig types.CLIConfig, suiteConfig types.SuiteConfig, reporterConfig types.ReporterConfig, goFlagsConfig types.GoFlagsConfig) ([]string, error)

func GetCoverageFromCoverProfile

func GetCoverageFromCoverProfile(profile string) (float64, error)

func GoFmt

func GoFmt(path string)

func MergeAndCleanupCoverProfiles

func MergeAndCleanupCoverProfiles(profiles []string, destination string) error

loads each profile, merges them, deletes them, stores them in destination

func MergeCoverProfiles added in v2.16.0

func MergeCoverProfiles(into *cover.Profile, merge *cover.Profile) error

func MergeProfiles

func MergeProfiles(profilePaths []string, destination string) error

func PluralizedWord

func PluralizedWord(singular, plural string, count int) string

func VerifyCLIAndFrameworkVersion added in v2.3.1

func VerifyCLIAndFrameworkVersion(suites TestSuites)

Types

type OrderedParallelCompiler

type OrderedParallelCompiler struct {
	// contains filtered or unexported fields
}

func NewOrderedParallelCompiler

func NewOrderedParallelCompiler(numCompilers int) *OrderedParallelCompiler

func (*OrderedParallelCompiler) Next

func (opc *OrderedParallelCompiler) Next() (int, TestSuite)

func (*OrderedParallelCompiler) StartCompiling

func (opc *OrderedParallelCompiler) StartCompiling(suites TestSuites, goFlagsConfig types.GoFlagsConfig)

func (*OrderedParallelCompiler) StopAndDrain

func (opc *OrderedParallelCompiler) StopAndDrain()

type TestSuite

type TestSuite struct {
	Path        string
	PackageName string
	IsGinkgo    bool

	Precompiled        bool
	PathToCompiledTest string
	CompilationError   error

	HasProgrammaticFocus bool
	State                TestSuiteState
}

func CompileSuite

func CompileSuite(suite TestSuite, goFlagsConfig types.GoFlagsConfig) TestSuite

func RunCompiledSuite

func RunCompiledSuite(suite TestSuite, ginkgoConfig types.SuiteConfig, reporterConfig types.ReporterConfig, cliConfig types.CLIConfig, goFlagsConfig types.GoFlagsConfig, additionalArgs []string) TestSuite

func (TestSuite) AbsPath

func (ts TestSuite) AbsPath() string

func (TestSuite) NamespacedName

func (ts TestSuite) NamespacedName() string

type TestSuiteState

type TestSuiteState uint
const (
	TestSuiteStateInvalid TestSuiteState = iota

	TestSuiteStateUncompiled
	TestSuiteStateCompiled

	TestSuiteStatePassed

	TestSuiteStateSkippedDueToEmptyCompilation
	TestSuiteStateSkippedByFilter
	TestSuiteStateSkippedDueToPriorFailures

	TestSuiteStateFailed
	TestSuiteStateFailedDueToTimeout
	TestSuiteStateFailedToCompile
)

func (TestSuiteState) Is

func (state TestSuiteState) Is(states ...TestSuiteState) bool

type TestSuites

type TestSuites []TestSuite

func FindSuites

func FindSuites(args []string, cliConfig types.CLIConfig, allowPrecompiled bool) TestSuites

func (TestSuites) AnyHaveProgrammaticFocus

func (ts TestSuites) AnyHaveProgrammaticFocus() bool

func (TestSuites) CountWithState

func (ts TestSuites) CountWithState(states ...TestSuiteState) int

func (TestSuites) ShuffledCopy

func (ts TestSuites) ShuffledCopy(seed int64) TestSuites

func (TestSuites) ThatAreGinkgoSuites

func (ts TestSuites) ThatAreGinkgoSuites() TestSuites

func (TestSuites) WithState

func (ts TestSuites) WithState(states ...TestSuiteState) TestSuites

func (TestSuites) WithoutState

func (ts TestSuites) WithoutState(states ...TestSuiteState) TestSuites

Jump to

Keyboard shortcuts

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