Skip to content

Commit d43e5c0

Browse files
Merge pull request #195 from brownjuly2003-code/fix-compose-pin-serving-init
test: compose service pin admits serving-init and pins its contract
2 parents 9ce6f46 + 9e14540 commit d43e5c0

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

‎tests/e2e/test_ci_compose_config.py‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,28 @@ def test_lite_compose_contains_only_required_services():
6666

6767
compose = yaml.safe_load(compose_path.read_text(encoding="utf-8"))
6868

69-
assert set(compose["services"]) == {"agentflow-api", "redis", "kafka", "postgres", "clickhouse"}
69+
# serving-init is the one-shot provision/seed job the API depends on:
70+
# boot provisioning left the API in audit P0-2, so the stack lays the
71+
# schema and demo rows down itself before the API starts.
72+
assert set(compose["services"]) == {
73+
"agentflow-api",
74+
"redis",
75+
"kafka",
76+
"postgres",
77+
"clickhouse",
78+
"serving-init",
79+
}
80+
81+
82+
def test_lite_compose_provisions_before_the_api_starts():
83+
compose = yaml.safe_load((PROJECT_ROOT / "docker-compose.e2e.yml").read_text(encoding="utf-8"))
84+
85+
init = compose["services"]["serving-init"]
86+
assert init["command"] == ["python", "-m", "src.serving.provision", "--schema", "--seed"]
87+
assert init["depends_on"]["clickhouse"] == {"condition": "service_healthy"}
88+
89+
api = compose["services"]["agentflow-api"]
90+
assert api["depends_on"]["serving-init"] == {"condition": "service_completed_successfully"}
7091

7192

7293
def test_lite_compose_mounts_contracts_for_api_startup():

0 commit comments

Comments
 (0)