tests

package
v0.0.0-...-2e8aeb9 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package tests contains utilities for tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailBecauseNotFound

func FailBecauseNotFound() types.GomegaMatcher

FailBecauseNotFound returns a new IsNotFoundErrorMatcher to catch k8s not-found errors.

func LogsToGinkgoWriter

func LogsToGinkgoWriter()

LogsToGinkgoWriter configures klog to output the logs to GinkgoWriter, instead of stdout. This allows to output the logs only in case of failing tests, simplifying troubleshooting.

Types

type IsNotFoundErrorMatcher

type IsNotFoundErrorMatcher struct{}

IsNotFoundErrorMatcher is a custom matcher to check when kubernetes resources do not exist.

func (*IsNotFoundErrorMatcher) FailureMessage

func (s *IsNotFoundErrorMatcher) FailureMessage(actual interface{}) (message string)

FailureMessage is called when the matcher fails positively.

func (*IsNotFoundErrorMatcher) Match

func (s *IsNotFoundErrorMatcher) Match(actual interface{}) (success bool, err error)

Match is a GomegaMatcher interface method to actually run the matcher.

func (*IsNotFoundErrorMatcher) NegatedFailureMessage

func (s *IsNotFoundErrorMatcher) NegatedFailureMessage(actual interface{}) (message string)

NegatedFailureMessage is called when the matcher fails negatively.

Jump to

Keyboard shortcuts

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