Test Setup and Execution¶
This document provides steps to run the Gateway API Inference Extension conformance tests.
Prerequisites¶
-
You need a Kubernetes cluster with LoadBalancer support.
-
Choose an Implementation - Install an existing implementation. Alternatively run tests against your implementation after completing the implementer's guide.
Note: This repository provides a Lightweight Endpoint Picker (lwepp) specifically designed for conformance testing. Since the EPP takes the InferencePool name and namespace as command-line arguments, each conformance test automatically spins up a corresponding lwepp deployment for each InferencePool it defines. To facilitate deterministic route verification, the lwepp natively supports routing requests to a specific target pod via the test-epp-endpoint-selection header, which the conformance tests use to steer and validate routing behavior.
EPP log access¶
In addition to permissions to manage the conformance resources, the identity
running the suite needs list on pods and get on pods/log in the
application namespace (inference-conformance-app-backend). The
GatewayDestinationEndpointServed test reads the epp container's structured
logs to observe asynchronous response metadata independently of client headers.
For example, include these rules in a Role in that namespace and bind it to the
identity running the tests:
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["list"]
- apiGroups: [""]
resources: ["pods/log"]
verbs: ["get"]
The log query starts five minutes before the request to tolerate clock skew between the runner and cluster nodes. A unique request ID excludes other test runs. Authentication and authorization failures stop immediately; other API errors are retried until the request timeout.
Running Conformance Tests¶
-
Clone the Repository: Create a local copy of the Gateway API Inference Extension repository:
git clone https://github.com/kubernetes-sigs/gateway-api-inference-extension.git cd gateway-api-inference-extension/conformance -
Execute Tests: Run the following command to execute all available tests. Replace
<your_gatewayclass_name>with the GatewayClass used by the implementation under test.go test . -args -gateway-class <your_gatewayclass_name>
Test Execution Options¶
-
Speeding up Reruns: For repeated runs, you can add the flag
-cleanup-base-resources=false. This will preserve resources such as namespaces and gateways between test runs, speeding up the process.go test . -args -gateway-class <your_gatewayclass_name> -cleanup-base-resources=false -
Running Specific Tests: To run a specific test, you can reference the test name by using the
-run-testflag. For example:go test . -args -gateway-class <your_gatewayclass_name> -run-test HTTPRouteMultipleGatewaysDifferentPools -
Detailed Logging: To view detailed logs, you can enable logging mode by adding the
-vas well as-debugflags.go test -v . -args -debug -gateway-class <your_gatewayclass_name> -cleanup-base-resources=false -run-test HTTPRouteMultipleGatewaysDifferentPools