test: Test Harness & CI — url/transcode/config/escalation coverage (Epic 3, #8)#14
Merged
Conversation
…ied runner (Epic 3, #8) Adds real coverage for the genuinely bug-prone logic, all dependency-free so it runs headless in CI (no PyQt/mpv/Emby, no pytest). Follows the Epic 2 pattern: extract pure logic, test it in isolation, delegate the widget/IO code to it. New pure module hyperwall/urls.py: - exceeds_1080p(), needs_transcode(item, auto_transcode=), build_stream_url(). - emby.needs_transcode() and wall._build_url() now delegate here — behavior identical, verified for parity (incl. HYPERWALL_AUTO_TRANSCODE=0). -⚠️ DIRECT url still carries static=true (Emby 4.9.5.0 500 workaround); a test asserts it so the load-bearing param can never silently regress. reliability.escalation_plan(attempt, max_retries): - extracts the retry→transcode→skip policy from cell._on_error (which was coupled to QTimer). _on_error now calls it, so the tested code is the code that runs. attempt1=retry/direct/2s, attempt2=retry/transcode/4s, attempt3=retry/transcode/8s, attempt4=skip. Tests (48 total, all green): - tests/test_urls.py (14): static=true assertion, HLS master path, 1080p boundaries, missing/None/absent-stream safety, flag binding. - tests/test_config.py (5): save/load round-trip, typed fields, frozen dataclass, template creation, fallback defaults. - tests/test_reliability.py (+5 = 21): full escalation ladder. - tests/run_all.py: single runner aggregating all 4 suites; CI workflow now invokes it. README documents the suite. Refs #8
This was referenced Jul 2, 2026
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.
Implements Epic 3: Test Harness & CI (closes #8) — real coverage for the genuinely bug-prone logic.
Why
Before this, the only tests were structural smoke checks. None of the logic that actually breaks in production — URL construction, the transcode heuristic, the retry ladder, config I/O — was tested. This PR fixes that with 48 dependency-free tests that run headless in CI (no PyQt/mpv/Emby, no pytest).
What changed
New pure module
hyperwall/urls.py—exceeds_1080p(),needs_transcode(),build_stream_url().emby.needs_transcode()andwall._build_url()now delegate to it; behavior is identical (parity verified, includingHYPERWALL_AUTO_TRANSCODE=0).reliability.escalation_plan()— extracts the retry→transcode→skip policy out ofcell._on_error(which was coupled toQTimer)._on_errornow calls it, so the tested code is the code that runs.Coverage (48 tests, all green)
test_urlsstatic=true(Emby 4.9.5.0 500 workaround — can never silently regress); HLS master path; 1080p boundaries; missing/None/absent-stream safetytest_configtest_reliabilityretry→retry(transcode)→retry(transcode)→skipwith exact backoff delaysrun_repo_guardstests/run_all.py— one runner aggregating all four suites; the CI workflow now invokes it, and the README documents the suite.Validation (Linux)
py_compileclean;python tests/run_all.py→ OVERALL: PASS (all suites green).needs_transcodereturns identical results pre/post extraction across 4K/1080p/flag-off cases.Note on scope
This is the pure-logic half of Epic 3, which is fully CI-verifiable today. The optional Windows PyInstaller smoke-build job (from the roadmap) needs a Windows runner and is better added once the exe-rename from Epic 1 (#12) is confirmed building green on skyhawk — I left it out rather than add a job that can't be validated from here.
Milestone: v10 · roadmap #5.