23 lines
716 B
Python
23 lines
716 B
Python
from pathlib import Path
|
||
|
||
|
||
ROOT = Path(__file__).resolve().parents[1]
|
||
CD_WORKFLOW = ROOT / ".gitea/workflows/cd.yaml"
|
||
|
||
|
||
def test_cd_health_check_allows_slow_rebuild_warmup():
|
||
workflow = CD_WORKFLOW.read_text(encoding="utf-8")
|
||
|
||
assert "等待服務啟動(30s)" in workflow
|
||
assert "seq 1 12" in workflow
|
||
assert "等待 15s" in workflow
|
||
|
||
|
||
def test_cd_health_check_validates_internal_and_external_health():
|
||
workflow = CD_WORKFLOW.read_text(encoding="utf-8")
|
||
|
||
assert "docker exec momo-pro-system curl" in workflow
|
||
assert "http://127.0.0.1:80/health" in workflow
|
||
assert "https://mo.wooo.work/health" in workflow
|
||
assert 'internal=$INTERNAL_CODE, external=$EXTERNAL_CODE' in workflow
|