|
| 1 | + |
| 2 | +# Test Setup and Execution |
| 3 | + |
| 4 | +This document provides steps to run the Gateway API Inference Extension conformance tests. |
| 5 | + |
| 6 | +## Prerequisites |
| 7 | + |
| 8 | +1. You need a Kubernetes cluster with [LoadBalancer](https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) support. |
| 9 | + |
| 10 | +2. Choose an Implementation - |
| 11 | +Install an [existing implementation](https://gateway-api-inference-extension.sigs.k8s.io/implementations/gateways/). For setup instructions, refer to the [The Quickstart Guide](https://gateway-api-inference-extension.sigs.k8s.io/guides/). Alternatively run tests against your implementation after completing the [implementer's guide](https://gateway-api-inference-extension.sigs.k8s.io/guides/implementers/#implementers-guide). |
| 12 | + |
| 13 | +Note: Since the EPP (EndPoint Picker) takes the `InferencePool` name as an environment variable, each conformance test creates a corresponding EPP deployment for each `InferencePool` it defines. For conformance testing, the EPP is configured with the `HeaderBasedTestingFilter`. This is enabled by setting the `ENABLE_REQ_HEADER_BASED_SCHEDULER_FOR_TESTING=true` environment variable in the EPP deployment manifest. |
| 14 | + |
| 15 | +## Running Conformance Tests |
| 16 | + |
| 17 | +1. **Clone the Repository**: |
| 18 | + Create a local copy of the Gateway API Inference Extension repository: |
| 19 | + ```bash |
| 20 | + git clone https://github.com/kubernetes-sigs/gateway-api-inference-extension.git |
| 21 | + cd gateway-api-inference-extension |
| 22 | + ``` |
| 23 | + |
| 24 | +2. **Execute Tests**: |
| 25 | + Run the following command to execute all available tests. Replace `<your_gatewayclass_name>` with the GatewayClass used by the implementation under test. |
| 26 | + |
| 27 | + ```bash |
| 28 | + go test ./conformance -args -gateway-class <your_gatewayclass_name> |
| 29 | + ``` |
| 30 | + |
| 31 | +### Test Execution Options |
| 32 | + |
| 33 | +* **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. |
| 34 | + ```bash |
| 35 | + go test ./conformance -args -gateway-class <your_gatewayclass_name> -cleanup-base-resources=false |
| 36 | + ``` |
| 37 | + |
| 38 | +* **Running Specific Tests**: To run a specific test, you can reference the test name by using the `-run-test` flag. For example: |
| 39 | + ```bash |
| 40 | + go test ./conformance -args -gateway-class <your_gatewayclass_name> -run-test HTTPRouteMultipleGatewaysDifferentPools |
| 41 | + ``` |
| 42 | + |
| 43 | +* **Detailed Logging**: To view detailed logs, you can enable logging mode by adding the `-v` as well as `-debug` flags. |
| 44 | + ```bash |
| 45 | + go test -v ./conformance -args -debug -gateway-class <your_gatewayclass_name> -cleanup-base-resources=false -run-test HTTPRouteMultipleGatewaysDifferentPools |
| 46 | + ``` |
0 commit comments