From 0d9c5159df084e1c589bc282be4431273d4fd3e9 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Fri, 18 Sep 2026 02:52:00 -0700 Subject: [PATCH] test(e2e): assert config ownership instead of absence from the stored row /config/field/info used to answer from the LiteLLM_Config row, so "the field 400s" proved the row did not carry it. It now answers from the resolved settings, and the CI stack config declares general_settings.max_parallel_requests, so the endpoint returns that value and the old assertion could never hold. The check that /add/allowed_ip writes only what the caller changed moves to /config/list, which still reports stored_in_db off the row, and the field/info call now asserts the ownership the endpoint reports: the config file owns the key, so it reads back as source=config and editable=false. Verified against a live proxy on an isolated Postgres rather than in CI, where this check has never run: it waits on protected-environment approval. --- .../test_config_misc_endpoints_e2e.py | 55 +++++++++++++++---- 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/tests/e2e/management/test_config_misc_endpoints_e2e.py b/tests/e2e/management/test_config_misc_endpoints_e2e.py index 85b578a181a..20e98e993d4 100644 --- a/tests/e2e/management/test_config_misc_endpoints_e2e.py +++ b/tests/e2e/management/test_config_misc_endpoints_e2e.py @@ -24,10 +24,10 @@ from collections.abc import Callable from typing import Final import pytest -from pydantic import BaseModel, JsonValue +from pydantic import BaseModel, JsonValue, RootModel from e2e_config import unique_marker -from e2e_http import NoBody, Success, UnknownApiError, unwrap, unwrap_status +from e2e_http import NoBody, Success, unwrap, unwrap_status from lifecycle import ResourceManager from management_client import ManagementClient from models import KeyGenerateBody, LiteLLMParamsBody, TeamNewBody @@ -210,6 +210,24 @@ class ConfigFieldInfoParams(BaseModel): class ConfigFieldInfoResponse(BaseModel): field_name: str field_value: JsonValue + source: str + editable: bool + + +class ConfigListParams(BaseModel): + config_type: str + + +class ConfigListEntry(BaseModel): + field_name: str + field_value: JsonValue + stored_in_db: bool | None + source: str + editable: bool + + +class ConfigListResponse(RootModel[list[ConfigListEntry]]): + pass class RouterCurrentValues(BaseModel): @@ -556,17 +574,30 @@ class TestConfigPersistence: ) assert added.message == f"IP {allowed_ip} address added successfully" - field_info: Final = client.proxy.transport.get( - "/config/field/info", - headers=client.proxy.transport.master, - params=ConfigFieldInfoParams(field_name="max_parallel_requests"), - response_type=ConfigFieldInfoResponse, + listed: Final = unwrap( + client.proxy.transport.get( + "/config/list", + headers=client.proxy.transport.master, + params=ConfigListParams(config_type="general_settings"), + response_type=ConfigListResponse, + ) ) - match field_info: - case UnknownApiError(status_code=400, body=body): - assert "is not set" in body - case _: - pytest.fail(f"expected max_parallel_requests to remain absent from the DB row, got {field_info}") + unrelated: Final = next(entry for entry in listed.root if entry.field_name == "max_parallel_requests") + assert unrelated.stored_in_db is not True + assert unrelated.source == "config" + assert unrelated.editable is False + + field_info: Final = unwrap( + client.proxy.transport.get( + "/config/field/info", + headers=client.proxy.transport.master, + params=ConfigFieldInfoParams(field_name="max_parallel_requests"), + response_type=ConfigFieldInfoResponse, + ) + ) + assert field_info.source == "config" + assert field_info.editable is False + assert field_info.field_value == unrelated.field_value class TestMcpServerSubmission: