diff --git a/test/test.sh b/test/test.sh index 90ec5a6e9..6086ab83d 100755 --- a/test/test.sh +++ b/test/test.sh @@ -26,6 +26,7 @@ # THRIFT-847 Test Framework harmonization across all languages # THRIFT-819 add Enumeration for protocol, transport and server types +START_TIME=$SECONDS cd "$( dirname "$0" )" BASEDIR=$(pwd) @@ -33,6 +34,65 @@ print_header() { printf "%-16s %-11s %-17s %-s\n" "client-server:" "protocol:" "transport:" "result:" } +STATUS_HTML="status.html" + +print_html_header() { +cat << EOF > $STATUS_HTML + + + + +Apache Thrift - integration test suite + + + + + + +

Apache Thrift - integration test suite: Results

+ + + + + + + + + + +
ServerClientProtocolTransportResult (log)
+ +

Test Information

+
+Test Date:     `date --iso-8601=seconds`
+Revision:      `git rev-parse --short HEAD`
+OS:            `uname -a`
+Test duration: $duration
+
+ + +EOF +} + intersection() { return_value="" for one in $1; do @@ -65,9 +125,11 @@ do_test () { timeout $client_timeout $client_exec > log/${testname}_client.log 2>&1 if [ "$?" -eq "0" ]; then - echo " success" + result="success($?)" + echo " $result" else - echo " failure" + result="failure($?)" + echo " $result" # add details to the error.log print_header >> log/error.log printf "%-16s %-11s %-17s\n" ${client_server} ${protocol} ${transport} >> log/error.log @@ -79,6 +141,21 @@ do_test () { echo "" >> log/error.log fi + # write json array + client_server=( ${client_server//[-]/ } ) + server=${client_server[0]} + client=${client_server[1]} + + cat << EOF >> $STATUS_HTML + [ + "${client}", + "${server}", + "${protocol}", + "${transport}", + "${result} (client, server)" + ], +EOF + # silently kill server kill ${server_pid} 2>/dev/null && wait ${server_pid} 2>/dev/null } @@ -86,14 +163,18 @@ do_test () { echo "Apache Thrift - integration test suite" date -ant -f ../lib/java/build.xml compile-test 1>/dev/null echo "======================================================" rm -rf log mkdir -p log + print_header +print_html_header + +ant -f ../lib/java/build.xml compile-test 1>/dev/null + #TODO add enum for parameters #TODO align program arguments across languages @@ -300,6 +381,14 @@ do_test "rb-rb" "binary-accl" "buffered-ip" \ "5" "5" echo " failed tests are logged to test/log/error.log" -echo " full log is here test/log/client_server_protocol_transport.log" +echo " full log is here test/log/client_server_protocol_transport_client.log" +echo " full log is here test/log/client_server_protocol_transport_server.log" +echo " or look at file://$BASEDIR/$STATUS_HTML" + +ELAPSED_TIME=$(($SECONDS - $START_TIME)) +DURATION="$(($ELAPSED_TIME/60)) min $(($ELAPSED_TIME%60)) sec" +echo "test an took" $DURATION +print_html_footer "$DURATION" + date cd -