test(harness): add OCR parity with migration strategy runners - #38765
Merged
yujonglee-berri merged 1 commit intoSep 3, 2026
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
yujonglee-berri
marked this pull request as draft
August 29, 2026 17:24
yujonglee-berri
force-pushed
the
litellm_ocr_sdk_parity_tests
branch
from
August 29, 2026 21:10
47cc979 to
b8ca869
Compare
yujonglee-berri
marked this pull request as ready for review
August 30, 2026 00:30
Contributor
Greptile SummaryAdds a reusable recorded-fixture parity harness for comparing Python and accelerated OCR request and response behavior
Confidence Score: 5/5The PR appears safe to merge No blocking failure remains
|
| Filename | Overview |
|---|---|
| tests/test_litellm/ocr/test_sdk_parity.py | Exercises both sync and async OCR routes through isolated workers and validates request and normalized-response parity |
| tests/route_parity/compare.py | Verifies accelerated execution did not use the Python HTTP fallback before comparing requests and responses |
| tests/route_parity/runner.py | Manages persistent parity worker subprocesses with bounded execution and cleanup |
| tests/route_parity/fixture_recorder.py | Generates deterministic inputs and records versioned provider-response fixtures through a local proxy |
| tests/route_parity/replay.py | Replays recorded HTTP responses while capturing provider requests for parity assertions |
Reviews (2): Last reviewed commit: "test(ocr): preserve explicit model fixtu..." | Re-trigger Greptile
ishaan-berri
requested changes
Aug 30, 2026
6 tasks
yujonglee-berri
force-pushed
the
litellm_ocr_sdk_parity_tests
branch
from
August 30, 2026 20:48
55cbe51 to
cd51e75
Compare
Contributor
PR overviewAll previously flagged issues have been addressed. No open security concerns remain on this pull request. Security reviewNo open security issues remain on this pull request. Fixed/addressed: 3 · PR risk: 0/10 |
6 tasks
yujonglee-berri
force-pushed
the
litellm_ocr_sdk_parity_tests
branch
2 times, most recently
from
September 1, 2026 19:30
8cc4fc2 to
a555e8e
Compare
yujonglee-berri
changed the base branch from
litellm_internal_staging
to
codex/lit-6533-ocr-function-parity
September 2, 2026 18:35
yujonglee-berri
force-pushed
the
litellm_ocr_sdk_parity_tests
branch
from
September 2, 2026 18:36
b36325d to
0dd8372
Compare
ishaan-berri
approved these changes
Sep 2, 2026
ishaan-berri
left a comment
Contributor
There was a problem hiding this comment.
- So follow up here: the tests should not run on CI. Make a folder called Rust Python harness tests.
- Beyond this, you should have a base class for each testing strategy that we're using, and then for each provider or endpoint, we just reuse that same base class.
yujonglee-berri
force-pushed
the
litellm_ocr_sdk_parity_tests
branch
2 times, most recently
from
September 2, 2026 21:39
e86cd6d to
112611c
Compare
yujonglee-berri
changed the base branch from
codex/lit-6533-ocr-function-parity
to
litellm_ocr_compiler_profiles
September 2, 2026 21:40
yujonglee-berri
force-pushed
the
litellm_ocr_sdk_parity_tests
branch
from
September 2, 2026 22:58
a61adf5 to
112611c
Compare
6 tasks
yujonglee-berri
force-pushed
the
litellm_ocr_sdk_parity_tests
branch
from
September 2, 2026 23:19
112611c to
1ab17f0
Compare
yujonglee-berri
requested review from
mateo-berri,
ryan-crabbe-berri and
yuneng-berri
as code owners
September 2, 2026 23:19
yujonglee-berri
changed the base branch from
litellm_ocr_compiler_profiles
to
litellm_internal_staging
September 2, 2026 23:20
7 tasks
yucheng-berri
approved these changes
Sep 3, 2026
yujonglee-berri
force-pushed
the
litellm_ocr_sdk_parity_tests
branch
from
September 3, 2026 17:04
0a78f17 to
92b52ae
Compare
This was referenced Sep 3, 2026
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Problem this solves:
How it solves it:
User Flow
Before: a developer cannot select the agreed migration strategies
uv run python -m tests.rust-python-harness --listexisting_e2e_test_sdkAfter: a developer can select and run each strategy independently
uv run python -m tests.rust-python-harness --liste2e_parity,trace_parity,unit_tests, andexisting_e2e_test_sdkuv run python -m tests.rust-python-harness.strategies.e2e_parity.runner --function ocr --plainand inspect the parity reportRelevant issues
Implements the harness organization and runner responsibilities documented in #39456. First PR in the two-PR stack, based on
litellm_internal_staging; #39425 adds the expanded provider corpus and recording improvementsOCR execution and all 31 original cassettes live under
strategies/e2e_parity/sdk/ocr/. Shared parity, tracing, and reporting tools live undershared/. E2E and trace runners accept SDK and gateway cases through the same orchestration. Existing Python tests remain at their original locations, and native Rust tests remain beside their implementationThe unit strategy combines collected Python/Rust test mapping, separate Python processes with Rust disabled and enabled, backend probes, outcome comparison, and Cargo execution. Missing or ambiguous counterparts, backend mismatches, failing tests, and skipped native tests cannot count as passing evidence. Trace comparison checks mapped operations, counts, and required execution order
The staging OCR ledger is retained and synchronized with this branch: 12 of 146 Python tests have Rust mappings, and 32 Rust tests are tracked separately. Ledger validation remains available through
--validate-ledger, including from each independent runnerTrace instrumentation, gateway cases, and complete API unit mappings remain unconfigured and visibly planned. Existing Messages, Responses, Chat Completions, and Transcription bridge coverage remains partial. No assertion or expected-failure marker was weakened to hide OCR mismatches
The existing live SDK test row from #39463 is preserved under
strategies/existing_e2e_test_sdk/, with its own runner. Chat Completions and Transcription selectors and recursive directory matching are preservedThe harness runs locally only. The existing CI allowlist covers it; no CI execution was added. Production Python remains unchanged relative to staging. Existing Rust OCR changes preserve upstream errors and validation details
Linear ticket
Resolves LIT-6523
Pre-Submission checklist
Validation
Merged staging at
bcd3e2d94d, including #39463. The resolution preserves the new live SDK test row and six SDK function columns while retaining independent strategy execution and the upstream ledger auditAll 110 focused harness, ledger, Python/Cargo runner, reporting, trace, and CrowdStrike tests pass locally. The directory-selector regression exercises both parity and existing-SDK runners in separate processes. Ruff test checks and whitespace validation pass
The previous proxy-endpoints failure remains covered by staging's #39467. New CI checks are running for this merge. The previous Docker image jobs failed on the UI import of
autorouter_presets.json; this merge does not change the Docker build setupAll 31 original cassette blobs are unchanged. The expanded OCR parity suite was not rerun for this merge. Earlier native-extension testing reported eight OCR parity failures and 26 existing expected failures; this update does not claim those provider mismatches are fixed
Screenshots / Proof of Fix
Run these commands from the repository root using the project Python environment
Before (bcd3e2d)
python -m tests.rust-python-harness --liste2e_fuzz_tests,unit_tests_rust,validate_sub_methods, andexisting_e2e_test_sdkpython -m tests.rust-python-harness.strategies.e2e_parity.runner --helpModuleNotFoundError: No module named 'tests.rust-python-harness.strategies.e2e_parity'After (0e4232b)
python -m tests.rust-python-harness --liste2e_parity,trace_parity,unit_tests, andexisting_e2e_test_sdk, including Chat Completions and Transcriptionpython -m tests.rust-python-harness.strategies.e2e_parity.runner --help--surfaceand--validate-ledgerType
Test
Refactoring
Caveats (if any)
Medium
Low
Final Attestation