Skip to content

Commit

Permalink
update script
Browse files Browse the repository at this point in the history
  • Loading branch information
marevol committed Feb 10, 2024
1 parent 99d941d commit 7f12894
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
20 changes: 11 additions & 9 deletions src/test/resources/before_script.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

5 changes: 3 additions & 2 deletions src/test/resources/run.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 7f12894

Please sign in to comment.