mirror of
https://github.com/calibrain/shelfmark.git
synced 2026-10-05 22:05:50 +01:00
50 lines
2.1 KiB
Python
50 lines
2.1 KiB
Python
"""Clusters 5/6/7 — container/entrypoint correctness, plus pointers.
|
|
|
|
Cluster 6 (docker/entrypoint/PUID-PGID — 9 issues / 19 fix PRs, zero shell test
|
|
coverage today): the app must boot healthy under the configured PUID/PGID with no
|
|
permission errors, regardless of which config profile is active. This is a
|
|
profile-agnostic invariant, so it runs under every profile and catches
|
|
entrypoint/permission regressions (#801, #411, #434, #171) across the matrix.
|
|
|
|
Clusters 5 (download clients) and 7 (audiobook/ABB) are exercised by dedicated
|
|
stacks/sources (docker-compose.test-clients.yml and an audiobookbay mock) — see
|
|
README. Pointers below keep them visible in the matrix without duplicating the
|
|
prowlarr e2e flow.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
import pytest
|
|
|
|
|
|
def test_health_endpoint_under_every_profile(client, active_profile) -> None:
|
|
"""Entrypoint/permission boot must succeed under the active config."""
|
|
resp = client.get("/api/health")
|
|
assert resp.status_code == 200, f"[{active_profile}] not healthy: {resp.text[:200]}"
|
|
|
|
|
|
def test_no_permission_errors_in_boot_logs() -> None:
|
|
"""The runner captures shelfmark boot logs into E2E_SHELFMARK_LOG; assert no
|
|
permission/entrypoint failure markers (regression for #171/#447/#801)."""
|
|
log_path = os.environ.get("E2E_SHELFMARK_LOG")
|
|
if not log_path or not os.path.exists(log_path):
|
|
pytest.skip("E2E_SHELFMARK_LOG not provided by the runner")
|
|
with open(log_path, encoding="utf-8", errors="ignore") as fh:
|
|
text = fh.read().lower()
|
|
for marker in ("permission denied", "operation not permitted", "read-only file system"):
|
|
assert marker not in text, f"boot logs contain a permission failure: {marker!r}"
|
|
|
|
|
|
@pytest.mark.skip(
|
|
reason="cluster 5: covered by docker-compose.test-clients.yml + prowlarr e2e flow"
|
|
)
|
|
def test_download_clients_pointer() -> None: # pragma: no cover - documentation marker
|
|
...
|
|
|
|
|
|
@pytest.mark.skip(reason="cluster 7: needs an audiobookbay mock role (tracked in README roadmap)")
|
|
def test_audiobook_pointer() -> None: # pragma: no cover - documentation marker
|
|
...
|