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 ¶
- Variables
- func BuildEnvoyGRPCHeaders(headers map[string]string, rawValue bool) *pb.HttpHeaders
- func CheckEnvoyGRPCHeaders(t *testing.T, response *pb.CommonResponse, expectedHeaders map[string]string) bool
- func DeleteObjects(testConfig *TestConfig, kindAndNames []string)
- func GetFreePort() (string, error)
- func GetStreamingServerClient(ctx context.Context, t *testing.T) (pb.ExternalProcessor_ProcessClient, *grpc.ClientConn)
- func LaunchTestGRPCServer(ctx context.Context, s pb.ExternalProcessorServer, listener net.Listener) error
- func NewTestContext(t *testing.T) context.Context
- func NewTestHandle(ctx context.Context) plugin.Handle
- func PrepareForTestStreamingServer(t *testing.T, objectives []*v1alpha2.InferenceObjective, pods []*corev1.Pod, ...) (context.Context, context.CancelFunc, datastore.Datastore)
- func SetupTestStreamingServer(ctx context.Context, t *testing.T, streamingServer pb.ExternalProcessorServer) (*bufconn.Listener, chan error)
- type TestConfig
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 DeleteObjects ¶
func DeleteObjects(testConfig *TestConfig, kindAndNames []string)
DeleteObjects deletes a set of Kubernetes objects in the form of kind/name.
func GetStreamingServerClient ¶
func GetStreamingServerClient(ctx context.Context, t *testing.T) (pb.ExternalProcessor_ProcessClient, *grpc.ClientConn)
func LaunchTestGRPCServer ¶
func LaunchTestGRPCServer(ctx context.Context, s pb.ExternalProcessorServer, listener net.Listener) error
LaunchTestGRPCServer actually starts the server (enables testing)
func NewTestContext ¶
NewTestContext creates a new context with a logger associated with the testing.T. It simplifies the boilerplate of integrating klog/logr with unit tests.
Types ¶
type TestConfig ¶
type TestConfig = igwtestutils.TestConfig
Click to show internal directories.
Click to hide internal directories.