utils

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package utils contains utilities for testing

Package utils provides test utilities for the llm-d router. DeleteObjects and getClientObject restore the function removed from sigs.k8s.io/gateway-api-inference-extension/test/utils in v1.5.0.

Package utils contains utilities for testing

Index

Constants

This section is empty.

Variables

View Source
var (
	NewTestConfig      = igwtestutils.NewTestConfig
	ApplyYAMLFile      = igwtestutils.ApplyYAMLFile
	CreateObjsFromYaml = igwtestutils.CreateObjsFromYaml
	ReadYaml           = igwtestutils.ReadYaml
)

Functions

func BuildEnvoyGRPCHeaders

func BuildEnvoyGRPCHeaders(headers map[string]string, rawValue bool) *pb.HttpHeaders

func CheckEnvoyGRPCHeaders

func CheckEnvoyGRPCHeaders(t *testing.T, response *pb.CommonResponse, expectedHeaders map[string]string) bool

func DeleteObjects

func DeleteObjects(testConfig *TestConfig, kindAndNames []string)

DeleteObjects deletes a set of Kubernetes objects in the form of kind/name.

func GetFreePort

func GetFreePort() (string, error)

GetFreePort finds a free port to listen on

func LaunchTestGRPCServer

func LaunchTestGRPCServer(ctx context.Context, s pb.ExternalProcessorServer, listener net.Listener) error

LaunchTestGRPCServer actually starts the server (enables testing)

func NewTestContext

func NewTestContext(t *testing.T) context.Context

NewTestContext creates a new context with a logger associated with the testing.T. It simplifies the boilerplate of integrating klog/logr with unit tests.

func NewTestHandle

func NewTestHandle(ctx context.Context) plugin.Handle

func PrepareForTestStreamingServer

func PrepareForTestStreamingServer(t *testing.T, objectives []*v1alpha2.InferenceObjective, pods []*corev1.Pod, poolName string, namespace string,
	poolPort int32) (context.Context, context.CancelFunc, datastore.Datastore)

func SetupTestStreamingServer

func SetupTestStreamingServer(ctx context.Context, t *testing.T, streamingServer pb.ExternalProcessorServer) (*bufconn.Listener, chan error)

Types

type TestConfig

type TestConfig = igwtestutils.TestConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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