Documentation ¶
Index ¶
- func AppendReport(report, toAppend *reporters.JUnitTestSuite)
- func JUnitWrapper(testCaseName string, report *reporters.JUnitTestSuite, executor func() error, ...) error
- func MeasuredRetryN(runtimeMetric *prometheus.GaugeVec, attemptsMetric prometheus.Gauge, ...) func() error
- func NodeIsReady(node corev1.Node) bool
- func PodIsCompleted(p *corev1.Pod) bool
- func PodIsReady(p *corev1.Pod) bool
- func RetryN(delay time.Duration, maxAttempts int, f func(attempt int) error) error
- type GinkgoResult
- type GinkgoRun
- type JUnitTestSuites
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 PodIsCompleted ¶ added in v2.24.0
func PodIsReady ¶
Types ¶
type GinkgoResult ¶
type GinkgoResult struct { Logfile string Report *reporters.JUnitTestSuite Duration time.Duration }
type GinkgoRun ¶
func (*GinkgoRun) Run ¶
func (r *GinkgoRun) Run(ctx context.Context, parentLog *zap.SugaredLogger, client ctrlruntimeclient.Client) (*GinkgoResult, error)
type JUnitTestSuites ¶ added in v2.22.0
type JUnitTestSuites struct { XMLName xml.Name `xml:"testsuites"` Tests int `xml:"tests,attr"` Disabled int `xml:"disabled,attr"` Errors int `xml:"errors,attr"` Failures int `xml:"failures,attr"` Time float64 `xml:"time,attr"` TestSuites []reporters.JUnitTestSuite `xml:"testsuite"` }
JUnitTestSuites is copied from Ginkgo 2.x because KKP otherwise depends on Ginkgo 1.x for now. Once we migrate everything, this struct can be removed. Source: https://github.com/onsi/ginkgo/blob/9c9f45ef886e23dcb006aa245f67e91140e1e60e/reporters/junit_report.go#L24-L39