From 9e145409c7d090b122c1168c214e99ae54c33f98 Mon Sep 17 00:00:00 2001 From: JuliaEdom Date: Mon, 13 Jul 2026 00:54:05 +0300 Subject: [PATCH] test(e2e): the compose service pin admits serving-init, and pins its contract MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The lite-compose ratchet pins the exact service set, so the serving-init job added for post-P0-2 provisioning tripped it in both push-only lanes — the one remaining failure after the seeding fix (the staging lane passed its other 24 tests). Admit the service and pin what makes it load-bearing: it runs provision --schema --seed after ClickHouse is healthy, and the API only starts after it completes successfully. Co-Authored-By: Claude Fable 5 --- tests/e2e/test_ci_compose_config.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/e2e/test_ci_compose_config.py b/tests/e2e/test_ci_compose_config.py index 7afe3f8c..f8f0a686 100644 --- a/tests/e2e/test_ci_compose_config.py +++ b/tests/e2e/test_ci_compose_config.py @@ -66,7 +66,28 @@ def test_lite_compose_contains_only_required_services(): compose = yaml.safe_load(compose_path.read_text(encoding="utf-8")) - assert set(compose["services"]) == {"agentflow-api", "redis", "kafka", "postgres", "clickhouse"} + # serving-init is the one-shot provision/seed job the API depends on: + # boot provisioning left the API in audit P0-2, so the stack lays the + # schema and demo rows down itself before the API starts. + assert set(compose["services"]) == { + "agentflow-api", + "redis", + "kafka", + "postgres", + "clickhouse", + "serving-init", + } + + +def test_lite_compose_provisions_before_the_api_starts(): + compose = yaml.safe_load((PROJECT_ROOT / "docker-compose.e2e.yml").read_text(encoding="utf-8")) + + init = compose["services"]["serving-init"] + assert init["command"] == ["python", "-m", "src.serving.provision", "--schema", "--seed"] + assert init["depends_on"]["clickhouse"] == {"condition": "service_healthy"} + + api = compose["services"]["agentflow-api"] + assert api["depends_on"]["serving-init"] == {"condition": "service_completed_successfully"} def test_lite_compose_mounts_contracts_for_api_startup():