From 856625bd93e6c97479a63b254f98b22574634ab3 Mon Sep 17 00:00:00 2001 From: Marco0300 Date: Thu, 3 Sep 2026 14:14:41 +0200 Subject: [PATCH] fix gitea compose smoke checks --- .github/workflows/ci.yml | 4 ++-- apps/api/tests/test_phase15_ops.py | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39bc4d2..f95f85b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,8 +35,8 @@ jobs: api_status=$(docker inspect --format '{{.State.Health.Status}}' "$(docker compose ps -q api)") web_status=$(docker inspect --format '{{.State.Health.Status}}' "$(docker compose ps -q web)") if [ "$api_status" = healthy ] && [ "$web_status" = healthy ]; then - curl --fail http://localhost:8000/api/v1/health/live - curl --fail http://localhost:8080/healthz + docker compose exec -T api python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/api/v1/health/live', timeout=2)" + docker compose exec -T web python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/healthz', timeout=2)" exit 0 fi sleep 2 diff --git a/apps/api/tests/test_phase15_ops.py b/apps/api/tests/test_phase15_ops.py index 8f7d8d4..892a8c2 100644 --- a/apps/api/tests/test_phase15_ops.py +++ b/apps/api/tests/test_phase15_ops.py @@ -57,6 +57,13 @@ class Phase15OpsTests(unittest.TestCase): self.assertIn('CMD ["python", "-m", "app.main"', dockerfile) self.assertNotIn('CMD ["python", "/app/app/main.py"', dockerfile) + def test_ci_smoke_checks_run_inside_compose_services(self): + workflow = (ROOT / ".github/workflows/ci.yml").read_text() + self.assertIn("docker compose exec -T api", workflow) + self.assertIn("docker compose exec -T web", workflow) + self.assertNotIn("curl --fail http://localhost:8000/api/v1/health/live", workflow) + self.assertNotIn("curl --fail http://localhost:8080/healthz", workflow) + def test_backup_restore_integrity_and_checksum(self): with TemporaryDirectory() as tmp: root = Path(tmp); db = root / "prospects.db"; backups = root / "backups"