Browse Source

update test scripts

Shinsuke Sugaya 2 năm trước cách đây
mục cha
commit
344560bdaa
2 tập tin đã thay đổi với 13 bổ sung14 xóa
  1. 11 10
      src/test/resources/before_script.sh
  2. 2 4
      src/test/resources/run.sh

+ 11 - 10
src/test/resources/before_script.sh

@@ -1,25 +1,26 @@
-#!/bin/sh
+#!/bin/bash
 
 TMP_FILE=/tmp/fess-build.$$
 unzip target/releases/fess-*.zip 2>&1 > $TMP_FILE
 tail $TMP_FILE
 
 ./fess-*/bin/fess 2>&1 > $TMP_FILE &
-sleep 3
+
+pushd /tmp
+git clone https://github.com/codelibs/fess-testdata.git
+popd
+
 tail $TMP_FILE
 touch `ls -d ./fess-*`/logs/fess-crawler.log
 tail -f ./fess-*/logs/*.log &
 
 counter=0
 ret=1
-while [ $ret != 0 -a $counter != 60 ] ; do
+while [ $ret != 0 -a $counter != 180 ] ; do
   echo "Ping Fess... $counter"
-  curl -v 127.0.0.1:8080/json/?type=ping
-  #ret=$?
-  ret=1
-  sleep 5
-  counter=`expr $counter + 1`
+  curl -v "localhost:8080/json/?type=ping"
+  ret=$?
+  sleep 1
+  counter=$((counter + 1))
 done
 
-cd /tmp
-git clone https://github.com/codelibs/fess-testdata.git

+ 2 - 4
src/test/resources/run.sh

@@ -1,14 +1,12 @@
 #!/bin/bash
 
-cd `dirname $0`
-cd ../../..
-BASE_DIR=`pwd`
+tail -f ./fess-*/logs/*.log &
 
 mvn test -P integrationTests -Dtest.fess.url="http://127.0.0.1:8080" -Dtest.es.url="http://127.0.0.1:9201"
 ret=$?
 
 if [ $ret != 0 ] ; then
-  for f in `find $BASE_DIR -type f | grep surefire-reports | grep -v /TEST-` ; do
+  for f in `find ./target -type f | grep surefire-reports | grep -v /TEST-` ; do
     cat $f
   done
 fi