Files
awoooi/ops/runner/test_cd_controlled_runtime_profile.py
Your Name 2ff4d1f401
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 16s
CD Pipeline / build-and-deploy (push) Successful in 9m11s
CD Pipeline / post-deploy-checks (push) Successful in 1m6s
fix(cd): keep ui changes on controlled profile
2026-06-29 12:23:34 +08:00

31 lines
953 B
Python

#!/usr/bin/env python3
from __future__ import annotations
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
CD_WORKFLOW = ROOT / ".gitea" / "workflows" / "cd.yaml"
def _workflow_text() -> str:
return CD_WORKFLOW.read_text(encoding="utf-8")
def test_web_changes_stay_on_controlled_runtime_profile() -> None:
text = _workflow_text()
assert "apps/web/*)" in text
assert "UI-only changes are verified by the" in text
def test_controlled_runtime_skips_b5_before_docker_socket_use() -> None:
text = _workflow_text()
b5_start = text.index("- name: Integration Tests (B5")
docker_socket = text.index("-v /var/run/docker.sock:/var/run/docker.sock", b5_start)
controlled_gate = text.index(
'if [ "${AWOOOI_CD_TEST_PROFILE:-full}" = "controlled-runtime" ]; then',
b5_start,
)
exit_zero = text.index("exit 0", controlled_gate)
assert controlled_gate < exit_zero < docker_socket