test: add offline tests for PyTorch adapters and enable coverage - #5
Open
aliakarma wants to merge 2 commits into
Open
test: add offline tests for PyTorch adapters and enable coverage#5aliakarma wants to merge 2 commits into
aliakarma wants to merge 2 commits into
Conversation
Add comprehensive offline test coverage for the three PyTorch model adapters (Transformer, Autoregressive, and VLM) and remove their coverage exclusions. Highlights: - Add 40 deterministic offline tests covering adapter behavior, assessment logic, loader fallback paths, and edge cases. - Introduce reusable test fixtures for tiny local BERT and GPT-2 models. - Verify loader fallback order and processor/generation call contracts. - Remove the three adapter entries from the coverage omit list. - Preserve existing slow integration tests while enabling CI coverage through fast offline tests. Validation: - Ruff format/check passed - Mypy strict passed - Codespell passed - Compatibility checks passed - Full test suite passed (except one pre-existing Windows-specific issue) - Repository coverage: 97.24% - 100% statement and branch coverage for: - transformer.py - autoregressive.py - vlm.py No production code, API, dependency, or CI workflow changes.
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.
Summary
This PR adds deterministic offline tests for the three PyTorch model adapters (
TransformerAdapter,AutoregressiveAdapter, andVLMAdapter) and removes their coverage exclusions.Each adapter now achieves 100% statement and branch coverage through fast offline tests, allowing these modules to participate in normal CI coverage measurement without relying on downloaded models.
Motivation
The existing adapter coverage relied on slow integration tests or lacked comprehensive offline testing, so these modules were excluded from coverage measurement.
This PR closes that gap by introducing lightweight, deterministic tests that exercise adapter behavior, assessment logic, and loader fallback paths while requiring:
The existing slow integration tests remain unchanged.
What Changed
TransformerAdapterAutoregressiveAdapterVLMAdapterValidation
All repository quality gates were executed successfully:
--strict)Final repository coverage:
transformer.pyautoregressive.pyvlm.pyThe only observed test failure is a pre-existing Windows-specific issue unrelated to this change.
Design Decisions
This PR uses a hybrid testing strategy:
No production code was modified.
Out of Scope
This PR intentionally does not:
Follow-up
During implementation, several unrelated observations were identified but intentionally left out of scope to keep this PR focused:
registries.loader.list_available()behaviorAutoregressiveAdaptertransformerstransformersmodule referenceThese are suitable candidates for separate follow-up issues or pull requests.
Checklist