#!/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_product_manifest_changes_stay_on_controlled_runtime_profile() -> None: text = _workflow_text() assert "product.awoooi.yaml)" in text assert "docs/schemas/product_awoooi_manifest_v1.schema.json)" in text assert "apps/api/src/services/product_awoooi_manifest_standard.py)" in text assert "tests/test_product_awoooi_manifest_standard_api.py" 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