Skip to content

Commit

Permalink
pretty printing and logging
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-1991 committed Dec 28, 2023
1 parent f118438 commit 428a1c7
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,20 @@ while [ -n "$(docker ps -f "name=unit-tests" -f "status=running" -q)" ]; do
sleep 5
done

# Print logs of "unit-tests" container
docker logs unit-tests
# Check if "unit-test" container has failed
if [ "$(docker inspect -f '{{.State.ExitCode}}' unit-tests)" -ne 0 ]; then
printf "\n❌ Unit tests failed. Printing logs...\n"
docker logs unit-tests
printf "\n Stopping containers\n"
docker compose -f ./docker-compose-test.yml --env-file local-test.env down
exit 1
fi

# Print test results
printf "\n"
cat dv/unit-tests.log
printf "\n\n✅ Unit tests passed\n\n"

# Stop all containers
docker compose -f ./docker-compose-test.yml --env-file local-test.env down
printf "\n Done\n\n"
printf "\n🎉 Done\n\n"

0 comments on commit 428a1c7

Please sign in to comment.