e2e

package
v0.999.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceReadyTimeout = 5 * time.Minute
)

Variables

View Source
var (
	Scheme = runtime.NewScheme()
)
View Source
var TestOpts = NewTestOptions()

TestOpts is the global test options instance.

Functions

func CleanupTestEnv

func CleanupTestEnv(env *TestEnvironment)

CleanupTestEnv cleans up the test environment.

func EnsureResourceDeleted

func EnsureResourceDeleted(t *testing.T, testenv *TestEnvironment, gvk schema.GroupVersionKind, name, namespace string, timeout time.Duration) error

EnsureResourceDeleted polls until the resource is deleted.

func EnsureResourceReady

func EnsureResourceReady(
	t *testing.T,
	testenv *TestEnvironment,
	gvk schema.GroupVersionKind,
	name, namespace string,
	timeout time.Duration,
	isReady func(*unstructured.Unstructured) bool,
) error

EnsureResourceReady polls until the resource is ready.

func GetDeployment

func GetDeployment(cl client.Client, ctx context.Context, name, namespace string) (*appsv1.Deployment, error)

GetDeployment gets a deployment by name and namespace.

func GetPodsForDeployment added in v0.5.0

func GetPodsForDeployment(testenv *TestEnvironment, ctx context.Context, namespace, deploymentName string) (*corev1.PodList, error)

GetPodsForDeployment retrieves the list of pods for a given deployment.

func GetSampleCRForDistribution

func GetSampleCRForDistribution(t *testing.T, distType string) *v1alpha1.LlamaStackDistribution

GetSampleCRForDistribution returns a LlamaStackDistribution configured for the specified distribution type.

func WaitForPodsReady added in v0.5.0

func WaitForPodsReady(t *testing.T, testenv *TestEnvironment, namespace, deploymentName string, timeout time.Duration) error

WaitForPodsReady polls until all pods for a deployment are running and ready.

Types

type TestEnvironment

type TestEnvironment struct {
	Client client.Client
	Ctx    context.Context //nolint:containedctx // Context is used for test environment
}

TestEnvironment holds the test environment configuration.

func SetupTestEnv

func SetupTestEnv() (*TestEnvironment, error)

SetupTestEnv sets up the test environment.

type TestOptions

type TestOptions struct {
	SkipValidation bool
	SkipCreation   bool
	SkipDeletion   bool
	OperatorNS     string
}

TestOptions defines the configuration for running tests.

func NewTestOptions

func NewTestOptions() *TestOptions

NewTestOptions creates a new TestOptions instance with default values.

func (*TestOptions) String

func (o *TestOptions) String() string

String returns a string representation of the test options.

Jump to

Keyboard shortcuts

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