service-update-alerts/tests/test_live_services.py
Jeena f55f3d8e91 feat: Add AI-driven auto-update & restructure into package
The monolithic check_updates.py has been split into the update_monitor/
package with separate modules for fetching, extraction, comparison,
classification, and notification. This makes the codebase easier to
navigate and test.

The flat services.yaml is replaced by per-service directories under
services/<name>/config.yaml, co-locating config with update scripts
and AI review examples.

When --auto-update is enabled, services with an auto-update.sh script
get their release notes classified by a local Ollama model (using
few-shot examples from review-examples/) to decide whether the update
can be applied automatically or needs manual admin intervention. Results
are reported in a single consolidated Matrix message.

Immich is the first service with auto-update configured, using 7
real release note examples to train the classifier.
2026-04-09 12:49:57 +00:00

26 lines
925 B
Python

import os
import sys
from pathlib import Path
import pytest
sys.path.append(str(Path(__file__).resolve().parents[1]))
from update_monitor import check_service, load_dotenv, load_services_dir
@pytest.mark.skipif(os.getenv("RUN_LIVE_TESTS") != "1", reason="Live tests disabled")
def test_live_service_versions():
load_dotenv()
services = load_services_dir("services")
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))