support

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0, BSD-2-Clause, MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RayVersion = "2.9.0"
	RayImage   = "rayproject/ray:2.9.0"
)
View Source
const (
	// KuberayTestOutputDir is the testing output directory, to write output files into.
	KuberayTestOutputDir = "KUBERAY_TEST_OUTPUT_DIR"

	// KuberayTestRayVersion is the version of Ray to use for testing.
	KuberayTestRayVersion = "KUBERAY_TEST_RAY_VERSION"

	// KuberayTestRayImage is the Ray image to use for testing.
	KuberayTestRayImage = "KUBERAY_TEST_RAY_IMAGE"
)

Variables

View Source
var (
	TestApplyOptions = metav1.ApplyOptions{FieldManager: "kuberay-test", Force: true}

	TestTimeoutShort  = 1 * time.Minute
	TestTimeoutMedium = 2 * time.Minute
	TestTimeoutLong   = 5 * time.Minute
)

Functions

func GetJob

func GetJob(t Test, namespace, name string) *batchv1.Job

func GetRayCluster

func GetRayCluster(t Test, namespace, name string) *rayv1.RayCluster

func GetRayImage

func GetRayImage() string

func GetRayJob

func GetRayJob(t Test, namespace, name string) *rayv1.RayJob

func GetRayJobId

func GetRayJobId(t Test, namespace, name string) string

func GetRayVersion

func GetRayVersion() string

func Job

func Job(t Test, namespace, name string) func(g gomega.Gomega) *batchv1.Job

func Jobs

func Jobs(t Test, namespace string) func(g gomega.Gomega) []batchv1.Job

func NotFound

func NotFound[T any](fn func(g gomega.Gomega) (T, error)) func(g gomega.Gomega) bool

func Pods

func Pods(t Test, namespace string, options ...Option[*metav1.ListOptions]) func(g gomega.Gomega) []corev1.Pod

func Ptr

func Ptr[T any](v T) *T

func RayCluster

func RayCluster(t Test, namespace, name string) func(g gomega.Gomega) *rayv1.RayCluster

func RayClusterOrError

func RayClusterOrError(t Test, namespace, name string) func(g gomega.Gomega) (*rayv1.RayCluster, error)

func RayClusterState

func RayClusterState(cluster *rayv1.RayCluster) rayv1.ClusterState

func RayJob

func RayJob(t Test, namespace, name string) func(g gomega.Gomega) *rayv1.RayJob

func RayJobDeploymentStatus

func RayJobDeploymentStatus(job *rayv1.RayJob) rayv1.JobDeploymentStatus

func RayJobReason

func RayJobReason(job *rayv1.RayJob) rayv1.JobFailedReason

func RayJobStatus

func RayJobStatus(job *rayv1.RayJob) rayv1.JobStatus

func WriteToOutputDir

func WriteToOutputDir(t Test, fileName string, fileType OutputType, data []byte)

Types

type Client

type Client interface {
	Core() kubernetes.Interface
	Ray() rayclient.Interface
	Dynamic() dynamic.Interface
}

type Option

type Option[T any] interface {
	// contains filtered or unexported methods
}

func LabelSelector

func LabelSelector(selector string) Option[*metav1.ListOptions]

type OutputType

type OutputType string
const (
	Log OutputType = "log"
)

type T

type T struct {
	*gomega.WithT
	// contains filtered or unexported fields
}

func (*T) Client

func (t *T) Client() Client

func (*T) Ctx

func (t *T) Ctx() context.Context

func (*T) NewTestNamespace

func (t *T) NewTestNamespace(options ...Option[*corev1.Namespace]) *corev1.Namespace

func (*T) OutputDir

func (t *T) OutputDir() string

func (*T) StreamKubeRayOperatorLogs

func (t *T) StreamKubeRayOperatorLogs()

func (*T) T

func (t *T) T() *testing.T

type Test

type Test interface {
	T() *testing.T
	Ctx() context.Context
	Client() Client
	OutputDir() string

	gomega.Gomega

	NewTestNamespace(...Option[*corev1.Namespace]) *corev1.Namespace
	StreamKubeRayOperatorLogs()
}

func With

func With(t *testing.T) Test

Jump to

Keyboard shortcuts

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