Documentation ¶
Index ¶
- Variables
- func AssertCreate(t *testing.T, c *client.Client, resource kubernetes.ResourceObject)
- func AssertFetchMustExist(t *testing.T, client *client.Client, resource kubernetes.ResourceObject)
- func AssertFetchWithKeyMustExist(t *testing.T, client *client.Client, resource kubernetes.ResourceObject, ...)
- func AssertReconcile(t *testing.T, r reconcile.Reconciler, instance metav1.Object) (result reconcile.Result)
- func AssertReconcileMustNotRequeue(t *testing.T, r reconcile.Reconciler, instance metav1.Object) (result reconcile.Result)
- func AssertReconcileMustRequeue(t *testing.T, r reconcile.Reconciler, instance metav1.Object) (result reconcile.Result)
- func CreateFakeClient(objects []runtime.Object, imageObjs []runtime.Object, ...) *client.Client
- func CreateFakeClientOnOpenShift(objects []runtime.Object, imageObjs []runtime.Object, ...) *client.Client
- func CreateFakeDataIndex(namespace string) *v1beta1.KogitoSupportingService
- func CreateFakeExplainabilityService(namespace string) *v1beta1.KogitoSupportingService
- func CreateFakeJobsService(namespace string) *v1beta1.KogitoSupportingService
- func CreateFakeKogitoInfinispan(namespace string) api.KogitoInfraInterface
- func CreateFakeKogitoKafka(namespace string) api.KogitoInfraInterface
- func CreateFakeKogitoKnative(namespace string) api.KogitoInfraInterface
- func CreateFakeKogitoRuntime(namespace string) *v1beta1.KogitoRuntime
- func CreateFakeMgmtConsole(namespace string) *v1beta1.KogitoSupportingService
- func CreateFakeTaskConsole(namespace string) *v1beta1.KogitoSupportingService
- func CreateFakeTrustyAIService(namespace string) *v1beta1.KogitoSupportingService
- func CreateFakeTrustyUIService(namespace string) *v1beta1.KogitoSupportingService
- func CreateImageStreams(imageName, namespace, ownerName, imageVersion string) (*v1.ImageStream, *v1.ImageStreamTag)
- func GenerateShortUID(count int) string
- func GenerateUID() types.UID
- func HelperLoadBytes(t *testing.T, name string) []byte
- func ToRuntimeObjects(resources ...resource.KubernetesResource) []runtime.Object
- type FakeClientBuilder
Constants ¶
This section is empty.
Variables ¶
var TestLogger = logger.GetLogger("test")
TestLogger ...
Functions ¶
func AssertCreate ¶
func AssertCreate(t *testing.T, c *client.Client, resource kubernetes.ResourceObject)
AssertCreate creates the given resource and asserts that it isn't existed before
func AssertFetchMustExist ¶
func AssertFetchMustExist(t *testing.T, client *client.Client, resource kubernetes.ResourceObject)
AssertFetchMustExist fetches the given object and verify if exists in the context without errors
func AssertFetchWithKeyMustExist ¶
func AssertFetchWithKeyMustExist(t *testing.T, client *client.Client, resource kubernetes.ResourceObject, instance metav1.Object)
AssertFetchWithKeyMustExist fetches the given object with the defined key and verify if it exists in the context without errors
func AssertReconcile ¶
func AssertReconcile(t *testing.T, r reconcile.Reconciler, instance metav1.Object) (result reconcile.Result)
AssertReconcile asserts if the reconcile.Reconciler call finished without errors
func AssertReconcileMustNotRequeue ¶
func AssertReconcileMustNotRequeue(t *testing.T, r reconcile.Reconciler, instance metav1.Object) (result reconcile.Result)
AssertReconcileMustNotRequeue asserts the reconciliation result and that the result DOES NOT add the object in the reconciliation queue again
func AssertReconcileMustRequeue ¶
func AssertReconcileMustRequeue(t *testing.T, r reconcile.Reconciler, instance metav1.Object) (result reconcile.Result)
AssertReconcileMustRequeue asserts the reconciliation result and that the result adds the object in the reconciliation queue again
func CreateFakeClient ¶
func CreateFakeClient(objects []runtime.Object, imageObjs []runtime.Object, buildObjs []runtime.Object) *client.Client
CreateFakeClient will create a fake client for mock test on Kubernetes env, use cases that depends on OpenShift should use CreateFakeClientOnOpenShift Deprecated: use NewFakeClientBuilder().Build() instead.
func CreateFakeClientOnOpenShift ¶
func CreateFakeClientOnOpenShift(objects []runtime.Object, imageObjs []runtime.Object, buildObjs []runtime.Object) *client.Client
CreateFakeClientOnOpenShift same as CreateFakeClientWithDisco setting openshift flag to true Deprecated: use NewFakeClientBuilder().OnOpenShift().Build() instead.
func CreateFakeDataIndex ¶
func CreateFakeDataIndex(namespace string) *v1beta1.KogitoSupportingService
CreateFakeDataIndex ...
func CreateFakeExplainabilityService ¶
func CreateFakeExplainabilityService(namespace string) *v1beta1.KogitoSupportingService
CreateFakeExplainabilityService ...
func CreateFakeJobsService ¶
func CreateFakeJobsService(namespace string) *v1beta1.KogitoSupportingService
CreateFakeJobsService ...
func CreateFakeKogitoInfinispan ¶
func CreateFakeKogitoInfinispan(namespace string) api.KogitoInfraInterface
CreateFakeKogitoInfinispan create fake kogito infra instance for Infinispan
func CreateFakeKogitoKafka ¶
func CreateFakeKogitoKafka(namespace string) api.KogitoInfraInterface
CreateFakeKogitoKafka create fake kogito infra instance for kafka
func CreateFakeKogitoKnative ¶
func CreateFakeKogitoKnative(namespace string) api.KogitoInfraInterface
CreateFakeKogitoKnative create fake kogito infra instance for Knative
func CreateFakeKogitoRuntime ¶
func CreateFakeKogitoRuntime(namespace string) *v1beta1.KogitoRuntime
CreateFakeKogitoRuntime ...
func CreateFakeMgmtConsole ¶
func CreateFakeMgmtConsole(namespace string) *v1beta1.KogitoSupportingService
CreateFakeMgmtConsole ...
func CreateFakeTaskConsole ¶
func CreateFakeTaskConsole(namespace string) *v1beta1.KogitoSupportingService
CreateFakeTaskConsole ...
func CreateFakeTrustyAIService ¶
func CreateFakeTrustyAIService(namespace string) *v1beta1.KogitoSupportingService
CreateFakeTrustyAIService ...
func CreateFakeTrustyUIService ¶
func CreateFakeTrustyUIService(namespace string) *v1beta1.KogitoSupportingService
CreateFakeTrustyUIService ...
func CreateImageStreams ¶
func CreateImageStreams(imageName, namespace, ownerName, imageVersion string) (*v1.ImageStream, *v1.ImageStreamTag)
CreateImageStreams creates and gets an ImageStream and its ImageStreamTag for mocking purposes
func GenerateShortUID ¶
GenerateShortUID same as GenerateUID, but returns a fraction of the generated UID instead. If count > than UID total length, returns the entire sequence.
func GenerateUID ¶
GenerateUID generates a Unique ID to be used across test cases
func HelperLoadBytes ¶
HelperLoadBytes will load, in bytes, the file with the given name in the testdata dir
func ToRuntimeObjects ¶
func ToRuntimeObjects(resources ...resource.KubernetesResource) []runtime.Object
ToRuntimeObjects converts RHSysUtils array KubernetesResource into k8s runtime.Object array
Types ¶
type FakeClientBuilder ¶
type FakeClientBuilder interface { AddK8sObjects(objects ...runtime.Object) FakeClientBuilder AddImageObjects(imageObjs ...runtime.Object) FakeClientBuilder AddBuildObjects(buildObjs ...runtime.Object) FakeClientBuilder OnOpenShift() FakeClientBuilder SupportPrometheus() FakeClientBuilder SupportOLM() FakeClientBuilder Build() *client.Client }
FakeClientBuilder create client object for tests
func NewFakeClientBuilder ¶
func NewFakeClientBuilder() FakeClientBuilder
NewFakeClientBuilder provides new object FakeClientBuilder to build a FakeClient. Usage: NewFakeClientBuilder().AddK8sObjects(obj1, obj2).Build()