Coverage: vite + frontend/providers (vite, inertia, broadcasting, storage, loader)#160
Coverage: vite + frontend/providers (vite, inertia, broadcasting, storage, loader)#160tmgbedu wants to merge 2 commits into
Conversation
Raise coverage for the Vite asset helper, the Loader utility and the inertia/broadcasting/storage service providers with unit tests that mock the filesystem, manifest and request/network layers. - vite/vite.py 24% -> 100% - loader/Loader.py 24% -> 100% - inertia/provider.py 50% -> 100% - storage/providers/provider.py 28% -> 100% - broadcasting/provider.py 19% -> 98%
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Code review verdict: REQUEST CHANGES (Ruff CI red) — content otherwise approve-worthy(Formal request-changes not possible — same-account PR — so filing as a comment.) Verified locally on
Blocker — Ruff CI is failing (2 jobs). Reproduced locally:
Fix: Push and CI goes green — I'll re-approve immediately. Follow-up bug tasks recommended (both correctly worked-around, not fixed — this is a test-only PR):
|
Remove unused `TestClient` import in broadcasting test (F401) and apply `ruff format` to the broadcasting, loader and vite test files. Test-only change; no framework source touched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
✅ APPROVE (Code Reviewer)Ruff blocker resolved in commit Final CI — all green:
Confirmed locally too: Formal GitHub approval is blocked on a same-account PR, so recording approval here. Do not merge per standing order — over to the PM. (Two follow-up framework bug tasks still recommended, unchanged: LOW Vite |
Summary
Raises unit-test coverage for the Vite asset helper, the
Loaderutility and the inertia / broadcasting / storage service providers. Tests mock the filesystem, Vite manifest and request/network layers — no live servers or network required.Coverage impact
vite/vite.pyloader/Loader.pyinertia/provider.pystorage/providers/provider.pybroadcasting/provider.pyTotal project coverage: 73.94% (threshold
fail_under = 68).What's covered
asset_url/ custom resolver), tag + preload generation, CSP nonce, integrity, attribute resolvers, manifest caching & hashing, and theViteException/ViteManifestNotFoundExceptionerror paths.get_modules,find/find_all,get_object(s),get_parameters, and the not-found / raise paths./storage/{path}route (serve, 404, no-FastAPI early return)./broadcasting/authhandler across public/private channels and every user-resolution branch,routes/channels.pyauto-loading, and the no-FastAPI fallbacks.Notes
Two small pre-existing quirks were worked around in tests rather than changed (framework code left untouched): passing a plain
dicttouse_*_tag_attributesself-references the wrapping lambda, and the auth handler'sRequestannotation is an unresolved forward-ref underfrom __future__ import annotations, so its body is exercised directly.Testing
uv run pytest --ignore=tests/masoniteorm/postgres— 1726 passed, 7 skipped.