Skip to content

Commit

Permalink
improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
maaikelimper committed Jun 2, 2024
1 parent 86cf2ba commit c3b94f7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/test_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@ jobs:
with:
python-version: 3.8

- name: Docker Compose up -d --build
- name: Docker Compose up -d --build, sleep 10 seconds to ensure service is up
working-directory: docker_compose_test
run:
docker-compose up -d --build

- name: Check status code /list
sleep 10
- name: Check status code /list, fail if not 200
run: |
status_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/list)
if [[ $status_code -ne 200 ]]; then
echo "Request failed with status code $status_code"
curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/list
if [ $? -ne 0 ]; then
echo "curl failed"
exit 1
fi
if [ $(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/list) -ne 200 ]; then
echo "status code not 200"
exit 1
fi

0 comments on commit c3b94f7

Please sign in to comment.