All checks were successful
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 14s
CD Pipeline / build-and-deploy (push) Successful in 5m30s
CD Pipeline / post-deploy-checks (push) Successful in 1m4s
57 lines
2.1 KiB
Python
57 lines
2.1 KiB
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_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_p0_onboarding_readiness_sources_stay_on_controlled_runtime_profile() -> None:
|
|
text = _workflow_text()
|
|
expected_sources = [
|
|
"awoooi_gitea_onboarding_warning_step_dashboard.py",
|
|
"awoooi_gitea_onboarding_warning_step_owner_package.py",
|
|
"awoooi_gitea_onboarding_warning_step_owner_response_preflight.py",
|
|
"awoooi_gitea_onboarding_warning_step_template_copy_apply_gate.py",
|
|
"awoooi_gitea_onboarding_warning_step_template_copy_execution_plan.py",
|
|
"awoooi_new_product_onboarding_page_model.py",
|
|
"awoooi_onboarding_reminder_contract.py",
|
|
"awoooi_onboarding_source_contracts.py",
|
|
"awoooi_product_onboarding_guard.py",
|
|
]
|
|
for source in expected_sources:
|
|
assert f"apps/api/src/services/{source})" in text
|
|
assert f"src/services/{source}" 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
|