mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
* wip * refactor(tests): move sdk function tracing into rust python harness * dead code * fix: handle harness keyboard interrupts * refactor(tests): deduplicate rust python harness helpers * fix(harness): expose validated strategy choices * wip * refactor(harness): let strategies own parity reports * docs(harness): update strategy structure * refactor(harness): localize strategy report views * wip * fix(harness): satisfy mapping runner type checks * fix(harness): clarify trace parity output * wip * fix(harness): clarify unit mapping report * fix(harness): finalize trace parity contracts * refactor(harness): structure parity contracts * feat: derive unit test mapping from traces * feat(harness): map rstest test families * feat(ocr): port Azure document intelligence tests * feat(harness): enforce complete unit mappings * feat(ocr): add reducto core transforms * feat(harness): classify host-only unit tests * fix(ocr): complete Rust provider plumbing * fix(harness): reuse OCR parity workers
34 lines
1.2 KiB
Python
34 lines
1.2 KiB
Python
from __future__ import annotations
|
|
|
|
from collections.abc import Sequence
|
|
from pathlib import Path
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
from ...shared.unit_runners.rust_runner import run_rust_tests
|
|
from ...shared.unit_runners.suite_runner import SuiteExecution
|
|
|
|
|
|
class RustSuite(BaseModel):
|
|
model_config = ConfigDict(frozen=True, extra="forbid")
|
|
|
|
cargo_manifest: str
|
|
cargo_package: str | None = None
|
|
cargo_filter: str
|
|
|
|
|
|
def run_suite(suite: RustSuite, repo_root: Path, pytest_args: Sequence[str] = ()) -> SuiteExecution:
|
|
del pytest_args
|
|
if not suite.cargo_filter:
|
|
return SuiteExecution(problems=("rust suites must configure a focused Cargo filter",))
|
|
inventory = run_rust_tests(
|
|
repo_root / suite.cargo_manifest, suite.cargo_package, suite.cargo_filter, collect_only=True
|
|
)
|
|
rust = run_rust_tests(repo_root / suite.cargo_manifest, suite.cargo_package, suite.cargo_filter)
|
|
return SuiteExecution(
|
|
problems=(
|
|
*(("native Rust tests did not all pass",) if set(inventory.tests) != set(rust.tests) else ()),
|
|
*((inventory.output,) if inventory.exit_code else ()),
|
|
*((rust.output,) if rust.exit_code else ()),
|
|
)
|
|
)
|