e2e

package
v0.0.0-...-925effe Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0, BSD-2-Clause, MIT Imports: 26 Imported by: 0

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

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

func MakeBodyReader(s string) io.Reader

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

func ReadFileAsString

func ReadFileAsString(t *testing.T, fileName string) string

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 (e2etc *End2EndTestingContext) CreateConfigMap(t *testing.T, values map[string]string) string

func (*End2EndTestingContext) CreateRayClusterWithConfigMaps

func (e2etc *End2EndTestingContext) CreateRayClusterWithConfigMaps(t *testing.T, configMapValues map[string]string) (*api.Cluster, string)

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)

type GenericEnd2EndTest

type GenericEnd2EndTest[I proto.Message] struct {
	Name          string
	Input         I
	ExpectedError error
}

GenericEnd2EndTest struct allows for reuse in setting up and running tests

Jump to

Keyboard shortcuts

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