fix gitea compose smoke checks
CI / compose (push) Successful in 7m5s

This commit is contained in:
Marco0300
2026-09-03 14:14:41 +02:00
parent 921fe40af8
commit 856625bd93
2 changed files with 9 additions and 2 deletions
+2 -2
View File
@@ -35,8 +35,8 @@ jobs:
api_status=$(docker inspect --format '{{.State.Health.Status}}' "$(docker compose ps -q api)") 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)") web_status=$(docker inspect --format '{{.State.Health.Status}}' "$(docker compose ps -q web)")
if [ "$api_status" = healthy ] && [ "$web_status" = healthy ]; then if [ "$api_status" = healthy ] && [ "$web_status" = healthy ]; then
curl --fail http://localhost:8000/api/v1/health/live 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)"
curl --fail http://localhost:8080/healthz docker compose exec -T web python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/healthz', timeout=2)"
exit 0 exit 0
fi fi
sleep 2 sleep 2
+7
View File
@@ -57,6 +57,13 @@ class Phase15OpsTests(unittest.TestCase):
self.assertIn('CMD ["python", "-m", "app.main"', dockerfile) self.assertIn('CMD ["python", "-m", "app.main"', dockerfile)
self.assertNotIn('CMD ["python", "/app/app/main.py"', 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): def test_backup_restore_integrity_and_checksum(self):
with TemporaryDirectory() as tmp: with TemporaryDirectory() as tmp:
root = Path(tmp); db = root / "prospects.db"; backups = root / "backups" root = Path(tmp); db = root / "prospects.db"; backups = root / "backups"