Repository navigation
TEST Isolate SDK unit tests and move LiteLLM wire checks to integration - #3070
Open
Roman Lutz (romanlutz) wants to merge 8 commits into
Open
Roman Lutz (romanlutz) wants to merge 8 commits into
Roman Lutz (romanlutz) wants to merge 8 commits into
Conversation
Mock external image and credential dependencies, make memory and token-clock ownership explicit, and keep real LiteLLM transport assertions in gated loopback integration tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Richard Lundeen (richlundeen)
approved these changes
Oct 10, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
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.
Description
Full offline unit runs exposed incomplete image/credential mocks, an environment-sensitive reinitialization test that bypassed memory setup, and real LiteLLM transport tests that downloaded tokenizer data. These are test-isolation problems, not demonstrated new product regressions.
No production API, dependency, or CI changes. The new integration file requires
RUN_ALL_TESTS=true, the optional LiteLLM dependency, and a separately supplied, SHA-256-verified official tokenizer asset. It uses fake keys and loopback only, not live provider credentials; missing/corrupt enabled input fails explicitly. Tokenizer preparation is private to integration tests, with no new build helper or bundled data.Tests and Documentation
Updated the unit-testing guide and integration guide to document the tier split, integration gate, and tokenizer input contract. JupyText was not run: no notebooks or executable documentation examples changed.
Validation used this worktree's uv environment on Windows/Python 3.13 with all extras, isolated home/memory/cache/output directories, no inherited credentials, and guards rejecting non-loopback DNS/sockets. The saved source hashes still match the committed files. GNU Make was unavailable, so the documented pytest equivalent was used.
Exact pytest invocations, with local inventory instrumentation and retained JUnit reports (
$vbelow expands to the saved artifact directory):All four unit workers collected identical inventories of 25,104 nodes. Actual JUnit cases: 25,104; declared count: 25,185. The difference is exactly 81 recorded passing subtest reports, not additional top-level cases. The 26 skips cover external-resource requirements, Windows limitations, unavailable Make/Bicep, and an Azure SQL integration-only path.
Additional controls passed: all 84 LiteLLM unit cases with real LiteLLM/tiktoken imports forbidden; six clean skips with the integration gate disabled and no asset; warm-cache restoration; and expected missing/corrupt integration-input errors with registry/environment restored. No live-provider integration suite was run.
Earlier broader scoped typing encountered the unchanged
tests.unit.mocksimport in the discovery test: an installedtestspackage shadows the checkout namespace outside pytest. No type-rule suppression, package-layout workaround, or unrelated typing change is included.