testutil

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IsTesting       = strings.HasSuffix(os.Args[0], ".test")
	IsGithubActions = os.Getenv("GITHUB_ACTIONS") == "true"
	IsDrone         = os.Getenv("DRONE") == "true"
	StdoutWriter    = lo.Ternary[io.Writer](IsTesting, ginkgo.GinkgoWriter, os.Stdout)
	StderrWriter    = lo.Ternary[io.Writer](IsTesting, ginkgo.GinkgoWriter, os.Stderr)
)

Functions

func IfCI

func IfCI[T any](t T) ifExpr[T]

func IfTesting

func IfTesting[T any](t T) ifExpr[T]

func MergeCoverProfiles added in v0.4.2

func MergeCoverProfiles(filenames []string, output io.Writer, opts ...ProfileOption) error

func Must

func Must[T any](t T, err ...error) T

Types

type ProfileOption added in v0.4.2

type ProfileOption func(*ProfileOptions)

func WithExcludePatterns added in v0.4.2

func WithExcludePatterns(excludePatterns ...string) ProfileOption

func WithKeepMergedProfiles added in v0.4.2

func WithKeepMergedProfiles(keep bool) ProfileOption

type ProfileOptions added in v0.4.2

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

func (*ProfileOptions) Apply added in v0.4.2

func (o *ProfileOptions) Apply(opts ...ProfileOption)

type Session

type Session interface {
	G() (*gexec.Session, bool)
	Wait() error
}

func StartCmd

func StartCmd(cmd *exec.Cmd) (Session, error)

Jump to

Keyboard shortcuts

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