mirror of
https://github.com/tiennm99/litellm.git
synced 2026-06-17 22:48:35 +00:00
[Test] CI: add v2 migration resolver coverage with local Postgres
Adds end-to-end CI coverage for `--use_v2_migration_resolver` via a new job `installing_litellm_on_python_v2_migration_resolver`: - Clones the pytest smoke path from `installing_litellm_on_python` but uses a local Postgres sidecar instead of the shared DB to prevent collisions with the v1 variant. - Runs only the new `test_litellm_proxy_server_config_no_general_settings_v2_resolver` which spawns the proxy with `--use_v2_migration_resolver` and smoke-tests `/health/liveliness` and `/chat/completions`. Refactors `test_basic_python_version.py`: - Extracts the proxy spawn + smoke-test body into `_run_proxy_server_smoke_test` so the v1 and v2 tests share the same code path. - The existing `test_litellm_proxy_server_config_no_general_settings` is now a thin wrapper that passes no extra args (v1 default, unchanged). - Adds `..._v2_resolver` variant that passes `--use_v2_migration_resolver`. The existing `installing_litellm_on_python` / `installing_litellm_on_python_3_13` jobs filter out the v2 variant via `-k "not v2_resolver"` so they keep running only against their shared DB, unchanged behavior.
This commit is contained in:
@@ -100,8 +100,12 @@ import pytest
|
||||
import requests
|
||||
|
||||
|
||||
def test_litellm_proxy_server_config_no_general_settings():
|
||||
# Sync the local litellm packages into the project environment
|
||||
def _run_proxy_server_smoke_test(extra_proxy_args=None):
|
||||
"""Sync deps, generate Prisma client, start proxy with optional extra args,
|
||||
send a health check + chat/completions request, and tear down."""
|
||||
if extra_proxy_args is None:
|
||||
extra_proxy_args = []
|
||||
|
||||
server_process = None
|
||||
try:
|
||||
_run_uv(
|
||||
@@ -144,6 +148,7 @@ def test_litellm_proxy_server_config_no_general_settings():
|
||||
"litellm.proxy.proxy_cli",
|
||||
"--config",
|
||||
config_fp,
|
||||
*extra_proxy_args,
|
||||
],
|
||||
cwd=PROJECT_ROOT,
|
||||
)
|
||||
@@ -182,3 +187,17 @@ def test_litellm_proxy_server_config_no_general_settings():
|
||||
|
||||
# Additional assertions can be added here
|
||||
assert True
|
||||
|
||||
|
||||
def test_litellm_proxy_server_config_no_general_settings():
|
||||
"""Exercises the default (v1) migration resolver."""
|
||||
_run_proxy_server_smoke_test()
|
||||
|
||||
|
||||
def test_litellm_proxy_server_config_no_general_settings_v2_resolver():
|
||||
"""Exercises the opt-in v2 migration resolver.
|
||||
|
||||
Runs in a separate CI job against a local Postgres to avoid collisions
|
||||
with the v1 variant when they share a database.
|
||||
"""
|
||||
_run_proxy_server_smoke_test(extra_proxy_args=["--use_v2_migration_resolver"])
|
||||
|
||||
Reference in New Issue
Block a user