fix: validate remote model reads with offline request tests - #46
rupayon123 wants to merge 12 commits into
Conversation
How to test: python -m pytest -q (73 passed); ruff check tests/test_huggingface.py.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository: pipe1os/modelinfo-cli/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 56 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
How to test: PYTHONPATH=src pytest tests/test_hf_header_limit.py; PYTHONPATH=src pytest
How to test: PYTHONPATH=src pytest tests/test_hf_range_response.py; PYTHONPATH=src pytest
How to test: PYTHONPATH=src pytest tests/test_remote_stream_positions.py; PYTHONPATH=src pytest
How to test: PYTHONPATH=src pytest tests/test_hf_filename_encoding.py; PYTHONPATH=src pytest
|
Follow-up: |
|
September 16 verified update: Remote header truncation, authoritative shard indexes, cached token paths, zero-length reads and incorrect Content-Range offsets now have regression coverage. The final local suite has 96 passing tests. Responses without Content-Range retain their prior compatibility behavior. Commits: Exact current head: AI-assisted with OpenAI Codex; changes and validation were inspected before submission. |
|
The latest revision, All 109 local tests pass, including regressions for arrays, scalars, and null headers. The exact-head GitHub CI workflow now also passes: https://github.com/pipe1os/modelinfo-cli/actions/runs/35490455375. Prepared with AI assistance. |
Summary
Exercise the Hugging Face request layer offline and correct four failures found at that boundary:
Motivation
Addresses #28 with the original request-boundary coverage plus regressions for each reproduced behavior. Existing coverage includes authentication/Range headers, timeouts, bounded reads, error translation, single-file metadata, large-header continuation, 416 fallback, lazy shards and buffered reads/seeks.
Type of change
Validation
Python 3.11, PYTHONPATH=src pytest -q: 84 passed. New test files pass ruff; git diff --check passes. Each new regression group failed before its fix. Network and token lookup are isolated in tests; no live model weights or credentials are used. The full-response test intentionally rejects unsupported range behavior rather than claiming transparent server compatibility.
Conventional commits include How to test instructions. Prepared with AI assistance. Remote CI is verified separately on the new head.