mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-12 03:48:56 +00:00
* perf(ci): distribute unit cases and reuse security sweep connections * revert(ci): reject first speed trial after new failures * perf(ci): avoid repeated test discovery and parsing * perf(ci): isolate parallel security workers * revert(ci): restore measured security execution isolation * perf(tests): reuse source scans and deduplicate cache cleanup * perf(ci): restore parallel security with safe log batching * test(ci): isolate fixture state and schema comparisons * test(ci): make schema and scheduler fixtures deterministic * test(ci): drain queued logging before fixture teardown * test(ci): preserve logging delivery without idle worker restarts * test(ci): keep guardrail sinks available during parallel bursts * test(ci): isolate full proxy lifecycle from gateway imports * test(ci): preserve first failure responses and sweep evidence * test(ci): restore documentation URL settings between cases * test(ci): isolate open MCP tools in private gateways * test(ci): group private MCP cases and handle exited workers * test(ci): retain proxy exits and MCP failure details * test(ci): repair merge interactions with main Key the schema shard's full clone on artifact-name, since main removed the unit-flag input. Give each owned Redis its own log file again. Hand the realtime transcription tests main added a logging object whose dispatch handlers are awaitable, so the per-test logging drain no longer waits on a MagicMock task forever * perf(ci): shard owned integration cases and close lifecycle leaks * fix(ci): qualify shard execution and harden interrupted cleanup * fix(ci): bound worker supervision and own fault traffic * perf(ci): reuse unparametrized fixtures across bounded case groups * fix(ci): preserve boot fault allowances and complete exit records * test(ci): tolerate startup retries and retain readiness details * perf(ci): balance integration shards by recorded duration * fix(ci): load migration database helpers only for workers
42 lines
1.6 KiB
Python
42 lines
1.6 KiB
Python
from typing import Final
|
|
|
|
import pytest
|
|
|
|
from scripts.check_schema_compatibility import check_breaking_changes, parse_model_fields
|
|
|
|
ORIGINAL: Final = "model Item {\n id String @id\n label String?\n}\n"
|
|
|
|
|
|
def test_aaaaaschema_compatibility() -> None:
|
|
added: Final = "model Item {\n id String @id\n label String?\n count Int?\n}\nmodel Extra {\n id String @id\n}\n"
|
|
assert check_breaking_changes(parse_model_fields(ORIGINAL), parse_model_fields(added)) == ()
|
|
|
|
|
|
def test_parse_model_fields_retains_types_and_attributes() -> None:
|
|
assert parse_model_fields(ORIGINAL) == {"Item": {"id": "String @id", "label": "String?"}}
|
|
|
|
|
|
def test_parse_model_fields_keeps_json_defaults_and_empty_models() -> None:
|
|
schema: Final = 'model Item {\n data Json @default("{}")\n}\nmodel Empty {\n}\n'
|
|
assert parse_model_fields(schema) == {"Item": {"data": 'Json @default("{}")'}, "Empty": {}}
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
("schema", "expected"),
|
|
(
|
|
("", ("Breaking: Model Item was removed",)),
|
|
("model Item {\n id String @id\n}\n", ("Breaking: Field Item.label was removed",)),
|
|
(
|
|
"model Item {\n id String @id\n label String\n}\n",
|
|
("Breaking: Field Item.label changed from optional to required",),
|
|
),
|
|
(
|
|
"model Item {\n id String @id\n label Int?\n}\n",
|
|
("Breaking: Field Item.label changed type from String? to Int?",),
|
|
),
|
|
),
|
|
)
|
|
def test_schema_compatibility_rejects_removed_models_fields_and_narrowed_types(
|
|
schema: str, expected: tuple[str, ...]
|
|
) -> None:
|
|
assert check_breaking_changes(parse_model_fields(ORIGINAL), parse_model_fields(schema)) == expected
|