From 7f12894ad72ac01ebf3309b38b795baa324bb231 Mon Sep 17 00:00:00 2001 From: Shinsuke Sugaya Date: Sat, 10 Feb 2024 09:52:32 +0900 Subject: [PATCH] update script --- src/test/resources/before_script.sh | 20 +++++++++++--------- src/test/resources/run.sh | 5 +++-- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/test/resources/before_script.sh b/src/test/resources/before_script.sh index bc9e57dc0..f41523aa9 100644 --- a/src/test/resources/before_script.sh +++ b/src/test/resources/before_script.sh @@ -1,23 +1,26 @@ #!/bin/bash set -xuo pipefail -temp_file=/tmp/fess-build.$$ -unzip target/releases/fess-*.zip > ${temp_file} 2>&1 -tail ${temp_file} +temp_log_file=/tmp/fess-build.$$ +unzip target/releases/fess-*.zip > ${temp_log_file} 2>&1 +tail ${temp_log_file} -./fess-*/bin/fess > ${temp_file} 2>&1 & +./fess-*/bin/fess > ${temp_log_file} 2>&1 & +temp_json_file=/tmp/fess-log.$$ +touch ${temp_json_file} error_count=0 while true ; do - status=$(curl -w '%{http_code}\n' -s -o /dev/null "http://localhost:8080/api/v1/health") + status=$(curl -w '%{http_code}\n' -s -o ${temp_json_file} "http://localhost:8080/api/v1/health") + cat ${temp_json_file} if [[ x"${status}" = x200 ]] ; then break else error_count=$((error_count + 1)) fi - if [[ ${error_count} -ge 180 ]] ; then + if [[ ${error_count} -ge 60 ]] ; then echo "Fess is not available." - cat ${temp_file} ./fess-*/logs/*.log + cat ${temp_log_file} ./fess-*/logs/*.log exit 1 fi sleep 1 @@ -27,6 +30,5 @@ pushd /tmp >/dev/null git clone https://github.com/codelibs/fess-testdata.git popd >/dev/null -touch $(ls -d ./fess-*/logs)/fess-crawler.log -tail -f ${temp_file} ./fess-*/logs/*.log & +cat ${temp_log_file} ./fess-*/logs/*.log diff --git a/src/test/resources/run.sh b/src/test/resources/run.sh index ea131a71f..593df8355 100644 --- a/src/test/resources/run.sh +++ b/src/test/resources/run.sh @@ -1,8 +1,9 @@ #!/bin/bash -tail -f ./fess-*/logs/fess-crawler.log & +touch $(ls -d ./fess-*/logs)/fess-crawler.log +tail -f ./fess-*/logs/*.log & -mvn test -P integrationTests -Dtest.fess.url="http://127.0.0.1:8080" -Dtest.search_engine.url="http://127.0.0.1:9201" +mvn test -P integrationTests -Dtest.fess.url="http://localhost:8080" -Dtest.search_engine.url="http://localhost:9201" --debug ret=$? if [ $ret != 0 ] ; then