service-update-alerts/tests/test_live_services.py
Jeena 501a84e0a9 chore: Rename project to service-update-alerts
Update project metadata, docs, and systemd unit names to match the new service-update-alerts naming.
2026-03-12 15:50:49 +00:00

26 lines
943 B
Python

import os
import sys
from pathlib import Path
import pytest
sys.path.append(str(Path(__file__).resolve().parents[1]))
from check_updates import check_service, load_dotenv, load_services, load_yaml
@pytest.mark.skipif(os.getenv("RUN_LIVE_TESTS") != "1", reason="Live tests disabled")
def test_live_service_versions():
load_dotenv()
services = load_services(load_yaml("services.yaml"))
failures = []
for service in services.values():
result = check_service(service, timeout=20, user_agent="service-update-alerts-test")
if service.upstream_latest_version_url and not result["latest"]:
failures.append(f"{service.name}: latest version missing ({result['latest_error']})")
if service.current_version_url and not result["current"]:
failures.append(f"{service.name}: current version missing ({result['current_error']})")
if failures:
pytest.fail("\n".join(failures))