Skip to content

Commit 4bc7bdb

Browse files
committed
Rename healthcheck endpoint, align CI
1 parent 0f6c1a5 commit 4bc7bdb

3 files changed

Lines changed: 16 additions & 24 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,22 @@ jobs:
2828
export APP_ENV=local
2929
python config/toml_config_manager.py
3030
cd config/local
31-
echo "Generated .env.local content:"
32-
cat .env.local
3331
export COMPOSE_ENV_FILES=.env.local
3432
docker compose up -d --build
3533
3634
- name: Verify Application Health
3735
run: |
38-
timeout 10s bash -c '
39-
while ! curl -sf http://0.0.0.0:9999/api/v1/; do
40-
sleep 1
41-
done
42-
'
36+
timeout 10s bash -s <<'BASH'
37+
while ! curl -sf http://127.0.0.1:9999/api/v1/; do
38+
sleep 1
39+
done
40+
BASH
4341
4442
- name: Test Signup Handler
4543
run: |
46-
timeout 10s bash -c "
47-
while ! curl -sf -X POST \
48-
'http://0.0.0.0:9999/api/v1/account/signup' \
49-
-H 'accept: application/json' \
50-
-H 'Content-Type: application/json' \
51-
-d '{
52-
\"username\": \"string\",
53-
\"password\": \"string\"
54-
}'; do
55-
sleep 1
56-
done
57-
"
44+
curl -f --json @- http://127.0.0.1:9999/api/v1/account/signup <<'JSON'
45+
{
46+
"username": "string",
47+
"password": "string"
48+
}
49+
JSON

src/app/presentation/http/controllers/general/healthcheck.py renamed to src/app/presentation/http/controllers/general/health.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
from starlette.requests import Request
33

44

5-
def create_healthcheck_router() -> APIRouter:
5+
def create_health_router() -> APIRouter:
66
router = APIRouter()
77

88
@router.get("/")
9-
async def healthcheck(_: Request) -> dict[str, str]:
9+
async def health(_: Request) -> dict[str, str]:
1010
"""
1111
- Open to everyone.
1212
- Returns `200 OK` if the API is alive.

src/app/presentation/http/controllers/general/router.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from fastapi import APIRouter
22

3-
from app.presentation.http.controllers.general.healthcheck import (
4-
create_healthcheck_router,
3+
from app.presentation.http.controllers.general.health import (
4+
create_health_router,
55
)
66

77

@@ -10,7 +10,7 @@ def create_general_router() -> APIRouter:
1010
tags=["General"],
1111
)
1212

13-
sub_routers = (create_healthcheck_router(),)
13+
sub_routers = (create_health_router(),)
1414

1515
for sub_router in sub_routers:
1616
router.include_router(sub_router)

0 commit comments

Comments
 (0)