@@ -230,64 +230,84 @@ Collector delivery uses a short HTTP timeout and never blocks the request path;
230230
231231---
232232
233- CI Regression & Chart Testing (for Contributors)
233+ ## CI Regression & Chart Testing (for Contributors)
234234
235235This repository includes a mandatory CI regression pipeline to ensure Helm chart correctness,
236236Kubernetes compatibility, and safe upgrade behavior.
237237
238238All pull requests that modify Helm charts or CI workflows must pass this pipeline before being merged.
239239
240- What is validated in CI?
240+ ---
241+
242+ ### What is validated in CI?
241243
242244The helm-regression workflow performs the following checks, in order:
243245
2442461 . Helm chart linting
245- - Runs helm lint on the chart
246- - Catches common issues:
247- - Invalid chart metadata
248- - Obvious template mistakes
249- - Missing required values
247+ - Runs ` helm lint ` on the chart
248+ - Catches common issues:
249+ - Invalid chart metadata
250+ - Obvious template mistakes
251+ - Missing required values
250252
2512532 . Template rendering (dry-run)
252- - Renders manifests using:
253- - values-ci.yaml (required)
254- - values-test.yaml (optional, if present)
255- - Ensures templates render successfully without a live cluster
254+ - Renders manifests using:
255+ - ` values-ci.yaml ` (required)
256+ - ` values-test.yaml ` (optional, if present)
257+ - Ensures templates render successfully without a live cluster
256258
2572593 . Kubernetes schema validation (kubeconform)
258- - Validates rendered YAML against official Kubernetes schemas
259- - Uses strict mode
260- - Catches:
261- - Invalid API versions
262- - Invalid fields
263- - Structural mismatches that Helm itself does not detect
260+ - Validates rendered YAML against official Kubernetes schemas
261+ - Uses strict mode
262+ - Catches:
263+ - Invalid API versions
264+ - Invalid fields
265+ - Structural mismatches that Helm itself does not detect
264266
2652674 . Helm unit tests
266- - Runs helm unittest against the chart
267- - Validates:
268- - Expected resources are created
269- - Correct values are applied
270- - Conditional logic behaves as intended
268+ - Runs ` helm unittest ` against the chart
269+ - Validates:
270+ - Expected resources are created
271+ - Correct values are applied
272+ - Conditional logic behaves as intended
271273
2722745 . In-cluster install & upgrade test (kind)
273- - Spins up a real Kubernetes cluster using kind
274- - Builds proxy and collector images locally
275- - Loads images into the cluster
276- - Installs the chart using helm upgrade --install
277- - Verifies:
278- - Pods start successfully
279- - Deployments become ready
280- - Performs a real Helm upgrade
281- - Uses values-test.yaml if present
282- - Ensures upgrades do not break running workloads
275+ - Spins up a real Kubernetes cluster using kind
276+ - Builds proxy and collector images locally
277+ - Loads images into the cluster
278+ - Installs the chart using ` helm upgrade --install `
279+ - Verifies:
280+ - Pods start successfully
281+ - Deployments become ready
282+ - Performs a real Helm upgrade:
283+ - Uses ` values-test.yaml ` if present
284+ - Ensures upgrades do not break running workloads
283285
2842866 . Smoke checks
285- - Confirms:
286- - Pods are running
287- - Services are created
288- - Deployments reach Available condition
287+ - Confirms:
288+ - Pods are running
289+ - Services are created
290+ - Deployments reach Available condition
291+
292+ 7 . OpenAI-compatible contract tests
293+ - Deploys a lightweight in-cluster mock OpenAI upstream
294+ - Configures the gateway to point to the mock via ` UPSTREAM_OPENAI_BASE_URL `
295+ - Sends real HTTP requests to the gateway service
296+ - Validates the public OpenAI-compatible contract, including:
297+ - Chat completions (non-streaming)
298+ - VLM-style payloads (` image_url ` content)
299+ - Streaming (SSE) passthrough with ` [DONE] `
300+ - Presence of ` usage ` fields in responses
301+
302+ These tests intentionally validate the API contract and behavior,
303+ not model semantics or response quality.
304+
305+ They ensure that changes to the proxy, chart, or deployment logic
306+ do not silently break OpenAI compatibility.
307+
308+ ---
289309
290- Files contributors should be aware of:
310+ ### Files contributors should be aware of
291311
292312- charts/llm-gateway/values-ci.yaml
293313 Required for CI. Used for deterministic, non-secret test installs.
@@ -298,7 +318,13 @@ Files contributors should be aware of:
298318- .github/workflows/helm-regression.yml
299319 CI definition. Any change here is also gated by this workflow.
300320
301- Running key checks locally (recommended):
321+ - tests/contract/
322+ Contains OpenAI-compatible contract tests executed in CI and runnable locally.
323+ See tests/contract/README.md for details.
324+
325+ ---
326+
327+ ### Running key checks locally (recommended)
302328
303329helm lint charts/llm-gateway
304330
@@ -311,7 +337,9 @@ For full parity with CI (optional but ideal):
311337- Build images locally
312338- Install the chart with helm upgrade --install
313339
314- CI expectations:
340+ ---
341+
342+ ### CI expectations
315343
316344- CI failures must be fixed, not bypassed
317345- Do not disable schema validation or tests to make CI green
@@ -325,13 +353,15 @@ This pipeline exists to ensure the Helm chart remains:
325353- Kubernetes-version compatible
326354- Predictable across environments
327355
356+ ---
357+
328358## Planned next steps
329359
330360### Regression & compatibility test suite
331361- Introduce a minimal regression test suite to validate the gateway’s public contract ✅
332362- Focus on high-risk areas:
333- - OpenAI-compatible request/response schemas
334- - Streaming (SSE) pass-through behavior
363+ - OpenAI-compatible request/response schemas ✅
364+ - Streaming (SSE) pass-through behavior ✅
335365 - Error and status code mapping
336366 - Metering event emission (usage present vs missing)
337367- Use a mock upstream and lightweight in-cluster setup (e.g., kind or docker-compose) ✅
0 commit comments