fix(ci): wait for final B5 database readiness
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Failing after 1m36s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Failing after 1m36s
CD Pipeline / build-and-deploy (push) Has been skipped
CD Pipeline / post-deploy-checks (push) Has been skipped
This commit is contained in:
18
apps/api/tests/test_cd_b5_database_readiness_gate.py
Normal file
18
apps/api/tests/test_cd_b5_database_readiness_gate.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[3]
|
||||
CD_WORKFLOW = ROOT / ".gitea" / "workflows" / "cd.yaml"
|
||||
|
||||
|
||||
def test_b5_waits_for_final_postmaster_and_same_network_client() -> None:
|
||||
workflow = CD_WORKFLOW.read_text(encoding="utf-8")
|
||||
b5 = workflow.split("- name: Integration Tests (B5 — 真實 DB)", 1)[1]
|
||||
b5 = b5.split("- name: Clean Test Workspace Artifacts", 1)[0]
|
||||
|
||||
assert "PostgreSQL init process complete; ready for start up." in b5
|
||||
assert 'B5_CLIENT_READY=0' in b5
|
||||
assert "-v ON_ERROR_STOP=1 -Atqc 'SELECT 1'" in b5
|
||||
assert "b5_pg_test_client_network_not_ready" in b5
|
||||
assert "inspect_b5_final_postmaster_and_test_network_then_retry_cd" in b5
|
||||
assert b5.index("B5_CLIENT_READY=0") < b5.index("setup_test_schema.sql")
|
||||
Reference in New Issue
Block a user