framework

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 71 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// KogitoOperatorDependencies contains list of operators to be used together with Kogito operator
	KogitoOperatorDependencies = []string{kogitoInfinispanDependencyName, kogitoKafkaDependencyName, kogitoKeycloakDependencyName}

	// KogitoOperatorMongoDBDependency is the MongoDB identifier for installation
	KogitoOperatorMongoDBDependency = infrastructure.MongoDBKind

	// CommunityCatalog operator catalog for community
	CommunityCatalog = operatorCatalog{
						// contains filtered or unexported fields
	}
	// OperatorHubCatalog operator catalog of Operator Hub
	OperatorHubCatalog = operatorCatalog{
						// contains filtered or unexported fields
	}
)

Functions

func BumpEvents

func BumpEvents(namespace string) error

BumpEvents will bump all events into events.log file

func CheckCliBinaryExist

func CheckCliBinaryExist() (bool, error)

CheckCliBinaryExist checks if the CLI binary does exist

func CheckPodHasImagePullSecretWithPrefix

func CheckPodHasImagePullSecretWithPrefix(pod *corev1.Pod, imagePullSecretPrefix string) bool

CheckPodHasImagePullSecretWithPrefix checks that a pod has an image pull secret starting with the given prefix

func CheckPodsAreReady

func CheckPodsAreReady(pods *corev1.PodList) bool

CheckPodsAreReady returns true if all pods are ready

func CheckPodsByDeploymentConfigInError

func CheckPodsByDeploymentConfigInError(namespace string, dcName string) func() (bool, error)

CheckPodsByDeploymentConfigInError returns a function that checks the pods error state.

func CheckPodsByDeploymentInError

func CheckPodsByDeploymentInError(namespace string, dName string) func() (bool, error)

CheckPodsByDeploymentInError returns a function that checks the pods error state.

func CheckPodsWithLabelInError

func CheckPodsWithLabelInError(namespace, labelName, labelValue string) func() (bool, error)

CheckPodsWithLabelInError returns a function that checks the pods error state.

func CheckSetup

func CheckSetup() error

CheckSetup verifies the configuration is correct

func ClearNamespaceHistory

func ClearNamespaceHistory()

ClearNamespaceHistory clears all the namespace history content.

func CompleteTask

func CompleteTask(namespace, routeURI, processName, processInstanceID, taskName, taskID, bodyFormat, bodyContent string) (err error)

CompleteTask completes task

func CompleteTaskByUser

func CompleteTaskByUser(namespace, routeURI, processName, processInstanceID, taskName, taskID, user, bodyFormat, bodyContent string) (err error)

CompleteTaskByUser completes task by user

func CreateFile

func CreateFile(folder, fileName, fileContent string) error

CreateFile Creates file in folder with supplied content

func CreateFolder

func CreateFolder(folder string) error

CreateFolder creates a folder and all its parents if not exist

func CreateInfinispanSecret

func CreateInfinispanSecret(namespace, name string, credentialsMap map[string]string) error

CreateInfinispanSecret creates a new secret for Infinispan instance

func CreateKogitoOperatorCatalogSource

func CreateKogitoOperatorCatalogSource() (*olmapiv1alpha1.CatalogSource, error)

CreateKogitoOperatorCatalogSource create a Kogito operator catalog source

func CreateMongoDBSecret

func CreateMongoDBSecret(namespace, name, password string) error

CreateMongoDBSecret creates a new secret for MongoDB instance

func CreateNamespace

func CreateNamespace(namespace string) error

CreateNamespace creates a new namespace

func CreateNamespacedSubscriptionIfNotExist

func CreateNamespacedSubscriptionIfNotExist(namespace string, subscriptionName string, operatorName string, catalog operatorCatalog, channel string) (*olmapiv1alpha1.Subscription, error)

CreateNamespacedSubscriptionIfNotExist create a namespaced subscription if not exists

func CreateObject

func CreateObject(o kubernetes.ResourceObject) error

CreateObject creates object

func CreateOperatorGroupIfNotExists

func CreateOperatorGroupIfNotExists(namespace, operatorGroupName string) (*olmapiv1.OperatorGroup, error)

CreateOperatorGroupIfNotExists creates an operator group if no exist

func CreateSecret

func CreateSecret(namespace, name string, secretContent map[string]string) error

CreateSecret creates a new secret

func CreateTemporaryFile

func CreateTemporaryFile(filePattern, fileContent string) (string, error)

CreateTemporaryFile Creates file in default directory for temporary files with supplied content

func CreateTemporaryFolder

func CreateTemporaryFolder(folderPrefix string) (string, error)

CreateTemporaryFolder creates a folder in default directory for temporary files

func CreateTrigger

func CreateTrigger(namespace, name, brokerName, serviceName string) error

CreateTrigger creates Knative Trigger

func DeleteFile

func DeleteFile(folder, fileName string) error

DeleteFile deletes a file

func DeleteFolder

func DeleteFolder(folder string) error

DeleteFolder deletes a folder and all its subfolders

func DeleteKogitoOperatorCatalogSource

func DeleteKogitoOperatorCatalogSource() error

DeleteKogitoOperatorCatalogSource delete a Kogito operator catalog source

func DeleteNamespace

func DeleteNamespace(namespace string) error

DeleteNamespace deletes a namespace

func DeleteObject

func DeleteObject(o kubernetes.ResourceObject) error

DeleteObject deletes object

func DeleteSubscription

func DeleteSubscription(subscription *olmapiv1alpha1.Subscription) error

DeleteSubscription deletes Subscription and related objects

func DeployBroker

func DeployBroker(namespace, name string) error

DeployBroker deploys Knative Broker

func DeployClusterWideKogitoOperatorFromYaml

func DeployClusterWideKogitoOperatorFromYaml(deploymentNamespace string) error

DeployClusterWideKogitoOperatorFromYaml Deploy Kogito Operator watching for all namespaces from yaml files, return all objects created for deployment

func DeployClusterWideKogitoOperatorUsingOlm

func DeployClusterWideKogitoOperatorUsingOlm() error

DeployClusterWideKogitoOperatorUsingOlm Deploy Kogito Operator watching for all namespaces using OLM, return all objects created for deployment

func DeployGrafanaInstance

func DeployGrafanaInstance(namespace, labelName, labelValue string) error

DeployGrafanaInstance deploys an instance of Grafana watching for label with specific name and value

func DeployInfinispanInstance

func DeployInfinispanInstance(namespace string, infinispan *infinispan.Infinispan) error

DeployInfinispanInstance deploys an instance of Infinispan

func DeployKafkaInstance

func DeployKafkaInstance(namespace string, kafka *kafkabetav1.Kafka) error

DeployKafkaInstance deploys an instance of Kafka

func DeployKafkaTopic

func DeployKafkaTopic(namespace, kafkaTopicName, kafkaInstanceName string) error

DeployKafkaTopic deploys a Kafka topic

func DeployKeycloakClient

func DeployKeycloakClient(namespace, clientName string) error

DeployKeycloakClient deploys a client configuration of Keycloak

func DeployKeycloakInstance

func DeployKeycloakInstance(namespace string) error

DeployKeycloakInstance deploys an instance of Keycloak

func DeployKeycloakRealm

func DeployKeycloakRealm(namespace, realmName string) error

DeployKeycloakRealm deploys a realm configuration of Keycloak

func DeployKeycloakUser

func DeployKeycloakUser(namespace, userName, password string) error

DeployKeycloakUser deploys a realm configuration of Keycloak

func DeployKogitoBuild

func DeployKogitoBuild(namespace string, installerType InstallerType, buildHolder *bddtypes.KogitoBuildHolder) error

DeployKogitoBuild deploy a KogitoBuild

func DeployMongoDBInstance

func DeployMongoDBInstance(namespace string, instance *mongodb.MongoDB) error

DeployMongoDBInstance deploys an instance of Mongo DB

func DeployMongoDBOperatorFromYaml

func DeployMongoDBOperatorFromYaml(namespace string) error

DeployMongoDBOperatorFromYaml Deploy Kogito Operator from yaml files

func DeployNamespacedKogitoOperatorUsingOlm

func DeployNamespacedKogitoOperatorUsingOlm(deploymentNamespace string) error

DeployNamespacedKogitoOperatorUsingOlm Deploy Kogito Operator watching for specified namespace using OLM, return all objects created for deployment Will be deployed in the same namespace as it will watch for

func DeployPrometheusInstance

func DeployPrometheusInstance(namespace, labelName, labelValue string) error

DeployPrometheusInstance deploys an instance of Prometheus

func DeployRuntimeService

func DeployRuntimeService(namespace string, installerType InstallerType, serviceHolder *bddtypes.KogitoServiceHolder) error

DeployRuntimeService deploy a Kogito service

func DeployService

func DeployService(serviceHolder *bddtypes.KogitoServiceHolder, installerType InstallerType) error

DeployService deploy the Kogito Service component

func DoesHTTPResponseContain

func DoesHTTPResponseContain(namespace string, requestInfo HTTPRequestInfo, responseContent string) (bool, error)

DoesHTTPResponseContain checks whether the response of an http request contains a certain string

func ExecuteCliCommand

func ExecuteCliCommand(namespace string, args ...string) (string, error)

ExecuteCliCommand executes a kogito cli command for a given namespace

func ExecuteCliCommandInNamespace

func ExecuteCliCommandInNamespace(namespace string, args ...string) (string, error)

ExecuteCliCommandInNamespace executes a kogito cli command in a specific namespace

func ExecuteGraphQLRequestWithLogging

func ExecuteGraphQLRequestWithLogging(namespace, uri, path, query, bearerToken string, response interface{}) error

ExecuteGraphQLRequestWithLogging executes a GraphQL query

func ExecuteGraphQLRequestWithLoggingOption

func ExecuteGraphQLRequestWithLoggingOption(namespace, uri, path, query, bearerToken string, response interface{}, logResponse bool) error

ExecuteGraphQLRequestWithLoggingOption executes a GraphQL query with possibility of logging each request

func ExecuteHTTPRequest

func ExecuteHTTPRequest(namespace string, requestInfo HTTPRequestInfo) (*http.Response, error)

ExecuteHTTPRequest executes an HTTP request

func ExecuteHTTPRequestC

func ExecuteHTTPRequestC(client *http.Client, namespace string, requestInfo HTTPRequestInfo) (*http.Response, error)

ExecuteHTTPRequestC executes an HTTP request using a given client

func ExecuteHTTPRequestWithStringResponse

func ExecuteHTTPRequestWithStringResponse(namespace string, requestInfo HTTPRequestInfo) (string, error)

ExecuteHTTPRequestWithStringResponse executes an HTTP request and returns a string response in case there is no error

func ExecuteHTTPRequestWithUnmarshalledResponse

func ExecuteHTTPRequestWithUnmarshalledResponse(namespace string, requestInfo HTTPRequestInfo, response interface{}) error

ExecuteHTTPRequestWithUnmarshalledResponse executes an HTTP request and returns response unmarshalled into specific structure in case there is no error

func ExposeServiceOnKubernetes

func ExposeServiceOnKubernetes(namespace string, service api.KogitoService) error

ExposeServiceOnKubernetes adds ingress CR to expose a service

func FlushAllRemainingLoggers

func FlushAllRemainingLoggers()

FlushAllRemainingLoggers flushes all remaining loggers

func FlushLogger

func FlushLogger(namespace string) error

FlushLogger flushes a specific logger

func GenerateNamespaceName

func GenerateNamespaceName(prefix string) string

GenerateNamespaceName generates a namespace name, taking configuration into account (local or not)

func GetAccessTokenFromKeycloak

func GetAccessTokenFromKeycloak(namespace, server, userName, password, realm, clientName string) (string, error)

GetAccessTokenFromKeycloak gets the access token for a user

func GetActiveReplicaSetByDeployment

func GetActiveReplicaSetByDeployment(namespace string, dName string) (*apps.ReplicaSet, error)

GetActiveReplicaSetByDeployment retrieves active ReplicaSet belonging to a Deployment

func GetBuildImage

func GetBuildImage(imageName string) string

GetBuildImage returns a build image with defaults set

func GetClusterWideTestSubscriptions

func GetClusterWideTestSubscriptions() (*olmapiv1alpha1.SubscriptionList, error)

GetClusterWideTestSubscriptions returns cluster wide subscriptions created by BDD tests

func GetContainerLog

func GetContainerLog(namespace, podName, containerName string) (string, error)

GetContainerLog exported for Zookeeper workaround, can be unexported once https://github.com/strimzi/strimzi-kafka-operator/issues/3092 is fixed

func GetDeployment

func GetDeployment(namespace, deploymentName string) (*apps.Deployment, error)

GetDeployment retrieves deployment with specified name in namespace

func GetDeploymentConfig

func GetDeploymentConfig(namespace, dcName string) (*ocapps.DeploymentConfig, error)

GetDeploymentConfig retrieves a deployment config

func GetInfinispanStub

func GetInfinispanStub(namespace, name, secretName string) *infinispan.Infinispan

GetInfinispanStub returns the preconfigured Infinispan stub with set namespace, name and secretName

func GetIngressURI

func GetIngressURI(namespace, serviceName string) (string, error)

GetIngressURI returns the ingress URI

func GetKogitoBuild

func GetKogitoBuild(namespace, buildName string) (*v1beta1.KogitoBuild, error)

GetKogitoBuild returns the KogitoBuild type

func GetKogitoBuildStub

func GetKogitoBuildStub(namespace, runtimeType, name string) *v1beta1.KogitoBuild

GetKogitoBuildStub Get basic KogitoBuild stub with all needed fields initialized

func GetKogitoDataIndexResourceStub

func GetKogitoDataIndexResourceStub(namespace string, replicas int) *v1beta1.KogitoSupportingService

GetKogitoDataIndexResourceStub Get basic KogitoDataIndex stub with all needed fields initialized

func GetKogitoExplainabilityResourceStub

func GetKogitoExplainabilityResourceStub(namespace string, replicas int) *v1beta1.KogitoSupportingService

GetKogitoExplainabilityResourceStub Get basic KogitoExplainability stub with all needed fields initialized

func GetKogitoInfraResourceStub

func GetKogitoInfraResourceStub(namespace, name, targetResourceType string) (*v1beta1.KogitoInfra, error)

GetKogitoInfraResourceStub Get basic KogitoInfra stub with all needed fields initialized

func GetKogitoJobsService

func GetKogitoJobsService(namespace string) (*v1beta1.KogitoSupportingService, error)

GetKogitoJobsService retrieves the running jobs service

func GetKogitoJobsServiceResourceStub

func GetKogitoJobsServiceResourceStub(namespace string, replicas int) *v1beta1.KogitoSupportingService

GetKogitoJobsServiceResourceStub Get basic KogitoJobsService stub with all needed fields initialized

func GetKogitoManagementConsoleResourceStub

func GetKogitoManagementConsoleResourceStub(namespace string, replicas int) *v1beta1.KogitoSupportingService

GetKogitoManagementConsoleResourceStub Get basic KogitoManagementConsole stub with all needed fields initialized

func GetKogitoRuntimeStub

func GetKogitoRuntimeStub(namespace, runtimeType, name, imageTag string) *v1beta1.KogitoRuntime

GetKogitoRuntimeStub Get basic KogitoRuntime stub with all needed fields initialized

func GetKogitoTaskConsoleResourceStub

func GetKogitoTaskConsoleResourceStub(namespace string, replicas int) *v1beta1.KogitoSupportingService

GetKogitoTaskConsoleResourceStub Get basic KogitoTaskConsole stub with all needed fields initialized

func GetKogitoTrustyResourceStub

func GetKogitoTrustyResourceStub(namespace string, replicas int) *v1beta1.KogitoSupportingService

GetKogitoTrustyResourceStub Get basic KogitoTrusty stub with all needed fields initialized

func GetKogitoTrustyUIResourceStub

func GetKogitoTrustyUIResourceStub(namespace string, replicas int) *v1beta1.KogitoSupportingService

GetKogitoTrustyUIResourceStub Get basic KogitoTrustyUI stub with all needed fields initialized

func GetKubernetesDurationFromTimeInMin

func GetKubernetesDurationFromTimeInMin(timeoutInMin int) time.Duration

GetKubernetesDurationFromTimeInMin will calculate the time depending on the configured cluster load factor

func GetLogFolder

func GetLogFolder() string

GetLogFolder returns the main log folder

func GetMongoDBSecret

func GetMongoDBSecret(namespace, secretName, password string) *corev1.Secret

GetMongoDBSecret returns a MongoDB secret structure

func GetMongoDBStub

func GetMongoDBStub(openshift bool, namespace, name string, users []MongoDBUserCred) *mongodb.MongoDB

GetMongoDBStub returns the preconfigured MongoDB stub with set namespace, name and secretName

func GetNamespacesInHistory

func GetNamespacesInHistory() []string

GetNamespacesInHistory retrieves all the namespaces in the history.

func GetOpenshiftDurationFromTimeInMin

func GetOpenshiftDurationFromTimeInMin(timeoutInMin int) time.Duration

GetOpenshiftDurationFromTimeInMin will calculate the time depending on the configured cluster load factor

func GetPods

func GetPods(namespace string) (*corev1.PodList, error)

GetPods retrieves all pods in namespace

func GetPodsByDeployment

func GetPodsByDeployment(namespace string, dName string) (pods []corev1.Pod, err error)

GetPodsByDeployment retrieves pods belonging to a Deployment

func GetPodsByDeploymentConfig

func GetPodsByDeploymentConfig(namespace string, dcName string) (*corev1.PodList, error)

GetPodsByDeploymentConfig retrieves pods with a deploymentconfig label set to <dcName>

func GetPodsWithLabels

func GetPodsWithLabels(namespace string, labels map[string]string) (*corev1.PodList, error)

GetPodsWithLabels retrieves pods based on label name and value

func GetProcessInstances

func GetProcessInstances(namespace, routeURI, processName string) (foundProcessInstances []map[string]interface{}, err error)

GetProcessInstances retrieves process instance of process name

func GetRoute

func GetRoute(namespace, routeName string) (*routev1.Route, error)

GetRoute retrieves a route

func GetRouteURI

func GetRouteURI(namespace, serviceName string) (string, error)

GetRouteURI retrieves a route URI

func GetService

func GetService(namespace, name string) (*corev1.Service, error)

GetService return Service based on namespace and name

func InitKubeClient

func InitKubeClient() error

InitKubeClient initializes the Kubernetes Client

func InstallClusterWideOperator

func InstallClusterWideOperator(subscriptionName, channel string, catalog operatorCatalog) error

InstallClusterWideOperator installs an operator for all namespaces via subscrition

func InstallKogitoDataIndexService

func InstallKogitoDataIndexService(namespace string, installerType InstallerType, dataIndex *bddtypes.KogitoServiceHolder) error

InstallKogitoDataIndexService install the Kogito Data Index service

func InstallKogitoExplainabilityService

func InstallKogitoExplainabilityService(namespace string, installerType InstallerType, explainability *bddtypes.KogitoServiceHolder) error

InstallKogitoExplainabilityService install the Kogito Explainability service

func InstallKogitoInfraComponent

func InstallKogitoInfraComponent(namespace string, installerType InstallerType, infra *v1beta1.KogitoInfra) error

InstallKogitoInfraComponent installs the desired component with the given installer type

func InstallKogitoJobsService

func InstallKogitoJobsService(installerType InstallerType, jobsService *bddtypes.KogitoServiceHolder) error

InstallKogitoJobsService install the Kogito Jobs Service component

func InstallKogitoManagementConsole

func InstallKogitoManagementConsole(installerType InstallerType, managementConsole *bddtypes.KogitoServiceHolder) error

InstallKogitoManagementConsole install the Kogito Management Console component

func InstallKogitoOperatorDependency

func InstallKogitoOperatorDependency(namespace, dependentOperator string, catalog operatorCatalog) error

InstallKogitoOperatorDependency installs dependent operator from parameter

func InstallKogitoTaskConsole

func InstallKogitoTaskConsole(installerType InstallerType, taskConsole *bddtypes.KogitoServiceHolder) error

InstallKogitoTaskConsole install the Kogito Task Console component

func InstallKogitoTrustyService

func InstallKogitoTrustyService(namespace string, installerType InstallerType, trusty *bddtypes.KogitoServiceHolder) error

InstallKogitoTrustyService install the Kogito Trusty service

func InstallKogitoTrustyUI

func InstallKogitoTrustyUI(installerType InstallerType, trustyUI *bddtypes.KogitoServiceHolder) error

InstallKogitoTrustyUI install the Kogito Management Console component

func InstallOperator

func InstallOperator(namespace, subscriptionName, channel string, catalog operatorCatalog) error

InstallOperator installs an operator via subscrition

func InstallService

func InstallService(serviceHolder *bddtypes.KogitoServiceHolder, installerType InstallerType, cliDeploymentName string) error

InstallService install the Kogito Service component

func IsCrdAvailable

func IsCrdAvailable(crdName string) (bool, error)

IsCrdAvailable returns whether the crd is available on cluster

func IsGraphQLRequestSuccessful

func IsGraphQLRequestSuccessful(namespace, uri, path, query, bearerToken string, response interface{}) (bool, error)

IsGraphQLRequestSuccessful makes and checks whether a GraphQL query is successful

func IsHTTPRequestFailed

func IsHTTPRequestFailed(namespace string, requestInfo HTTPRequestInfo) (bool, error)

IsHTTPRequestFailed makes and checks whether an http request fails

func IsHTTPRequestForbidden

func IsHTTPRequestForbidden(namespace string, requestInfo HTTPRequestInfo) (bool, error)

IsHTTPRequestForbidden makes and checks whether an http request is unauthorized

func IsHTTPRequestSuccessful

func IsHTTPRequestSuccessful(namespace string, requestInfo HTTPRequestInfo) (bool, error)

IsHTTPRequestSuccessful makes and checks whether an http request is successful

func IsHTTPResponseArraySize

func IsHTTPResponseArraySize(namespace string, requestInfo HTTPRequestInfo, arraySize int) (bool, error)

IsHTTPResponseArraySize makes and checks whether an http request returns an array of a specific size

func IsKogitoOperatorRunning

func IsKogitoOperatorRunning(namespace string) (bool, error)

IsKogitoOperatorRunning returns whether Kogito operator is running

func IsNamespace

func IsNamespace(namespace string) (bool, error)

IsNamespace checks whether a namespace exists

func IsOpenshift

func IsOpenshift() bool

IsOpenshift returns whether the cluster is running on Openshift

func IsOperatorRunning

func IsOperatorRunning(namespace, operatorPackageName string, catalog operatorCatalog) (bool, error)

IsOperatorRunning checks whether an operator is running

func IsPodRunning

func IsPodRunning(pod *corev1.Pod) bool

IsPodRunning returns true if pod is running

func IsPodStatusConditionReady

func IsPodStatusConditionReady(pod *corev1.Pod) bool

IsPodStatusConditionReady returns true if all pod's containers are ready (really running)

func KogitoOperatorExists

func KogitoOperatorExists(namespace string) (bool, error)

KogitoOperatorExists returns whether Kogito operator exists and is running. If it is existing but not running, it returns true and an error

func LogKubernetesObjects

func LogKubernetesObjects(namespace string, runtimeObjects ...runtime.Object) error

LogKubernetesObjects log Kubernetes objects for test analysis

func NewImageOrDefault

func NewImageOrDefault(fullImage string, defaultImageName string) string

NewImageOrDefault Returns Image parsed from provided image tag or created from configuration options

func NewKogitoServiceSpec

func NewKogitoServiceSpec(replicas int32, fullImage string, defaultImageName string) v1beta1.KogitoServiceSpec

NewKogitoServiceSpec creates a new Kogito Service Spec object.

func NewKogitoServiceStatus

func NewKogitoServiceStatus() v1beta1.KogitoServiceStatus

NewKogitoServiceStatus creates a new Kogito Service Status object.

func NewObjectMetadata

func NewObjectMetadata(namespace string, name string) metav1.ObjectMeta

NewObjectMetadata creates a new Object Metadata object.

func OnKogitoServiceDeployed

func OnKogitoServiceDeployed(namespace string, service api.KogitoService) error

OnKogitoServiceDeployed is called when a service deployed.

func OperateOnNamespaceIfExists

func OperateOnNamespaceIfExists(namespace string, operate func(namespace string) error) error

OperateOnNamespaceIfExists do some operations on the namespace if that one exists

func OperatorExistsUsingSubscription

func OperatorExistsUsingSubscription(namespace, operatorPackageName, operatorSource string) (bool, error)

OperatorExistsUsingSubscription returns whether operator exists and is running. If it is existing but not running, it returns true and an error For this check informations from subscription are used.

func PrintDataMap

func PrintDataMap(keys []string, dataMaps []map[string]string, writer io.StringWriter) error

PrintDataMap prints a formatted dataMap using the given writer

func ReadFromURI

func ReadFromURI(uri string) (string, error)

ReadFromURI reads string content from given URI (URL or Filesystem)

func RenameLogFolder

func RenameLogFolder(namespace, newLogFolderName string) error

RenameLogFolder changes the name of the log folder for a specific namespace

func ReportPerformanceMetric

func ReportPerformanceMetric(metric, value, unit string)

ReportPerformanceMetric reports a new metric with its value and unit to a results file. If the file does not exist, it will be created. It depends on the existence of the log folder which is created by the framework before the tests are run.

func RetrieveKeycloakEndpointURI

func RetrieveKeycloakEndpointURI(namespace string) (string, error)

RetrieveKeycloakEndpointURI retrieves the keycloak endpoint

func SetInfinispanReplicas

func SetInfinispanReplicas(namespace, name string, nbPods int) error

SetInfinispanReplicas sets the number of replicas for an Infinispan instance

func SetKogitoJobsServiceReplicas

func SetKogitoJobsServiceReplicas(namespace string, nbPods int32) error

SetKogitoJobsServiceReplicas sets the number of replicas for the Kogito Jobs Service

func SetKogitoRuntimeReplicas

func SetKogitoRuntimeReplicas(namespace, name string, nbPods int) error

SetKogitoRuntimeReplicas sets the number of replicas for a Kogito application

func SetLogSubFolder

func SetLogSubFolder(subFolders ...string)

SetLogSubFolder appends the main log folder with given subfolder(s)

func SetupKogitoBuildImageStreams

func SetupKogitoBuildImageStreams(kogitoBuild *v1beta1.KogitoBuild)

SetupKogitoBuildImageStreams sets the correct images for the KogitoBuild

func StartPodLogCollector

func StartPodLogCollector(namespace string) error

StartPodLogCollector monitors a namespace and stores logs of all pods running in the namespace

func StartProcess

func StartProcess(namespace, routeURI, processName, bodyFormat, bodyContent string) (err error)

StartProcess starts new process instance

func StopPodLogCollector

func StopPodLogCollector(namespace string) error

StopPodLogCollector waits until all logs are stored on disc

func ToResourceRequirements

func ToResourceRequirements(requests string, limits string) corev1.ResourceRequirements

ToResourceRequirements parses the requests and limits into corev1.ResourceRequirements

func WaitAndRetrieveEndpointURI

func WaitAndRetrieveEndpointURI(namespace, serviceName string) (string, error)

WaitAndRetrieveEndpointURI waits for a route and returns its URI

func WaitFor

func WaitFor(namespace, display string, timeout time.Duration, condition func() (bool, error), errorConditions ...func() (bool, error)) error

WaitFor waits for a specification condition to be met or until one error condition is met

func WaitForAllPodsByDeploymentConfigToContainTextInLog

func WaitForAllPodsByDeploymentConfigToContainTextInLog(namespace, dcName, logText string, timeoutInMin int) error

WaitForAllPodsByDeploymentConfigToContainTextInLog waits for pods of specified deployment config to contain specified text in log

func WaitForAllPodsByDeploymentToContainTextInLog

func WaitForAllPodsByDeploymentToContainTextInLog(namespace, dName, logText string, timeoutInMin int) error

WaitForAllPodsByDeploymentToContainTextInLog waits for pods of specified deployment to contain specified text in log

func WaitForAnyPodsByDeploymentToContainTextInLog

func WaitForAnyPodsByDeploymentToContainTextInLog(namespace, dName, logText string, timeoutInMin int) error

WaitForAnyPodsByDeploymentToContainTextInLog waits for pods of specified deployment to contain specified text in log

func WaitForBrokerResource

func WaitForBrokerResource(namespace, name string, timeoutInMin int) error

WaitForBrokerResource waits until the Broker ready status is True

func WaitForBuildComplete

func WaitForBuildComplete(namespace, buildName string, timeoutInMin int) error

WaitForBuildComplete waits for a build to be completed

func WaitForBuildConfigCreated

func WaitForBuildConfigCreated(namespace, buildConfigName string, timeoutInMin int) error

WaitForBuildConfigCreated waits for a build config to be created

func WaitForBuildConfigCreatedWithWebhooks

func WaitForBuildConfigCreatedWithWebhooks(namespace, buildConfigName string, expectedWebhooks []v1beta1.WebHookSecret, timeoutInMin int) error

WaitForBuildConfigCreatedWithWebhooks waits for a build config to be created with webhooks

func WaitForBuildConfigToHaveResources

func WaitForBuildConfigToHaveResources(namespace, buildConfigName string, expected v1.ResourceRequirements, timeoutInMin int) error

WaitForBuildConfigToHaveResources waits for build config to have the expected resources

func WaitForClusterWideKogitoOperatorRunningUsingOlm

func WaitForClusterWideKogitoOperatorRunningUsingOlm() error

WaitForClusterWideKogitoOperatorRunningUsingOlm waits for a cluster wide Kogito operator to be running in OLM

func WaitForClusterWideOperatorRunning

func WaitForClusterWideOperatorRunning(operatorPackageName string, catalog operatorCatalog, timeoutInMin int) error

WaitForClusterWideOperatorRunning waits for a cluster wide operator to be running

func WaitForDeploymentConfigRunning

func WaitForDeploymentConfigRunning(namespace, dcName string, podNb int, timeoutInMin int) error

WaitForDeploymentConfigRunning waits for a deployment config to be running, with a specific number of pod

func WaitForDeploymentRunning

func WaitForDeploymentRunning(namespace, dName string, podNb int, timeoutInMin int) error

WaitForDeploymentRunning waits for a deployment to be running, with a specific number of pod

func WaitForFailedHTTPRequest

func WaitForFailedHTTPRequest(namespace string, requestInfo HTTPRequestInfo, timeoutInMin int) error

WaitForFailedHTTPRequest waits for an HTTP request to fail

func WaitForForbiddenHTTPRequest

func WaitForForbiddenHTTPRequest(namespace string, requestInfo HTTPRequestInfo, timeoutInMin int) error

WaitForForbiddenHTTPRequest waits for an HTTP request to be unauthorized

func WaitForInfinispanPodsToBeRunningWithConfig

func WaitForInfinispanPodsToBeRunningWithConfig(namespace string, expectedConfig infinispan.InfinispanContainerSpec, numberOfPods, timeoutInMin int) error

WaitForInfinispanPodsToBeRunningWithConfig waits for an Infinispan pod to be running with the expected configuration

func WaitForKogitoDataIndexService

func WaitForKogitoDataIndexService(namespace string, replicas int, timeoutInMin int) error

WaitForKogitoDataIndexService wait for Kogito Data Index to be deployed

func WaitForKogitoExplainabilityService

func WaitForKogitoExplainabilityService(namespace string, replicas int, timeoutInMin int) error

WaitForKogitoExplainabilityService wait for Kogito Explainability to be deployed

func WaitForKogitoInfraResource

func WaitForKogitoInfraResource(namespace, name string, timeoutInMin int) error

WaitForKogitoInfraResource waits for the given KogitoInfra resource to be ready

func WaitForKogitoJobsService

func WaitForKogitoJobsService(namespace string, replicas int, timeoutInMin int) error

WaitForKogitoJobsService wait for Kogito Jobs Service to be deployed

func WaitForKogitoJobsServiceLogContainsTextWithinMinutes

func WaitForKogitoJobsServiceLogContainsTextWithinMinutes(namespace, logText string, timeoutInMin int) error

WaitForKogitoJobsServiceLogContainsTextWithinMinutes waits until any pods contains a text

func WaitForKogitoManagementConsoleService

func WaitForKogitoManagementConsoleService(namespace string, replicas int, timeoutInMin int) error

WaitForKogitoManagementConsoleService wait for Kogito Management Console to be deployed

func WaitForKogitoOperatorCatalogSourceReady

func WaitForKogitoOperatorCatalogSourceReady() error

WaitForKogitoOperatorCatalogSourceReady waits for Kogito operator CatalogSource to be ready

func WaitForKogitoOperatorDependencyRunning

func WaitForKogitoOperatorDependencyRunning(namespace, dependentOperator string, catalog operatorCatalog) error

WaitForKogitoOperatorDependencyRunning waits for dependent operator to be running

func WaitForKogitoOperatorRunning

func WaitForKogitoOperatorRunning(namespace string) error

WaitForKogitoOperatorRunning waits for Kogito operator running

func WaitForKogitoOperatorRunningWithDependencies

func WaitForKogitoOperatorRunningWithDependencies(namespace string) error

WaitForKogitoOperatorRunningWithDependencies waits for Kogito operator running as well as other dependent operators

func WaitForKogitoTaskConsoleService

func WaitForKogitoTaskConsoleService(namespace string, replicas int, timeoutInMin int) error

WaitForKogitoTaskConsoleService wait for Kogito Task Console to be deployed

func WaitForKogitoTrustyService

func WaitForKogitoTrustyService(namespace string, replicas int, timeoutInMin int) error

WaitForKogitoTrustyService wait for Kogito Trusty to be deployed

func WaitForKogitoTrustyUIService

func WaitForKogitoTrustyUIService(namespace string, replicas int, timeoutInMin int) error

WaitForKogitoTrustyUIService wait for Kogito Management Console to be deployed

func WaitForMongoDBOperatorRunning

func WaitForMongoDBOperatorRunning(namespace string) error

WaitForMongoDBOperatorRunning waits for MongoDB operator to be running

func WaitForOnKubernetes

func WaitForOnKubernetes(namespace, display string, timeoutInMin int, condition func() (bool, error)) error

WaitForOnKubernetes is a specific method

func WaitForOnOpenshift

func WaitForOnOpenshift(namespace, display string, timeoutInMin int, condition func() (bool, error), errorConditions ...func() (bool, error)) error

WaitForOnOpenshift waits for a specification condition

func WaitForOperatorRunning

func WaitForOperatorRunning(namespace, operatorPackageName string, catalog operatorCatalog, timeoutInMin int) error

WaitForOperatorRunning waits for an operator to be running

func WaitForPodsByDeploymentConfigToHaveResources

func WaitForPodsByDeploymentConfigToHaveResources(namespace, dcName string, expected v1.ResourceRequirements, timeoutInMin int) error

WaitForPodsByDeploymentConfigToHaveResources waits for pods to have the expected resources

func WaitForPodsByDeploymentToHaveResources

func WaitForPodsByDeploymentToHaveResources(namespace, dName string, expected v1.ResourceRequirements, timeoutInMin int) error

WaitForPodsByDeploymentToHaveResources waits for pods to have the expected resources

func WaitForPodsWithLabel

func WaitForPodsWithLabel(namespace, labelName, labelValue string, numberOfPods, timeoutInMin int) error

WaitForPodsWithLabel waits for pods with specific label to be available and running

func WaitForRoute

func WaitForRoute(namespace, routeName string, timeoutInMin int) error

WaitForRoute waits for a route to be available

func WaitForService

func WaitForService(namespace string, serviceName string, replicas int, timeoutInMin int) error

WaitForService waits that the service has a certain number of replicas

func WaitForSuccessfulGraphQLRequest

func WaitForSuccessfulGraphQLRequest(namespace, uri, path, query string, timeoutInMin int, response interface{}, analyzeResponse func(response interface{}) (bool, error)) error

WaitForSuccessfulGraphQLRequest waits for an GraphQL request to be successful

func WaitForSuccessfulGraphQLRequestUsingAccessToken

func WaitForSuccessfulGraphQLRequestUsingAccessToken(namespace, uri, path, query, accessToken string, timeoutInMin int, response interface{}, analyzeResponse func(response interface{}) (bool, error)) error

WaitForSuccessfulGraphQLRequestUsingAccessToken waits for an GraphQL request using access token to be successful

func WaitForSuccessfulGraphQLRequestUsingPagination

func WaitForSuccessfulGraphQLRequestUsingPagination(namespace, uri, path, query string, timeoutInMin, pageSize, totalSize int, response interface{}, afterEachResponse func(response interface{}) (bool, error), afterFullRequest func() (bool, error)) error

WaitForSuccessfulGraphQLRequestUsingPagination waits for a GraphQL request with pagination to be successful. You can provide 2 functions:

1. After each response. This is called after every page is queried. Useful for checking the content of each page or appending results for final checks after all pages are retrieved.

2. After full request. This is called once after all pages are queried. Useful for final checks on all results.

If more than one page is to be retrieved, include the `$offset` variable in the query which will be used for pagination.

func WaitForSuccessfulHTTPRequest

func WaitForSuccessfulHTTPRequest(namespace string, requestInfo HTTPRequestInfo, timeoutInMin int) error

WaitForSuccessfulHTTPRequest waits for an HTTP request to be successful

func WaitForTrigger

func WaitForTrigger(namespace, name string, timeoutInMin int) error

WaitForTrigger waits until the Trigger ready status is True

Types

type Command

type Command interface {
	// WithLoggerContext method attaches a logger context to trace all the command logs when executing it.
	WithLoggerContext(loggerContext string) Command
	// InDirectory method sets the directory where the command will be executed.
	InDirectory(directory string) Command
	// WithRetry method defines retry options to be applied to the command.
	WithRetry(opts ...RetryOption) Command
	// Sync method allows to execute only one command at a time based on the syncID.
	Sync(syncID string) Command
	// Execute command and returns the outputs.
	Execute() (string, error)
}

Command wraps information about the command to execute.

func CreateCommand

func CreateCommand(commandName string, args ...string) Command

CreateCommand methods initializes the basic data to run commands.

type ContainerEngine

type ContainerEngine interface {
	// PullImage pull image from external registry to internal registry
	PullImage(imageTag string) ContainerEngine

	// PushImage push image from internal registry to external registry
	PushImage(imageTag string) ContainerEngine

	// BuildImage builds the container image from specified directory
	BuildImage(projectLocation, imageTag string) ContainerEngine

	// GetError returns error in case any execution failed
	GetError() error
}

ContainerEngine is the engine providing container and registry functionality

func GetContainerEngine

func GetContainerEngine(namespace string) ContainerEngine

GetContainerEngine returns container engine based on test configuration

type DecisionsResponse

type DecisionsResponse struct {
	Status    string     `json:"status"`
	Saliences []Salience `json:"saliencies"`
}

DecisionsResponse represents the decision response

func GetKogitoTrustyDecisionsByExecutionName

func GetKogitoTrustyDecisionsByExecutionName(namespace, executionName string, timeoutInMin int) (*DecisionsResponse, error)

GetKogitoTrustyDecisionsByExecutionName gets the decisions made by a given execution name

type HTTPRequestInfo

type HTTPRequestInfo struct {
	HTTPMethod, URI, Path, BodyFormat, BodyContent, Token string
	Unsecure                                              bool
	Headers                                               map[string]string
}

HTTPRequestInfo structure encapsulates all information needed to execute an HTTP request

func NewGETHTTPRequestInfo

func NewGETHTTPRequestInfo(uri, path string) HTTPRequestInfo

NewGETHTTPRequestInfo constructor creates a new HTTPRequestInfo struct with the GET HTTP method

func NewPOSTHTTPRequestInfo

func NewPOSTHTTPRequestInfo(uri, path, bodyFormat, bodyContent string) HTTPRequestInfo

NewPOSTHTTPRequestInfo constructor creates a new HTTPRequestInfo struct with the POST HTTP method

func NewPOSTHTTPRequestInfoWithHeaders

func NewPOSTHTTPRequestInfoWithHeaders(uri, path string, headers map[string]string, bodyFormat, bodyContent string) HTTPRequestInfo

NewPOSTHTTPRequestInfoWithHeaders constructor creates a new HTTPRequestInfo struct with the POST HTTP method and provided headers

type HTTPRequestResult

type HTTPRequestResult string

HTTPRequestResult represents the success or error of an HTTP request

const (
	// HTTPRequestResultSuccess in case of success
	HTTPRequestResultSuccess HTTPRequestResult = "success"
	// HTTPRequestResultError in case of error
	HTTPRequestResultError HTTPRequestResult = "error"
)

func ExecuteHTTPRequestsInThreads

func ExecuteHTTPRequestsInThreads(namespace string, requestCount, threadCount int, requestInfo HTTPRequestInfo) ([]HTTPRequestResult, error)

ExecuteHTTPRequestsInThreads executes given number of requests using given number of threads (Go routines). Returns []HTTPRequestResult with the outcome of each thread (HTTPRequestResultSuccess or HTTPRequestResultError). Returns error if the desired number of requests cannot be precisely divided to the threads. Useful for performance testing.

type InstallerType

type InstallerType string

InstallerType defines the type of installer for services

var (
	// CLIInstallerType defines the CLI installer
	CLIInstallerType InstallerType = cliInstallerKey
	// CRInstallerType defines the CR installer
	CRInstallerType InstallerType = crInstallerKey
)

func GetDefaultInstallerType

func GetDefaultInstallerType() InstallerType

GetDefaultInstallerType returns the default installer type for the tests

type KogitoApplicationDockerfileProvider

type KogitoApplicationDockerfileProvider interface {
	// GetDockerfileContent returns Dockerfile content for image creation
	GetDockerfileContent() (string, error)
}

KogitoApplicationDockerfileProvider is the API to provide Dockerfile content for image creation based on built project content

func GetKogitoApplicationDockerfileProvider

func GetKogitoApplicationDockerfileProvider(projectLocation string) KogitoApplicationDockerfileProvider

GetKogitoApplicationDockerfileProvider returns KogitoApplicationDockerfileProvider based on project location

type Logger

type Logger struct {
	logr.Logger
}

Logger shared logger struct

func GetLogger

func GetLogger(namespace string) Logger

GetLogger retrieves the logger for a namespace

func GetMainLogger

func GetMainLogger() Logger

GetMainLogger returns the main logger

func (Logger) Debug

func (l Logger) Debug(message string, keysAndValues ...interface{})

Debug alternative for info format with DEBUG named and correct log level

func (Logger) Warn

func (l Logger) Warn(message string, keysAndValues ...interface{})

Warn alternative for info format with sprintf and WARN named.

type MavenCommand

type MavenCommand interface {
	// WithLoggerContext method attaches a logger context to trace all the command logs when executing it.
	WithLoggerContext(loggerContext string) MavenCommand
	// Execute command and returns the outputs.
	Execute(targets ...string) (string, error)

	// SkipTests will skip testing automatically
	SkipTests() MavenCommand
	// UpdateArtifacts will force the update of local artifacts
	UpdateArtifacts() MavenCommand
	// Profiles sets the profiles to execute
	Profiles(profiles ...string) MavenCommand
	// Options adds additional command line options for the Maven command
	Options(options ...string) MavenCommand
}

MavenCommand wraps information about the maven command to execute.

func CreateMavenCommand

func CreateMavenCommand(directory string) MavenCommand

CreateMavenCommand methods initializes the basic data to run maven commands.

type MongoDBUserCred

type MongoDBUserCred struct {
	Name         string
	AuthDatabase string
	SecretName   string
	Databases    []string
}

MongoDBUserCred holds information to create a MongoDB user in MongoDB, secretName containing the password

type Opts

type Opts struct {
	// Verbose will increase logging
	Verbose bool
	// Output specifies where to log
	Output io.Writer
}

Opts describe logger options

type RetryOption

type RetryOption func(*commandStruct)

RetryOption declares funtion to be applied on Retry

func NumberOfRetries

func NumberOfRetries(retries int) RetryOption

NumberOfRetries declares funtion setting number of retries

func RetryDelay

func RetryDelay(delay time.Duration) RetryOption

RetryDelay declares funtion setting delay between retries

type Salience

type Salience struct {
	OutcomeName string `json:"outcomeName"`
}

Salience represents the salience response

type Task

type Task struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Task Kogito process task representation

func GetTasks

func GetTasks(namespace, routeURI, processName, processInstanceID string) (foundTasks []Task, err error)

GetTasks retrieves tasks of specific process instance

func GetTasksByUser

func GetTasksByUser(namespace, routeURI, processName, processInstanceID, user string) (foundTasks []Task, err error)

GetTasksByUser retrieves tasks of specific process instance and user

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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