mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-10-14 05:18:54 +00:00
fix(docs,integration): example env completeness, flaky reset, cache key assertion
Task 5 re-review fixes: 1 Important + 3 folded. 1. (Important) examples/kubernetes.yaml was construction-broken on copy-paste: the inline dashboard-admin user resolves env:LLMGW_ADMIN_KEY at construction time regardless of admin.enabled, but the Helm env snippet never listed it. Added it there, alongside a comment on the admin user explaining the env var is required either way. Fixed the two reversed above/below cross-references (kubernetes.yaml:90/:115) and reworded the misleading "self-contained" comment on the inline admin user. Verified with a throwaway round-trip test covering: no env vars set fails, every documented env var set succeeds (admin.enabled staying false as committed), and — the actual bug — every var set EXCEPT LLMGW_ADMIN_KEY still fails even with admin disabled. 2. README: Admin section's "(disabled still 404s)" now points at the same 404/passthroughUnknown wording the section already uses above it. Caching section's "block absent entirely is a construction error" now says "not enabled" — auth.go's actual check is !cfg.Cache.Enabled, which is identically true whether the block is omitted or present with enabled: false. 3. integration/mock/main.go: added POST /flaky/reset (handleFlakyReset), reachable through the "flaky" provider's own native passthrough route, resetting the atomic hit counter on demand. TestRetryFlakyRecovers now calls it at the start of the test, removing the make integration-keep re-run trap the old doc comment warned about instead of fixing. dynamic.yml.tmpl's stale "test 8" comment now reads "task 5". 4. integration_test.go: added redisKeys (docker compose exec redis-cli KEYS, mirroring flushRedis's own pattern) and a TestResponseCache assertion that redis holds at least one llmgw:cache:* key immediately after the miss request. go test ./... -count=1, gofmt, vet, make yaegi-check all pass; make integration exits 0 across two fresh full runs.
This commit is contained in:
@@ -44,14 +44,16 @@ http:
|
||||
baseUrl: "http://mockgemini:8080"
|
||||
apiKey: "mock-gemini-key"
|
||||
models: ["gemini-mock"]
|
||||
# Backs test 8's retry coverage only: baseUrl points at the
|
||||
# Backs task 5's retry coverage only: baseUrl points at the
|
||||
# SAME mockopenai container, under its dedicated /flaky prefix
|
||||
# (see integration/mock/main.go's handleFlakyOpenAIChat), so
|
||||
# a.baseURL+"/v1/chat/completions" (provider_openai.go)
|
||||
# resolves to /flaky/v1/chat/completions. discovery is left
|
||||
# off — GET /flaky/v1/models isn't served — so the explicit
|
||||
# "flaky-mock" model id below is the only way this provider's
|
||||
# model is known.
|
||||
# resolves to /flaky/v1/chat/completions, and this provider's
|
||||
# own native passthrough route (/flaky/reset) reaches
|
||||
# handleFlakyReset the same way. discovery is left off — GET
|
||||
# /flaky/v1/models isn't served — so the explicit "flaky-mock"
|
||||
# model id below is the only way this provider's model is
|
||||
# known.
|
||||
flaky:
|
||||
type: openai
|
||||
baseUrl: "http://mockopenai:8080/flaky"
|
||||
|
||||
Reference in New Issue
Block a user