Documentation ¶
Overview ¶
Package e2e provides test functions, utility function and structs that allow for integration testing of Kuberay API server and Kuberay operator.
The code assumes that cluster found in [~/.kube/config] up and has the needed components (Kuberay API server Kuberay Operator) deployed and functional.
The code is organized as follows:
- types.go -- provides for data types
- utils.go -- provides for utility functions
- cluster_server_e2e_test.go -- provides the test function for the Cluster GRPC Server
- config_server_e2e_test.go -- provides the test function for the Config GRPC Server
- job_server_e2e_test.go -- provides the test function for the Job GRPC Server
- service_server_e2e_test.go -- provides the test function
Index ¶
- func CreateHttpRequest(method string, host string, endPoint string, body io.Reader) (*http.Request, error)
- func MakeBodyReader(s string) io.Reader
- func PrettyPrintResponseBody(body io.ReadCloser) (string, error)
- func ReadFileAsString(t *testing.T, fileName string) string
- type End2EndTestingContext
- func (e2etc *End2EndTestingContext) CreateComputeTemplate(t *testing.T)
- func (e2etc *End2EndTestingContext) CreateConfigMap(t *testing.T, values map[string]string) string
- func (e2etc *End2EndTestingContext) CreateRayClusterWithConfigMaps(t *testing.T, configMapValues map[string]string) (*api.Cluster, string)
- func (e2etc *End2EndTestingContext) DeleteComputeTemplate(t *testing.T)
- func (e2etc *End2EndTestingContext) DeleteConfigMap(t *testing.T, configMapName string)
- func (e2etc *End2EndTestingContext) DeleteRayCluster(t *testing.T, clusterName string)
- func (e2etc *End2EndTestingContext) DeleteRayJobByName(t *testing.T, rayJobName string)
- func (e2etc *End2EndTestingContext) DeleteRayService(t *testing.T, serviceName string)
- func (e2etc *End2EndTestingContext) GetBatchV1JobByName(jobName string) (*batchv1.Job, error)
- func (e2etc *End2EndTestingContext) GetComputeTemplateName() string
- func (e2etc *End2EndTestingContext) GetConfigMapName() string
- func (e2etc *End2EndTestingContext) GetCurrentName() string
- func (e2etc *End2EndTestingContext) GetNamespaceName() string
- func (e2etc *End2EndTestingContext) GetNextName() string
- func (e2etc *End2EndTestingContext) GetRayApiServerClient() *kuberayHTTP.KuberayAPIServerClient
- func (e2etc *End2EndTestingContext) GetRayClusterByName(clusterName string) (*rayv1api.RayCluster, error)
- func (e2etc *End2EndTestingContext) GetRayClusterName() string
- func (e2etc *End2EndTestingContext) GetRayImage() string
- func (e2etc *End2EndTestingContext) GetRayJobByName(rayJobName string) (*rayv1api.RayJob, error)
- func (e2etc *End2EndTestingContext) GetRayServiceByName(serviceName string) (*rayv1api.RayService, error)
- type GenericEnd2EndTest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHttpRequest ¶
func CreateHttpRequest(method string, host string, endPoint string, body io.Reader) (*http.Request, error)
CreateHttpRequest instantiates a http request for the specified endpoint and host
func MakeBodyReader ¶
MakeBodyReader creates a io.Reader from the supplied string if is not empty after trimming the spaces
func PrettyPrintResponseBody ¶
func PrettyPrintResponseBody(body io.ReadCloser) (string, error)
PrettyPrintResponseBody generates a "pretty" formatted JSON string from the body
Types ¶
type End2EndTestingContext ¶
type End2EndTestingContext struct {
// contains filtered or unexported fields
}
End2EndTestingContext provides a common set of values and methods that can be used in executing the tests
func NewEnd2EndTestingContext ¶
func NewEnd2EndTestingContext(t *testing.T) (*End2EndTestingContext, error)
NewEnd2EndTestingContext constructs a *End2EndTestingContext
func (*End2EndTestingContext) CreateComputeTemplate ¶
func (e2etc *End2EndTestingContext) CreateComputeTemplate(t *testing.T)
func (*End2EndTestingContext) CreateConfigMap ¶
func (*End2EndTestingContext) CreateRayClusterWithConfigMaps ¶
func (*End2EndTestingContext) DeleteComputeTemplate ¶
func (e2etc *End2EndTestingContext) DeleteComputeTemplate(t *testing.T)
func (*End2EndTestingContext) DeleteConfigMap ¶
func (e2etc *End2EndTestingContext) DeleteConfigMap(t *testing.T, configMapName string)
func (*End2EndTestingContext) DeleteRayCluster ¶
func (e2etc *End2EndTestingContext) DeleteRayCluster(t *testing.T, clusterName string)
func (*End2EndTestingContext) DeleteRayJobByName ¶
func (e2etc *End2EndTestingContext) DeleteRayJobByName(t *testing.T, rayJobName string)
func (*End2EndTestingContext) DeleteRayService ¶
func (e2etc *End2EndTestingContext) DeleteRayService(t *testing.T, serviceName string)
func (*End2EndTestingContext) GetBatchV1JobByName ¶
func (e2etc *End2EndTestingContext) GetBatchV1JobByName(jobName string) (*batchv1.Job, error)
func (*End2EndTestingContext) GetComputeTemplateName ¶
func (e2etc *End2EndTestingContext) GetComputeTemplateName() string
func (*End2EndTestingContext) GetConfigMapName ¶
func (e2etc *End2EndTestingContext) GetConfigMapName() string
func (*End2EndTestingContext) GetCurrentName ¶
func (e2etc *End2EndTestingContext) GetCurrentName() string
func (*End2EndTestingContext) GetNamespaceName ¶
func (e2etc *End2EndTestingContext) GetNamespaceName() string
func (*End2EndTestingContext) GetNextName ¶
func (e2etc *End2EndTestingContext) GetNextName() string
func (*End2EndTestingContext) GetRayApiServerClient ¶
func (e2etc *End2EndTestingContext) GetRayApiServerClient() *kuberayHTTP.KuberayAPIServerClient
func (*End2EndTestingContext) GetRayClusterByName ¶
func (e2etc *End2EndTestingContext) GetRayClusterByName(clusterName string) (*rayv1api.RayCluster, error)
func (*End2EndTestingContext) GetRayClusterName ¶
func (e2etc *End2EndTestingContext) GetRayClusterName() string
func (*End2EndTestingContext) GetRayImage ¶
func (e2etc *End2EndTestingContext) GetRayImage() string
func (*End2EndTestingContext) GetRayJobByName ¶
func (e2etc *End2EndTestingContext) GetRayJobByName(rayJobName string) (*rayv1api.RayJob, error)
func (*End2EndTestingContext) GetRayServiceByName ¶
func (e2etc *End2EndTestingContext) GetRayServiceByName(serviceName string) (*rayv1api.RayService, error)