Skip to content

fix: docker compose test job should check response status code#2284

Open
sirk0 wants to merge 3 commits into
fastapi:masterfrom
sirk0:sirk0/fix-docker-compose-test
Open

fix: docker compose test job should check response status code#2284
sirk0 wants to merge 3 commits into
fastapi:masterfrom
sirk0:sirk0/fix-docker-compose-test

Conversation

@sirk0
Copy link
Copy Markdown

@sirk0 sirk0 commented May 13, 2026

Fix Docker Compose action to check the return code of the health endpoint

Note that the frontend always redirects to homepage in case of 404, so it is not easily possible to reproduce

Original job passing for backend 404: https://github.com/sirk0/full-stack-fastapi-template/actions/runs/25822796893/job/75868162681

Run curl http://localhost:8000/api/v1/utils/health-check-fail
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100    22  100    22    0     0  10045      0 --:--:-- --:--:-- --:--:-- 11000
{"detail":"Not Found"}

Modified job failing for backend 404: https://github.com/sirk0/full-stack-fastapi-template/actions/runs/25826553849/job/75881067711?pr=1

Run curl --fail http://localhost:8000/api/v1/utils/health-check-fail
  curl --fail http://localhost:8000/api/v1/utils/health-check-fail
  shell: /usr/bin/bash -e {0}
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0    22    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404
Error: Process completed with exit code 22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants