test(integration): accept list-valued top-level keys in the base integration proxy config

The shared tests/integration/proxy_config.yaml now carries list-valued top-level keys, so the retention config helper validates only the mapping it merges into. Also drops a SQL-shape assertion from the unit test in favor of the behavioral cutoff-day check

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
yucheng 2026-09-23 07:52:18 +00:00
parent 5af70fedca
commit 609b3f8ded
2 changed files with 3 additions and 4 deletions

View file

@ -14,7 +14,7 @@ from tests.integration._support.database import read_rows
from tests.integration._support.process import owned_proxy
CLEANUP_EVERY_MINUTE: Final = "* * * * *"
_CONFIG: Final = TypeAdapter(dict[str, dict[str, JsonValue]])
_MAPPING: Final = TypeAdapter(dict[str, JsonValue])
def _day(days_ago: int) -> str:
@ -55,11 +55,11 @@ def _spend_log_present(request_id: str) -> bool:
def _cleanup_config(tmp_path: Path, retention: dict[str, JsonValue]) -> Path:
base: Final = _CONFIG.validate_python(yaml.safe_load(Path("tests/integration/proxy_config.yaml").read_text()))
base: Final = _MAPPING.validate_python(yaml.safe_load(Path("tests/integration/proxy_config.yaml").read_text()))
config: Final = {
**base,
"general_settings": {
**base["general_settings"],
**_MAPPING.validate_python(base["general_settings"]),
**retention,
"maximum_spend_logs_cleanup_cron": CLEANUP_EVERY_MINUTE,
"scheduled_job_stagger": {"enabled": False},

View file

@ -835,7 +835,6 @@ async def test_daily_tag_spend_retention_alone_prunes_only_that_table_by_calenda
tables = [call[0][0] for call in client.db.execute_raw.call_args_list]
assert len(tables) == 1
assert '"LiteLLM_DailyTagSpend"' in tables[0]
assert '"date" < $1::text' in tables[0]
cutoff_day = client.db.execute_raw.call_args[0][1]
assert cutoff_day == (datetime.now(timezone.utc) - timedelta(days=90)).date().isoformat()