"""loomio — health/liveness of the Rails app through its own JSON API. `GET /api/v1/boot/version` is served by Api::V1::BootController#version (anonymous) and returns the running release. It proves the Rails stack booted past DB migrations and is answering — not just that Traefik served a static page. The generic install tier already asserts real HTTPS serving. """ from __future__ import annotations import os import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "..", "runner")) from harness import http as harness_http # noqa: E402 def test_api_boot_version_serves(live_app): url = f"https://{live_app}/api/v1/boot/version" status, body = harness_http.retry_http_get(url, expect_status=200, max_wait=120, interval=5) assert status == 200, f"GET {url} HTTP {status}" assert isinstance(body, dict), f"GET {url} did not return a JSON object: {body!r}" version = body.get("version") assert isinstance(version, str) and version.strip(), ( f"GET {url} returned no version string: {body!r}" )