Documentation ¶
Index ¶
- Variables
- func AssertCreate(t *testing.T, c *kogitocli.Client, resource client.Object)
- func AssertFetchMustExist(t *testing.T, client *kogitocli.Client, resource client.Object)
- func AssertFetchWithKeyMustExist(t *testing.T, client *kogitocli.Client, resource client.Object, ...)
- func AssertReconcile(t *testing.T, r reconcile.Reconciler, instance client.Object) (result reconcile.Result)
- func AssertReconcileMustNotRequeue(t *testing.T, r reconcile.Reconciler, instance client.Object) (result reconcile.Result)
- func AssertReconcileMustRequeue(t *testing.T, r reconcile.Reconciler, instance client.Object) (result reconcile.Result)
- func CreateFakeClient(objects []runtime.Object, imageObjs []runtime.Object, ...) *kogitocli.Client
- func CreateFakeClientOnOpenShift(objects []runtime.Object, imageObjs []runtime.Object, ...) *kogitocli.Client
- func CreateFakeDataIndex(namespace string) *v1beta1.KogitoSupportingService
- func CreateFakeExplainabilityService(namespace string) *v1beta1.KogitoSupportingService
- func CreateFakeImageStreams(imageName, namespace, imageVersion string) (*v1.ImageStream, *v1.ImageStreamTag)
- func CreateFakeInfinispan(namespace string) *infinispan.Infinispan
- func CreateFakeInfinispanCertSecret(namespace string) (*v13.Secret, error)
- func CreateFakeInfinispanCredentialSecret(namespace string) *v13.Secret
- func CreateFakeInfinispanService(namespace string) *v13.Service
- func CreateFakeJobsService(namespace string) *v1beta1.KogitoSupportingService
- func CreateFakeKafka(namespace string) *v1beta2.Kafka
- func CreateFakeKogitoInfinispan(namespace string) api.KogitoInfraInterface
- func CreateFakeKogitoKafka(namespace string) api.KogitoInfraInterface
- func CreateFakeKogitoKafkaConfig(namespace string) *v12.ConfigMap
- func CreateFakeKogitoKnative(namespace string) api.KogitoInfraInterface
- func CreateFakeKogitoMongoDB(namespace string) api.KogitoInfraInterface
- func CreateFakeKogitoRuntime(namespace string) *v1beta1.KogitoRuntime
- func CreateFakeMgmtConsole(namespace string) *v1beta1.KogitoSupportingService
- func CreateFakeMongoDB(namespace string) *mongodb.MongoDBCommunity
- func CreateFakeMongoDBSecret(namespace string) *v1.Secret
- func CreateFakeTaskConsole(namespace string) *v1beta1.KogitoSupportingService
- func CreateFakeTrustyAIService(namespace string) *v1beta1.KogitoSupportingService
- func CreateFakeTrustyUIService(namespace string) *v1beta1.KogitoSupportingService
- func GenerateShortUID(count int) string
- func GenerateUID() types.UID
- func HelperLoadBytes(t *testing.T, name string) []byte
- func SetSharedEnv(k, v string) (deferFunc func())
- func ToRuntimeObjects(resources ...client.Object) []runtime.Object
- type FakeClientBuilder
Constants ¶
This section is empty.
Variables ¶
var TestLogger = logger.GetLogger("test")
TestLogger ...
Functions ¶
func AssertCreate ¶
AssertCreate creates the given resource and asserts that it isn't existed before
func AssertFetchMustExist ¶
AssertFetchMustExist fetches the given object and verify if exists in the context without errors
func AssertFetchWithKeyMustExist ¶
func AssertFetchWithKeyMustExist(t *testing.T, client *kogitocli.Client, resource client.Object, 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 client.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 client.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 client.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) *kogitocli.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) *kogitocli.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 CreateFakeImageStreams ¶ added in v1.8.0
func CreateFakeImageStreams(imageName, namespace, imageVersion string) (*v1.ImageStream, *v1.ImageStreamTag)
CreateFakeImageStreams creates and gets an ImageStream and its ImageStreamTag for mocking purposes
func CreateFakeInfinispan ¶ added in v1.12.0
func CreateFakeInfinispan(namespace string) *infinispan.Infinispan
CreateFakeInfinispan ...
func CreateFakeInfinispanCertSecret ¶ added in v1.12.0
CreateFakeInfinispanCertSecret ...
func CreateFakeInfinispanCredentialSecret ¶ added in v1.12.0
CreateFakeInfinispanCredentialSecret ...
func CreateFakeInfinispanService ¶ added in v1.12.0
CreateFakeInfinispanService ...
func CreateFakeJobsService ¶
func CreateFakeJobsService(namespace string) *v1beta1.KogitoSupportingService
CreateFakeJobsService ...
func CreateFakeKafka ¶
CreateFakeKafka creates a Kafka resource with default configuration
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 CreateFakeKogitoKafkaConfig ¶ added in v1.12.0
CreateFakeKogitoKafkaConfig ...
func CreateFakeKogitoKnative ¶
func CreateFakeKogitoKnative(namespace string) api.KogitoInfraInterface
CreateFakeKogitoKnative create fake kogito infra instance for Knative
func CreateFakeKogitoMongoDB ¶ added in v1.12.0
func CreateFakeKogitoMongoDB(namespace string) api.KogitoInfraInterface
CreateFakeKogitoMongoDB create fake kogito infra instance for MongoDB
func CreateFakeKogitoRuntime ¶
func CreateFakeKogitoRuntime(namespace string) *v1beta1.KogitoRuntime
CreateFakeKogitoRuntime ...
func CreateFakeMgmtConsole ¶
func CreateFakeMgmtConsole(namespace string) *v1beta1.KogitoSupportingService
CreateFakeMgmtConsole ...
func CreateFakeMongoDB ¶ added in v1.12.0
func CreateFakeMongoDB(namespace string) *mongodb.MongoDBCommunity
CreateFakeMongoDB ...
func CreateFakeMongoDBSecret ¶ added in v1.12.0
CreateFakeMongoDBSecret ...
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 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 SetSharedEnv ¶ added in v1.8.0
func SetSharedEnv(k, v string) (deferFunc func())
SetSharedEnv sets a value to a given Environment variable returns the defer function that MUST be called after your test to not mess up with users' env
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() *kogitocli.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()