Files
traefik-llmgateway/tools
lukaszraczylo 56817b41d1 test(yaegi): prove attempt-accounting under the interpreter
SHOULD-4 (v0.22 review round): tools/yaegi-check now drives a real chat
completion against a local httptest upstream, then GET
/admin/api/overview, asserting the resulting provider reports exactly
one attempt and zero failures — end to end under Yaegi, not merely
compiled: runUnified's attemptRecorder -> retryPolicy.do's context lookup
-> limiter.recordProviderAttempt's isTransient/isDeadlineExceeded
classification -> its fire-and-forget spawn -> buildAdminOverview's own
batched providerUsage read. This also proves the SHOULD-1 hand-rolled
errors.Unwrap walk (matchesSentinel/isDeadlineExceeded, limits.go) runs
correctly interpreted, which `go test` cannot: that class of bug is
exactly what this harness exists to catch.

Adapted from a reviewer-provided reference harness (a second
json.Unmarshal layering a mock-upstream provider and an admin-flagged
user on top of the plugin's own .traefik.yml testData) rather than
reinvented — reworked to poll GET /admin/api/overview briefly (SHOULD-5's
fire-and-forget write can lag a single immediate read) and to assert on
the decoded attemptsDay/failuresDay values instead of only printing them,
so a regression here actually fails the gate.
2026-08-22 00:00:16 +01:00
..