mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-29 07:49:14 +01:00
[proxy] Add e2e cover for the gateway protocol changes
The routing and parser-selection fixes touch every provider surface, and the unit tests only prove each side of a seam in isolation. Two suites close that: The provider matrix drives one request per wire shape over a single tunnel, with a record per catalog surface behind it, and asserts the surface each request was metered under together with the token counts that surface's own usage block carries. A response read by the wrong provider's parser meters zero, so a regression fails instead of passing on a coincidental non-zero. It also covers the Bedrock and Vertex token-counting paths, the warm-up probe, and the vendor error envelope on a refusal. The discovery suite covers the configuration that broke: an account with a model allowlist, where the listing carries no model and the gate failed closed. It asserts the listing is served, that it is bounded to the authorised model, and that inference outside the allowlist is still refused, so the exemption cannot be read as a way around the gate. The mock upstream grows the Anthropic, Bedrock and token-counting shapes so one container stands in for every surface, and the client gains GET and arbitrary-POST helpers for the endpoints that carry no chat body.
This commit is contained in:
@@ -23,9 +23,10 @@ import (
|
||||
// model the client asks for. The proxy prices off the REQUEST model, not the
|
||||
// upstream response model, so a made-up model id billed at operator rates lets
|
||||
// these tests assert exact costs without a real vendor key.
|
||||
// Sourced from the harness so the counts can't drift from the mock's config.
|
||||
const (
|
||||
vllmPromptTokens = 11
|
||||
vllmCompletionTokens = 2
|
||||
vllmPromptTokens = harness.VLLMChatInputTokens
|
||||
vllmCompletionTokens = harness.VLLMChatOutputTokens
|
||||
)
|
||||
|
||||
// pricedEnv is a connected single-provider agent-network deployment pointed at
|
||||
|
||||
Reference in New Issue
Block a user