Container E2E: assert key IPTV endpoints on the built image #16

Closed
opened 2026-06-27 00:06:53 +02:00 by timothy · 1 comment
Owner

Risk this addresses

The build pipeline's smoke test now proves the app serves HTTP, but not that the actual IPTV surfaces work. Regressions in routing, the base-URL change (#1), or a migration could leave the app "up" but serving broken playlists/guides — and we'd only find out from Jellyfin in prod.

Approach

Extend the docker-build.yml smoke step (or add a dedicated E2E job) to exercise the real endpoints against the freshly built container, seeded with a minimal fixture /config DB:

  • The M3U playlist and XMLTV guide endpoints under /iptv/* (see IptvController) — assert HTTP 200 and basic shape (valid #EXTM3U header, well-formed XMLTV root).
  • A health/ready check if one exists.
  • Tear down cleanly (reuse the existing unique-name + trap pattern).

Payoff

Integration regressions (base-URL, routing, migrations) fail in CI instead of in front of Jellyfin. Builds directly on the smoke test already in the pipeline. Pairs with the golden-file tests. Backlog.

## Risk this addresses The build pipeline's smoke test now proves the app *serves HTTP*, but not that the actual IPTV surfaces work. Regressions in routing, the base-URL change (#1), or a migration could leave the app "up" but serving broken playlists/guides — and we'd only find out from Jellyfin in prod. ## Approach Extend the `docker-build.yml` smoke step (or add a dedicated E2E job) to exercise the real endpoints against the freshly built container, seeded with a minimal fixture `/config` DB: - The M3U playlist and XMLTV guide endpoints under `/iptv/*` (see `IptvController`) — assert HTTP 200 and basic shape (valid `#EXTM3U` header, well-formed XMLTV root). - A health/ready check if one exists. - Tear down cleanly (reuse the existing unique-name + `trap` pattern). ## Payoff Integration regressions (base-URL, routing, migrations) fail in CI instead of in front of Jellyfin. Builds directly on the smoke test already in the pipeline. Pairs with the golden-file tests. Backlog.
Author
Owner

Done — closing

Merged via PR #31; the main build job ran the new smoke+E2E step and passed.

What was done — upgraded the image smoke test (docker-build.yml) from "the app serves HTTP" to a real E2E against the Jellyfin-facing surfaces on the freshly built container:

  • /iptv/channels.m3u → asserts 2xx containing #EXTM3U
  • /iptv/xmltv.xml → asserts 2xx containing a <tv root

xmltv.xml needs channels.xml, which the scheduler writes a few seconds after boot, so each endpoint is polled with a deadline; container logs are dumped on failure. Reuses the existing unique-name + trap … EXIT cleanup.

Verification (empirical, before + on real CI) — ran the :latest image on a fresh container (via bumblebee) and confirmed both endpoints return 200 with the expected shape, then ran the exact check() commands from the workflow against it (both pass). Confirmed green on the main build after merge.

Files: .gitea/workflows/docker-build.yml (smoke step), docs/ci-cd.md (updated smoke-test description).

Notes / deferred

  • The smoke step is main/tag-only (the image build job is skipped on PRs), so the E2E runs on merge to main — consistent with the existing smoke test.
  • Scoped to the two endpoints the issue named (M3U + XMLTV) + HTTP readiness; the per-channel streaming/logo routes need a seeded channel/playout fixture (heavier) and weren't in scope. Pairs with the M3U golden tests (#11).
  • Now catches routing / base-URL (#1) / migration regressions that leave the app "up" but serving broken playlists/guides — directly protects the prod cutover (server-management#481).
## Done — closing Merged via PR #31; the `main` build job ran the new smoke+E2E step and **passed**. **What was done** — upgraded the image smoke test (`docker-build.yml`) from "the app serves HTTP" to a real **E2E** against the Jellyfin-facing surfaces on the freshly built container: - `/iptv/channels.m3u` → asserts 2xx containing `#EXTM3U` - `/iptv/xmltv.xml` → asserts 2xx containing a `<tv` root `xmltv.xml` needs `channels.xml`, which the scheduler writes a few seconds after boot, so each endpoint is **polled with a deadline**; container logs are dumped on failure. Reuses the existing unique-name + `trap … EXIT` cleanup. **Verification (empirical, before + on real CI)** — ran the `:latest` image on a fresh container (via bumblebee) and confirmed both endpoints return 200 with the expected shape, then ran the **exact `check()` commands** from the workflow against it (both pass). Confirmed green on the `main` build after merge. **Files**: `.gitea/workflows/docker-build.yml` (smoke step), `docs/ci-cd.md` (updated smoke-test description). **Notes / deferred** - The smoke step is `main`/tag-only (the image `build` job is skipped on PRs), so the E2E runs on merge to `main` — consistent with the existing smoke test. - Scoped to the two endpoints the issue named (M3U + XMLTV) + HTTP readiness; the per-channel streaming/logo routes need a seeded channel/playout fixture (heavier) and weren't in scope. Pairs with the M3U golden tests (#11). - Now catches routing / base-URL (#1) / migration regressions that leave the app "up" but serving broken playlists/guides — directly protects the prod cutover (server-management#481).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: timothy/ersatztv#16