Documentation ¶
Index ¶
- Variables
- func CreateTestingNS(baseName string, c client.Client, labels map[string]string) (*corev1.Namespace, error)
- func ExpectNoError(err error, explain ...interface{})
- func ExpectNoErrorWithOffset(offset int, err error, explain ...interface{})
- func Logf(format string, args ...interface{})
- func RandomSuffix() string
- type Framework
- func (f *Framework) AfterEach()
- func (f *Framework) BeforeEach()
- func (f *Framework) GetRandomNode() (*corev1.Node, error)
- func (f *Framework) NewDiagnosis(name, ns, nodeName, operationSet string) *diagnosisv1.Diagnosis
- func (f *Framework) NewDiagnosisWithRandomNode(name, ns, operationSet string) *diagnosisv1.Diagnosis
- func (f *Framework) NewSimpleOperationset(name string, ns string, operationName string) *diagnosisv1.OperationSet
Constants ¶
This section is empty.
Variables ¶
var ( // RunID is a unique identifier of the e2e run. // Beware that this ID is not the same for all tests in the e2e run, because each Ginkgo node creates it separately. RunID = uuid.NewUUID() )
Functions ¶
func CreateTestingNS ¶
func CreateTestingNS(baseName string, c client.Client, labels map[string]string) (*corev1.Namespace, error)
CreateTestingNS should be used by every test, note that we append a common prefix to the provided test name. Please see NewFramework instead of using this directly.
func ExpectNoError ¶
func ExpectNoError(err error, explain ...interface{})
ExpectNoError checks if "err" is set, and if so, fails assertion while logging the error.
func ExpectNoErrorWithOffset ¶
ExpectNoErrorWithOffset checks if "err" is set, and if so, fails assertion while logging the error at "offset" levels above its caller (for example, for call chain f -> g -> ExpectNoErrorWithOffset(1, ...) error would be logged for "f").
func RandomSuffix ¶
func RandomSuffix() string
RandomSuffix provides a random string to append to namespace, operationset and diagnosis.
Types ¶
type Framework ¶
type Framework struct { BaseName string context.Context KubeClient client.Client Namespace *corev1.Namespace // Every test has at least one namespace unless creation is skipped SelectorKey string // selectorKey is the key of lable map. }
func NewDefaultFramework ¶
NewDefaultFramework makes a new framework and sets up a BeforeEach/AfterEach for you (you can write additional before/after each functions).
func NewFramework ¶
NewFramework creates a test framework.
func (*Framework) BeforeEach ¶
func (f *Framework) BeforeEach()
BeforeEach gets a client and makes a namespace.
func (*Framework) GetRandomNode ¶
GetRandomNode Chooses a random node
func (*Framework) NewDiagnosis ¶
func (f *Framework) NewDiagnosis(name, ns, nodeName, operationSet string) *diagnosisv1.Diagnosis
NewDiagnosis returns a diagnosis with specified operationset.
func (*Framework) NewDiagnosisWithRandomNode ¶
func (f *Framework) NewDiagnosisWithRandomNode(name, ns, operationSet string) *diagnosisv1.Diagnosis
func (*Framework) NewSimpleOperationset ¶
func (f *Framework) NewSimpleOperationset(name string, ns string, operationName string) *diagnosisv1.OperationSet
NewSimpleOperationset returns an operationset with only one operation.