Shinsuke Sugaya 1 gadu atpakaļ
vecāks
revīzija
7f12894ad7
2 mainītis faili ar 14 papildinājumiem un 11 dzēšanām
  1. 11 9
      src/test/resources/before_script.sh
  2. 3 2
      src/test/resources/run.sh

+ 11 - 9
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
 

+ 3 - 2
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