From d4b0be9ac4df5856ef5ed5e4ba567dd33188be89 Mon Sep 17 00:00:00 2001 From: cytopia Date: Fri, 18 Mar 2022 15:00:45 +0100 Subject: [PATCH] Be more verbose during test startup --- .tests/scripts/compose-start.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.tests/scripts/compose-start.sh b/.tests/scripts/compose-start.sh index eea4dd12..b6ad1d4f 100755 --- a/.tests/scripts/compose-start.sh +++ b/.tests/scripts/compose-start.sh @@ -34,6 +34,8 @@ fi ### HOST_PORT_HTTPD="$( "${SCRIPT_PATH}/env-getvar.sh" "HOST_PORT_HTTPD" )" MYSQL_ROOT_PASSWORD="$( "${SCRIPT_PATH}/env-getvar.sh" "MYSQL_ROOT_PASSWORD" )" +PHP_SERVER="$( "${SCRIPT_PATH}/env-getvar.sh" "PHP_SERVER" )" +HTTPD_SERVER="$( "${SCRIPT_PATH}/env-getvar.sh" "HTTPD_SERVER" )" ### @@ -62,6 +64,9 @@ until curl -sS -I --fail -o /dev/null -w "%{http_code}" "http://localhost:${HOST run "docker-compose exec -T --user devilbox php curl -sS -v 'http://localhost/'" "1" "${DVLBOX_PATH}" || true run "docker-compose exec -T --user devilbox php curl -sS -I 'http://localhost/'" "1" "${DVLBOX_PATH}" || true run "docker-compose exec -T --user devilbox php curl -sS -I -o /dev/null -w '%{http_code}' 'http://localhost/'" "1" "${DVLBOX_PATH}" || true + run "cd ${DVLBOX_PATH} && docker-compose logs" || true + run "cat ${DVLBOX_PATH}/log/php-fpm-${PHP_SERVER}/php-fpm.error" || true + run "cat ${DVLBOX_PATH}/log/${HTTPD_SERVER}/defaultlocalhost-error.log" || true exit 1 fi @@ -83,6 +88,9 @@ until curl -sS --fail "http://localhost:${HOST_PORT_HTTPD}" 2>/dev/null | grep ' printf "[FAIL]\\n" curl -sS -v "http://localhost:${HOST_PORT_HTTPD}" curl -sS -I "http://localhost:${HOST_PORT_HTTPD}" + run "cd ${DVLBOX_PATH} && docker-compose logs" || true + run "cat ${DVLBOX_PATH}/log/php-fpm-${PHP_SERVER}/php-fpm.error" || true + run "cat ${DVLBOX_PATH}/log/${HTTPD_SERVER}/defaultlocalhost-error.log" || true exit 1 fi @@ -114,7 +122,10 @@ until cd "${DVLBOX_PATH}" && docker-compose exec -T php mongofiles --host=mongo i=$(( i + 1 )) if [ "${i}" -eq "60" ]; then printf "[FAIL]\\n" - cd "${DVLBOX_PATH}" && docker-compose exec -T php mongofiles --host=mongo list + cd "${DVLBOX_PATH}" && docker-compose exec -T php mongofiles --host=mongo list || true + run "cd ${DVLBOX_PATH} && docker-compose logs" || true + run "cat ${DVLBOX_PATH}/log/php-fpm-${PHP_SERVER}/php-fpm.error" || true + run "cat ${DVLBOX_PATH}/log/${HTTPD_SERVER}/defaultlocalhost-error.log" || true exit 1 fi @@ -134,7 +145,10 @@ until cd "${DVLBOX_PATH}" && docker-compose exec -T php mysql --user=root --pass i=$(( i + 1 )) if [ "${i}" -eq "60" ]; then printf "[FAIL]\\n" - cd "${DVLBOX_PATH}" && docker-compose exec -T php mysql --user=root --password="${MYSQL_ROOT_PASSWORD}" --host=mysql -e 'show databases;' + cd "${DVLBOX_PATH}" && docker-compose exec -T php mysql --user=root --password="${MYSQL_ROOT_PASSWORD}" --host=mysql -e 'show databases;' || true + run "cd ${DVLBOX_PATH} && docker-compose logs" || true + run "cat ${DVLBOX_PATH}/log/php-fpm-${PHP_SERVER}/php-fpm.error" || true + run "cat ${DVLBOX_PATH}/log/${HTTPD_SERVER}/defaultlocalhost-error.log" || true exit 1 fi @@ -154,7 +168,10 @@ until cd "${DVLBOX_PATH}" && docker-compose exec -T php pg_isready --host=pgsql i=$(( i + 1 )) if [ "${i}" -eq "60" ]; then printf "[FAIL]\\n" - cd "${DVLBOX_PATH}" && docker-compose exec -T php pg_isready --host=pgsql + cd "${DVLBOX_PATH}" && docker-compose exec -T php pg_isready --host=pgsql || true + run "cd ${DVLBOX_PATH} && docker-compose logs" || true + run "cat ${DVLBOX_PATH}/log/php-fpm-${PHP_SERVER}/php-fpm.error" || true + run "cat ${DVLBOX_PATH}/log/${HTTPD_SERVER}/defaultlocalhost-error.log" || true exit 1 fi