util

package
v2.21.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendReport

func AppendReport(report, toAppend *reporters.JUnitTestSuite)

AppendReport appends a reporters.JUnitTestSuite to another. During that process, test cases are deduplicated (identified via their name). Successful or failing test cases always take precedence over skipped test cases.

func JUnitWrapper

func JUnitWrapper(testCaseName string, report *reporters.JUnitTestSuite, executor func() error, extraErrOutputFn ...func() string) error

JUnitWrapper is a convenience func to get junit results for a step It will create a report, append it to the passed in testsuite and propagate the error of the executor back up TODO: Should we add optional retrying here to limit the amount of wrappers we need?

func MeasuredRetryN

func MeasuredRetryN(
	runtimeMetric *prometheus.GaugeVec,

	attemptsMetric prometheus.Gauge,
	log *zap.SugaredLogger,
	delay time.Duration,
	maxAttempts int,
	f func(attempt int) error,
) func() error

measuredRetryN wraps retryNAttempts with code that counts the executed number of attempts and the runtimes for each attempt.

func NodeIsReady

func NodeIsReady(node corev1.Node) bool

func PodIsReady

func PodIsReady(p *corev1.Pod) bool

func RetryN

func RetryN(delay time.Duration, maxAttempts int, f func(attempt int) error) error

Types

type GinkgoResult

type GinkgoResult struct {
	Logfile  string
	Report   *reporters.JUnitTestSuite
	Duration time.Duration
}

type GinkgoRun

type GinkgoRun struct {
	Name       string
	Cmd        *exec.Cmd
	ReportsDir string
	Timeout    time.Duration
}

func (*GinkgoRun) Run

func (r *GinkgoRun) Run(ctx context.Context, parentLog *zap.SugaredLogger, client ctrlruntimeclient.Client) (*GinkgoResult, error)

Jump to

Keyboard shortcuts

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