FitTrackee/test.sh
2020-01-31 09:12:52 +01:00

29 lines
595 B
Bash

#!/bin/bash
fails=''
inspect() {
if [ $1 -ne 0 ]; then
fails="${fails} $2"
fi
}
docker-compose -f docker-compose-ci.yml run fittrackee-api py.test fittrackee_api -p no:warnings
inspect $? api
docker-compose -f docker-compose-ci.yml run fittrackee-api flask db upgrade
docker-compose -f docker-compose-ci.yml run fittrackee-api flask initdata
docker-compose -f docker-compose-ci.yml restart fittrackee-api
testcafe chrome fittrackee_client/e2e -e
inspect $? e2e
if [ -n "${fails}" ];
then
echo "Tests failed: ${fails}"
exit 1
else
echo "Tests passed!"
exit 0
fi