mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-05 08:07:05 +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
29 lines
993 B
Python
29 lines
993 B
Python
from __future__ import annotations
|
|
|
|
from collections.abc import Sequence
|
|
from dataclasses import dataclass
|
|
from typing import Final, Protocol, assert_never
|
|
|
|
from .models import CaseDisposition, CaseResult
|
|
|
|
|
|
@dataclass(frozen=True, slots=True)
|
|
class ReportSection:
|
|
title: str
|
|
blocks: tuple[str, ...]
|
|
|
|
|
|
class StrategyRenderer(Protocol):
|
|
def __call__(self, results: Sequence[CaseResult]) -> tuple[ReportSection, ...]: ...
|
|
|
|
|
|
def render_case_outcome(result: CaseResult) -> str:
|
|
prefix: Final = f"- {result.case.display_name}: {result.status.value}"
|
|
spec: Final = result.case.spec
|
|
match spec.disposition:
|
|
case CaseDisposition.RUNNABLE:
|
|
progress: Final = f", {len(result.completed)}/{result.total} checks" if result.total else ""
|
|
return f"{prefix}{progress}, {spec.coverage.value} coverage"
|
|
case CaseDisposition.NOT_IMPLEMENTED | CaseDisposition.SKIPPED:
|
|
return f"{prefix}, {spec.reason}"
|
|
assert_never(spec.disposition)
|