Files
cc-ci/tests/discourse/functional/test_health_check.py
autonomic-bot ca7acf3d52 feat(2): Q4.6 discourse — recipe_meta + postgres P4 overlays + health (WIP, §4.3 create-topic next)
discourse (forum: postgres+redis+sidekiq). HEALTH_PATH=/srv/status (slow Rails boot, DEPLOY_TIMEOUT=1800).
P4 via postgres ci_marker (db service, pg_dump backupbot — matrix-synapse pattern). Health functional
test. §4.3 create-a-topic + PARITY.md to follow after smoke discovers the admin/API bootstrap path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 20:38:25 +01:00

21 lines
845 B
Python

"""discourse — health/readiness functional test (Phase 2).
SOURCE: no recipe-maintainer corpus exists for discourse (P2 vacuous — see PARITY.md). This is a
Phase-2 health check aligned with the parity-port convention: /srv/status returns 200 only once the
Rails app is actually serving (the recipe's HEALTH_PATH and the canonical "is discourse up" signal).
"""
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_discourse_srv_status_ok(live_app):
url = f"https://{live_app}/srv/status"
status, _ = harness_http.retry_http_get(url, expect_status=200, max_wait=120, interval=5)
assert status == 200, f"GET {url} HTTP {status} (expected 200 — discourse not serving)"