Skip to content

test: Test Harness & CI — url/transcode/config/escalation coverage (Epic 3, #8)#14

Merged
tcconnally merged 1 commit into
mainfrom
feat/epic3-test-harness
Jul 2, 2026
Merged

test: Test Harness & CI — url/transcode/config/escalation coverage (Epic 3, #8)#14
tcconnally merged 1 commit into
mainfrom
feat/epic3-test-harness

Conversation

@tcconnally

Copy link
Copy Markdown
Owner

Implements Epic 3: Test Harness & CI (closes #8) — real coverage for the genuinely bug-prone logic.

Stacked on #13 (Epic 2), which is stacked on #12 (Epic 1). Base branch is feat/epic2-reliability so this diff shows only Epic 3. Merge order: #12#13 → this.

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.pyexceeds_1080p(), needs_transcode(), build_stream_url(). emby.needs_transcode() and wall._build_url() now delegate to it; behavior is identical (parity verified, including HYPERWALL_AUTO_TRANSCODE=0).

reliability.escalation_plan() — extracts the retry→transcode→skip policy out of cell._on_error (which was coupled to QTimer). _on_error now calls it, so the tested code is the code that runs.

Coverage (48 tests, all green)

Suite Tests Highlights
test_urls 14 ⚠️ asserts the DIRECT url carries static=true (Emby 4.9.5.0 500 workaround — can never silently regress); HLS master path; 1080p boundaries; missing/None/absent-stream safety
test_config 5 save/load round-trip, typed int/bool fields, frozen dataclass, template creation, fallback defaults
test_reliability 21 (+5) full escalation ladder: retry→retry(transcode)→retry(transcode)→skip with exact backoff delays
run_repo_guards 8 unchanged (structure + version-drift guard)

tests/run_all.py — one runner aggregating all four suites; the CI workflow now invokes it, and the README documents the suite.

Validation (Linux)

  • py_compile clean; python tests/run_all.pyOVERALL: PASS (all suites green).
  • Refactor parity spot-checked: needs_transcode returns 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.

…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
@tcconnally tcconnally added this to the v10 milestone Jul 2, 2026
@tcconnally tcconnally changed the base branch from feat/epic2-reliability to main July 2, 2026 14:23
@tcconnally tcconnally merged commit 2e3a893 into main Jul 2, 2026
1 check passed
@tcconnally tcconnally deleted the feat/epic3-test-harness branch July 2, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Epic 3: Test Harness & CI

2 participants