diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2c683d12704ff120db82cfd9fc2177fed81685f4..ca1f35fd39dc5f73c11a0cdaf1e79b2583b1187e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,6 +40,9 @@ test_exist_app: - docker:dind stage: unit_tests script: + # set environment variables + - *env + # start Docker container - docker volume create ahikar-existdb_Data-testing - mkdir -p docker/exist/logs - ant -f exist-app/build.xml dependencies xar @@ -48,12 +51,14 @@ test_exist_app: - cd docker || exit - PORT=$(docker-compose ps | grep -E -o "0\.0\.0\.0:[0-9]{5}\->8080" | grep -E -o "0\.0\.0\.0:[0-9]{5}") - sleep 10 + # execute the tests - header=$(curl --head -s http://localhost:8080/exist/restxq/trigger-tests) - status=$(echo $header | head -n 1 | cut -d" " -f 2) - echo "Current HTTP status is $status." - if [[ "$status" != "200" ]]; then exit 1; fi - curl http://localhost:8080/exist/restxq/trigger-tests - sleep 40 + # evaluate the tests - failures=$(./get-unit-test-failures-and-errors.sh) - echo -e "\033[1;33mThere is/are currently $failures failures or errors.\033[0m" - if [[ "$failures" -gt 0 || ! -f "exist-app/test/ahikar-test-results.xml" ]]; then exit 1; else exit 0; fi